[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[sc-users] quick question regarding Pause.kr
- To: sc-users@xxxxxxxxxxxxxxxx
- Subject: [sc-users] quick question regarding Pause.kr
- From: casey anderson <casey.thomas.anderson@xxxxxxxxx>
- Date: Tue, 21 Jul 2009 20:27:55 -0700
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=xarx7XxKlpEYI014kAYRH5hcLp6QiJkSzgvRnpl3+6o=; b=mLn7iET+ZYq7Bzm+M7D3kbxPT83ytDoXfFQQkHOFuAczcrPmT1aWsngii311L/tPdW cQtMM4+z8fkv4l5Y7PhFBDlwfj+eehMptGwO+TBK9pxN6mS/ujFIJ/WP3Gdl9QC+Y7XJ pY4kF/4jVGepHNDliVptXLfR1335dXRdC6FVI=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=gq7aNuf6h4dC30pfHn5Y0rGOkwpjm33eZDv1eqKDG6cTcEPIMjOyPon78cHbEI/mCQ HSzXDrzR/os6dwl7F3/jp0lt5EvHIc2GPAmQgRtwqRVgMKdqkyopR/gaYwJVjA00J1ao YKJlDnsyWqEZcqLPr/HIuX3QUZPxBNh4TPRpQ=
- List-id: SuperCollider users mailing list <sc-users.create.ucsb.edu>
- Reply-to: sc-users@xxxxxxxxxxxxxxxx
- Sender: owner-sc-users@xxxxxxxxxxxxxxxx
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 );
}).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
--
http://www.ctandersonmusic.com/
_______________________________________________
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/