derick
February 17, 2020, 8:52am
1
(
SynthDef(\sine, {
arg freq=440, atk=0.005, rel=0.3, amp=1, pan=0;
var sig, env;
sig = SinOsc.ar(freq);
env = EnvGen.kr(Env.new([0,1,0], [atk, rel], [1, -1]), doneAction:2);
sig = Pan2.ar(sig, pan, amp);
sig = sig * env;
Out.ar(0, sig);
}).add;
)
x = Synth(\sine, );
(
p = Pbind(
\instrument, \sine,
\dur, Pseq([1, 0.5, 0.5], 1);
\freq, Pseq([330, 370, 200], 1);
).play;
)
^^ The preceding error dump is for ERROR: Pbind should have even number of args.
Confusing. No idea what’s going wrong here.
htor
February 17, 2020, 9:17am
2
derick:
p = Pbind( \instrument, \sine,
\dur, Pseq([1, 0.5, 0.5], 1);
\freq, Pseq([330, 370, 200], 1);
replace the semicolons with commas on dur and freq line endings. remember, those are function arguments, not statements! pbind expects pairs of arguments (even number), but now it’s confused because of the semicolons.
derick
February 17, 2020, 9:21am
3
derick:
( p = Pbind( \instrument, \sine, \dur, Pseq([1, 0.5, 0.5], 1); \freq, Pseq([330, 370, 200], 1); ).play; )
I see the mistake. Thanks.