Can anyone tell me how to multiply a signal by -1 every time the signal goes to zero?
If you multiply zero you will get zero.
I want it to invert the signal every time the input goes to zero. Like a flip flop triggered by a zero in the input, multiplied by the input.
Do you want to detect level zero or zero crossings in the waveform?
This shared patch is supposed to detect zero crossings:
You’d have to double check if it works. I found this before, when doing my Broken Fuzz patch a year ago. Unfortunately i am more versed with PD. In general am quite sure you’ll find more wisdom about gen at cycling74.com.
You’ll eventually need to speed limit the triggers from the zero crossings, as there are very many.
A gen thread about this is here.
EDIT: The best example really is already in the gen~examples: gen~.zerox !
EDIT 2: [abs] already does the trick. Was too simple to remember that in the first place…
I want to detect zeros, not zero crossings, then output -1 1 -1 1 -1 etc…