Hey everyone!
I’m quite new to SuperCollider and I wonder if there is a possibility (and as I know in SuperCollider there is one) to pan my Synth in a pattern in this special way: Starting at pan position 0, then -1, back to 0, then 1, back to 0 and starting all over.
I’ve tried this slightly changed “trick” described in the “Practical Guide to Patterns” by H. James Harkins:
(
SynthDef.new(\test, {
arg freq = 440, atk = 0.01, rel = 0.5, pan = 0, out = 0, amp = 0.05;
var sig, env;
sig = SinOsc.ar(freq);
env = Env.perc(atk, rel).ar(2);
sig = sig * env;
sig = Pan2.ar(sig, pan);
Out.ar(out, sig * amp);
}).add
)
(
Pbind(
\instrument, \test,
\dur, 0.2,
\freq, 440,
\pan, Pn(Pif(Ptime(inf) <= 20.0, Penv([0, -1, 0, 1, 0], [5, 5, 5, 5], 'lin')), inf),
).play;
)
This works well!
But what do I have to change to make this panning movement evolving exponentially in time?
I’ve tried to replace the time values in the Penv (also in one case wraped in a Ptuple) with Pseg but SuperCollider then says that there is no Boolean in test (+ “RECEIVER: a Pbinop”):
\pan, Pn(Pif(Ptime(inf) <= 20.0, Penv([0, -1, 0, 1, 0], Ptuple([(Pseg([5, 0], 20, 'lin', 1)), (Pseg([5, 0], 20, 'lin', 1)), (Pseg([5, 0], 20, 'lin', 1)), (Pseg([5, 0], 20, 'lin', 1))]), 'lin')), inf),
The reason seems to be that Ptime is missing some kind of time information or so…
Can someone tell me what to use or change?
Thank you for your time and answers!