Quantcast

mouse position inside Pbind for rithmic modulations

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

mouse position inside Pbind for rithmic modulations

skwwwks
I would like to use mouse position  (f variable)  inside Pbind /dur to play different rithmes
but I getting error



(
SynthDef("tone2", { arg freq = 440, amp=0.5, gate=1, envdur=1.5;
var sound, env;
env = EnvGen.kr(Env.perc(0.01, envdur), doneAction:2);
sound = Pan2.ar(SinOsc.ar(freq, 0, amp)*env, 0);
Out.ar(0, sound);
}).load(s);
)


(

var k = 11.25;
a = [20,30,40,50,60];
o = [1,2,3,4,5,6,7];



// Play the all the notes of the tuning
Pbind(
var f;
f = MouseY.kr(0.01, 1, 0, 0.2);

//\freq, Pseq( a, inf),
\freq, Pn(Prand( a*k*2, 1)),  
\dur, f,   //  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
\amp, 0.3,
\sustain, 0.6,
\instrument, \tone2
).play;

)
///////////////////////////////////////////
Loading...