[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sc-users] Working with playbuf/trigger



Thanks for the help, t_trig and decay.kr worked out well!


-Sam

On Sat, May 2, 2009 at 12:41 AM, Batuhan Bozkurt <batuhan@xxxxxxxxxxxxxxxxxx> wrote:
Hi Sam, not really following you here (sorry insufficient sleep) but this sounds like it can be managed by using t_trig type arguments... Search for t_trig in SynthDef help file for more info.

SynthDef(\trigme, { arg t_trig1; Out.ar(0, SinOsc.ar(220, 0, Decay.kr(t_trig1, 0.1))); }).memStore;

a = Synth(\trigme);

a.set(\t_trig1, 1);
a.set(\t_trig1, 1);
a.set(\t_trig1, 1);
//and so on...

Sorry if that is irrelevant, hope that helps.
Batuhan

On May 2, 2009, at 7:28 AM, Sam Ingrassia wrote:

Thanks to everyone in advance -

MyApp.applicationData.at("KeyboardOperator").at("CurrentNodeProxy").source = { 
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:

MyApp.applicationData.at("KeyboardOperator").at("CurrentNodeProxy").source = { 
arg rate = 1, trigger = 0, startPos = 0, loop = 1;
PlayBuf.ar(1,b,rate,trigger,startPos, loop).dup;
};

MyApp.applicationData.at("KeyboardOperator").at("CurrentNodeProxy").set(\trigger, 1);

MyApp.applicationData.at("KeyboardOperator").at("CurrentNodeProxy").set(\trigger, 0);

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