[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[sc-users] changing the rate of Routine
Hi List.
I can't find any documentation on how to change the rate of
a routine in realtime.
For example if
I have a routine with 1.wait...play(SystemClock)..as below,
how could I change this code so that the rate
increases or decreases gradually - As XLine would do in
the synthesis side.
Will I have to create a nested routine?
- I am also unsure how as to go about this..
Thanks for reading. M
(
SynthDef("sawosc", {
arg freq = 3, filt = 1000, pan = 0.5, main, whole;
main = Mix.ar([Saw.ar(200+freq)]);
main = (main*EnvGen.kr(Env.perc, 1.0, doneAction: 2));
whole = Pan2.ar(
RLPF.ar(main,filt, 0.3), pan);
Out.ar(0, whole)
}
).play(s)
)
(
var a, amp, pAmp, nextAmp;
a= Pseq(#[20, 40, 50, 70, 80, 90, 100, 110], inf).asStream;
Routine({
inf.do({
Synth.new("sawosc",
[ \freq, a.next.midicps, \filt, exprand(200, 1000),
\pan, [-1, 0, 1].wchoose([0.1, 0.7, 0.4]) ]
);
(
((120/60)/8)).wait
});
}).play(SystemClock );
)