I have an input stream of 0 or 1 values (sensor input). I want a single bang only when the value changes from 0 to 1. In something like Python I might do it like this
newvalue = sensorInput()
if newvalue==1 and oldvalue==0:
bang()
oldvalue=newvalue
but how do you it in Pd?
or another way of putting it, I want to trigger only on the rising edge of the square wave pulse.
I've been trying different convoluted things with spigot, oneshot, expr, etc., but I still get this continuous flow of bangs no matter what. I thought [threshold] would do it, but I can't get that object to do anything at all, and the help example doesn't do anything either.
thanks for any help, this is tying my brain in a knot.