My first post here, hello all!
As an exercise I'm making a patch that emulates an oldschool flipflop squarewave octaver like in an MXR bluebox or in some analog synths and organs.
I'm getting really close using {expr~ $v1 > 0] to convert a sine to a squarewave and with a short delay [expr~ $v1 > $v2] compares one sample to a delayed one to check if the value of the new sample is higher than the one before. This gives me a pulse every time the value went from 0 to 1. Those pulses go to an [rpole~ 1] as an integrator and [expr~ pow(-1, $v1) ] converts that ramp to 0 and 1 at half the original frequency.
This does work, but at higher frequencies I'm getting a 'ripple' on both rising and falling edges of about three or four alternating 0's and 1's that I can't seem to find the culprit of. Any ideas?