If i'm using OSCdef to listen for changes from a function, such as:
OSCdef('listen', {
arg msg;
~trigger = msg[5]; // This value is 0 when off, 1 when on
~amp = msg[3].linexp(0.0, 1.0, 0.7, 0.8 );
~dur = msg[4].linexp(0.1, 1.0, 1.0, 0.01);
~pitch = msg[4].linlin(0.0, 1.0, 80, 800);
}, '/ctrl');
When ~trigger
fires, the variable becomes 1. I want to play a synth or open an env to change the sound.
However, when ~trigger
fires, it fires for 10 seconds randomly, so you'll have 1,1,0,1,0,0,0,1,0,01,01,01,01,1,01, etc for 10 seconds.
I want to know if it's possible to catch the first 1, play an event and ignore the remaining triggers for the next 10 seconds