arg rate = 1, trigger = 0, startPos = 0, loop = 1;
//enable trigger
trigger = if(BinaryOpUGen('==', trigger, 1), Impulse.kr(MouseX.kr(0.5,100,0.5)), 0);
PlayBuf.ar(1,b,rate,trigger,startPos, loop).dup;
};
With the above code, when i set trigger to 1 i can then take control via impulse/MouseX to execute trigger. My question is, how can I just execute trigger just once? for instance doing something like this:
arg rate = 1, trigger = 0, startPos = 0, loop = 1;
PlayBuf.ar(1,b,rate,trigger,startPos, loop).dup;
};
I would think that this would jump to the startPos and then continue playing, which is the behavior that I am trying to achieve. This leads me to believe that impulse is executing at a different time/context (which i do not fully understand yet) and modulating with the value from MouseX. How can I trigger a jump back just using NodeProxy.Set()?
Thanks again,
Sam