Convert signal into bangs

PSG's icon

Is there any good reason why edge~ is not creating bangs when the ramp from sync~ hits (or even crosses through) zero? Isn't this what edge~ is designed to do -- bang at transitions to and from zero?! I saw an old post where somebody did exactly this with an audio signal.

To be sure I am getting 0 I tried subtracting .5 from the signal (forcing the signal to go into negative territory), but that doesn't even get edge~ to recognize a 0.

Roman Thilenius's icon


because, depending on the speed, it might not reach exactly 0.

what you can do for nonzero-to-zero-signal-to-bang is this:

phasor~
-~ 0.5
%~ 1.
+~ 0.5
edge~


this will then also work with various other objects - such as custom phasor-modificiation patches, the brandnew 8.3 externals and, of course, rate~, sync~, and line~ - and it will also work in older 32 bit systems which had even more (mostly unavoidable!) "issues" like that.



Andy Maskell's icon

I got it to work like this:

Roman Thilenius's icon


damn, i should have opened max.

the % solution above is only the to-go solution for up to ~3000 bmp.

it could make sense if you have a - 0.5 % 1.0 phase somewhere running already anway.

the mathematically correct solution is this:

phasor~
delta~
<~ -0.5
edge~


this works up to nyquist.

Roman Thilenius's icon


andy´s solution work until 8000 bpm, its accuracy depends on the current vectorsize, and it reports twice instead of once^^

Andy Maskell's icon

I think the Audio Interrupt and Overdrive settings might be important as well.

Roman Thilenius's icon


no wonder with zerox~ :)

(btw. in my phasor patches i am actually using <~ -0. - so that it theoretically works until samplingrate. but i recommend against this for a general purpose patch.)

PSG's icon

Thanks, you two, this is all very helpful! So far I tried out Roman's second solution and it does work well with sync~ substituting for the phasor~.