Hello everybody,
I am kind of new to supercollider and in this forum so maybe my question is a bit basic.
Ι am trying to use a routine which every one second change the content of a buffer used for wavetable synthesis and this routine runs in system clock.The problem is it sound to me kind of not coherent in terms of tempo.
Could someone point what am I doing wrong or propose to me a better practice to achieve the same result?
This is the chunk of code.
(
r=Routine{
loop{
s.bind{
~env=Env([0]++ Array.rand(10,-1.0,1.0).normalize(-1,1)++[0],Array.rand(11,0.01,1),Array.rand(11,-4.0,4.0));
(
s.waitForBoot{
Buffer.freeAll;
s.sync;
~buf=Buffer.alloc(s,2.pow(13));
s.sync;
~wt=~env.discretize(2.pow(12)).asWavetable;
~buf.sendCollection(~wt);
s.sync;
});
};
1.wait;}
}
)
r.play(SystemClock);
r.stop;
(
{Osc.ar(~buf,freq:[200,201] ,mul: 0.1)}.play;
{Osc.ar(~buf,freq:[200,201]*0.5 ,mul: 0.1)}.play;
{Osc.ar(~buf,freq:[200,201]*0.25 ,mul: 0.1)}.play;
{Osc.ar(~buf,freq:[200,201]*0.125 ,mul: 0.1)}.play;
{Osc.ar(~buf,freq:[200,201]*2 ,mul: 0.1)}.play;
{Osc.ar(~buf,freq:[200,201]*3/2 ,mul: 0.1)}.play;
{Osc.ar(~buf,freq:[200,201]*4/3 ,mul: 0.1)}.play;
{Osc.ar(~buf,freq:[200,201]*5/4 ,mul: 0.1)}.play;
{Osc.ar(~buf,freq:[200,201]*6/5 ,mul: 0.1)}.play;
{Osc.ar(~buf,freq:[200,201]*7/6 ,mul: 0.1)}.play;
{Osc.ar(~buf,freq:[200,201]*8/7 ,mul: 0.1)}.play;
{Osc.ar(~buf,freq:[200,201]*9/8 ,mul: 0.1)}.play;
{Osc.ar(~buf,freq:[200,201]*11/10 ,mul: 0.1)}.play;
)