[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [sc-users] quick question regarding Pause.kr
On Tuesday 21 July 2009 23:27:55 casey anderson wrote:
> hi list,
>
> im trying to use randomly generated 1s and 0s, from MaxMSP, to pause
> and unpause a synth in supercollider using Pause.kr (this is done over
> OSC). when i stumbled upon this object a few weeks ago, and played
> around with the help files, it seemed like something that would allow
> me to randomly turn on and off a synth at a fairly fast rate while i
> continually altered various other data parameters. however, im doing
> something wrong here, as the synth does not actually pause ever. below
> is an excerpt from my code:
>
> ///below are excerpts of my patch
> var fft_b;
>
> fft_b = Buffer.alloc( s, 2048, 1 );
>
> /////////SynthDefs
> SynthDef( \impulseBinShift, { arg amp, fft_b, freq, gate = 0, gate1 =
> 0, phase, str, shft;
> var env, in, fft, playMe;
> env = EnvGen.kr( Env([0, 1, 0], [1, 1], \sin, 1), gate, doneAction: 2);
> in = Impulse.ar( freq, 0, 0.9 ) * env;
> fft = IFFT( PV_BinShift( FFT( fft_b, in ), str, shft ) );
> playMe = ( fft * amp );
> Out.ar( [ 0, 1 ], playMe );
> Pause.kr( gate1, 1001 );
is the second argument the ID of the synth?
Does your synth always have that ID?
sincerely,
Marije
> }).memStore;
>
> //play and stop buttons start/stop both synths
> OSCresponder( nil, '/startStop', {
>
> | t, r, m |
>
> switch( m[1],
> '/start', {
> w = Synth( \impulseBinShift, [ \amp, 0.01, \freq, 1, \str, 0.25,
> \shft, 0.1, \gate, 1, \gate1, 1 ]);
> x = Synth( \lfBrownNoise, [ \amp, 0.01, \freq, 1, \dev, 0.25,
> \dist, 0.1, \gate, 1, \gate1, 1 ]);
> y = Synth( \crackle, [ \amp, 0.01, \param, 1, \gate, 1, \gate1, 1 ] );
> },
> '/stop', {
> w.release;
> x.release;
> y.release;
> }
> )
> }).add;
>
> //controls for synth1
> OSCresponder( nil, '/synth1', {
>
> | t, r, m |
>
> "synth1".postln;
> switch( m[ 1 ],
> '/amp', { w.set( \amp, m[ 2 ] ); },
> '/freq', { w.set( \freq, m[ 2 ] ); },
> '/str', { w.set( \str, m[ 2 ] ); },
> '/shft', { w.set( \shft, m[ 2 ] ); },
> '/gate1', { w.set( \gate1, m[ 2 ] ); }
> )
> }).add;
>
> i use MaxMSP over OSC for control structure stuff fairly regularly
> (though i want to switch over to supercollider exclusively, but im
> still trying to beef up my code chops in order to do that
> effectively...heh). regardless, i was wondering if anyone has any idea
> why the Pause.kr will not actually pause the synth at all in the above
> example. i have verified that the OSC message im creating in Max is
> going over to SC perfectly fine, so im fairly certain i am just doing
> something incorrectly with Pause.kr. any input would be greatly
> appreciated.
>
> casey
_______________________________________________
sc-users mailing list
info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: https://listarc.bham.ac.uk/marchives/sc-users/
search: https://listarc.bham.ac.uk/lists/sc-users/search/