Hi! I’m pretty new to sc and I’m sorry for bringing this up again. I’ve read the Unfixed Pbind duration and Advancing patterns by hand (or: unfixed pattern duration) but I can’t seem to understand how to work this thing out.
I want to step thru this pattern just by running ~stream.next(()).play;
the problem is that the synth won’t release itself (from \sendGate, false I guess). Is there some way to fix this?
(
SynthDef(\treble, {|root, ratio1, ratio2, gate = 1|
var osc1, osc2, sum;
osc1 = Saw.ar(root * ratio1) * EnvGen.kr(Env.asr(0.01, 1, 1), gate, doneAction:2) * 0.5;
osc2 = Saw.ar(root * ratio2) * EnvGen.kr(Env.asr(0.01, 1, 1), gate, doneAction:2) * 0.5;
sum = osc1 + osc2;
sum = sum!2;
Out.ar(0, sum.tanh);
}).add;
Pdef(\part1,
Pbind(
\instrument, \treble,
\root, 220,
\ratio1, Pseq([2/1, 2/1, 2/1, 2/1, 2/1,
12/5, 12/5, 12/5, 12/5, 12/5,
3/2, 3/2, 3/2, 3/2, 3/2,
2/1, 12/5, 6/2], inf),
\ratio2, Pseq([Rest(), 7/4, 7/4, 7/4, 7/4,
Rest(), 9/8, 9/8, 9/8, 9/8,
Rest(), 4/3, 4/3, 4/3, 4/3,
7/8, 1/1, 9/8], inf),
\sendGate, false,
));
~stream = Pdef(\part1).asStream;
)
~stream.next(()).play;