> symbol on an audiorate Ugen. What does that do?

    inSig=SoundIn.ar(0);
local = Limiter.ar(LocalIn.ar(2) + (inSig > \whatdoesthisdo.kr(0.00000001)).dup)

I am having some problems finding out this part of a synthdef, especially the inSig >. What is actually happening? It creates alot of super harsh noise.

It’s a comparator: in a > b, the output signal is 1 if, well, a is greater than b, and 0 if a is less than or equal to b.

Typically this is not used for audio output, but rather for control.

hjh

So in this example it removes sound and that is what is sounding like distorition? It is not distorion at all…

Can you post the whole Synthdef? It is hard to give advice on a couple of lines taken out of context:)

Or are you asking what

\something.kr()

means?
Because the code you have isn’t comparing audio and a symbol, but an audio signal and a control rate signal.

(Look up NamedControl if this is the case)

The reason why it sounds like distortion, without being a more typical-sounding type of wave-shaping distortion, is because the comparator has only two possible values: 0 and 1.

Therefore the bit depth of the comparator’s output is one bit only.

Take a bit crusher plug-in and turn it down to one bit resolution. It will probably sound somewhat similar.

Lower bit depth = more noise. One characteristic of low-resolution digital noise is that it’s harmonically related to the frequencies in the original signal. This will make it sound like distortion, rather than broad-band noise.

Or, another way to explain the relationship between a comparator and distortion is – another way to implement a comparator is to subtract the two signals (so that a == b produces 0, a > b produces positive values, and a < b produces negative values) – then multiply by a ridiculously large value, and clip to 0.0 - 1.0. Multiply-and-clip is a formula for harsh digital distortion – meaning that a comparator effectively is distortion.

var thresh = \whatdoesthisdo.kr(0.00000001);

// comparator
inSig > thresh

// re-implemented as extreme digital distortion
((inSig - thresh) * 1e30).clip(0, 1)

If you use the second formula in your SynthDef in place of the first, I expect you’ll get a very similar result.

I’d also point out that it’s extremely unusual to use a comparator this way (unusual, because normally we do not want one-bit signals!). Normally, comparators are used to control other audio signals. Omri Cohen’s video about comparators is for VCV Rack but signal processing logic is more or less the same everywhere, so this might help you to understand how comparators are normally used – https://www.youtube.com/watch?v=icnTFlM6rCE

hjh

Sorry for the very very late reply. And thanks for the thorough explanation.
I’ve been watching the video you suggested a couple of times now and am experimenting with how I could implement this into SC so many thanks for the tip.

Sorry for very late reply. Here is the synth

SynthDef(\instantNoiseJukeBox, {
	arg feedback=1;
	var inSig, local;
	inSig=SoundIn.ar(0);
	local = Limiter.ar(LocalIn.ar(2) + (inSig > \noiseG.kr(0.00000001)).dup); 
	2.do {local= AllpassL.ar(local, 0.06,Rand(0.001,0.05),0.1)};
	LocalOut.ar(local*feedback);
	Out.ar(\out.kr(0),(local)*\amp.kr(0.2));
}).add;

//very noisey
y= Synth(\instantNoiseJukeBox,[\feedback,1,\out, 0,\amp,0.05]);

//change
y.set(\feedback,0.02,\amp,0.05,\noiseG,0.001)