[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sc-users] OSC Pattern Scheduling



tom tlalim <ttlalim@xxxxxxxxx> writes:

> s.stop
> s.reset
> s.play;

Nice;). 

I use r.play(TempoClock.default, [4.0, -0.15]);

I have two routines. One routine contains the snare and the other, the
big drum. Each routine contains 8 beats. When I start the routine, is
there any way to have them start counting at the same relative beat?. 

Now the snare end on top of the big drum for some reason. 

Entire code is:

Tempo.bpm = 90;
r = Routine({
	var	startCycle;
	loop{
		startCycle = thisThread.clock.beats;
		//		Synth.new(\DrumSineBass);
		//1-0.1
		Synth("kickDrum",[\gate,1,\vol,0.4]);  
		0.15.wait;  
		
		// 1
		//		Synth("kickDrum3",[\gate,1]);
		Synth("bd4",[\gate,1]);
		0.5.wait;  
		
		// 1.5
		Synth("bd4",[\gate,1]);  
		1.5.wait;  
 		// 3.0
		Synth("bd4",[\gate,1]);  
		0.5.wait;  
		//3.5
		Synth("bd4",[\gate,1]);  
		1.5.wait;
		// 5.0
		Synth("bd4",[\gate,1]);  
		0.48.wait;  
		// 5.48
		Synth("bd4",[\gate,1]);  
		0.52.wait;
		//6.0
		0.89.wait;
		//6.89
		Synth("bd4",[\gate,1,\vol,0.6]);  
		0.11.wait;
		//7.00
		Synth("bd4",[\gate,1,\vol,0.9]);  
		0.538.wait;
		//7.538
		Synth("bd4",[\gate,1,\vol,0.9]);  
		0.462.wait;
		//8.0
		0.38.wait;
		//8.38
		Synth("bd4",[\gate,1,\vol,0.9]);  
		// we know exactly when the cycle started, so we can add 4 and subtract the current logical time
		(startCycle + 8.0 - thisThread.clock.beats).wait;
		// now we're at the original integer beat + 4.9 (or 8.9, etc.)
	}
})
r.play(TempoClock.default, [4.0, -0.15]);
r.stop;
r.reset;

s = Routine({
	var	startCycle;
	loop{
		startCycle = thisThread.clock.beats;
		//1-0.1
		2.15.wait;  
		// 2.0
		Synth("snare909ish");
		2.0.wait;  
		// 4.0
		Synth("snare909ish");
		2.0.wait;  
		//6.0
		Synth("snare909ish");
		2.0.wait;
		//8.0
		Synth("snare909ish2");

		// we know exactly when the cycle started, so we can add 4 and subtract the current logical time
		(startCycle + 8.0 - thisThread.clock.beats).wait;
		// now we're at the original integer beat + 4.9 (or 8.9, etc.)
	}
})
//.play(TempoClock.default, [4.0, -0.15]);

s.play(TempoClock.default, [4.0, -0.15]);
s.stop;
s.reset;

-- 
Esben Stien is b0ef@e     s      a             
         http://www. s     t    n m
          irc://irc.  b  -  i  .   e/%23contact
          [sip|iax]:   e     e 
           jid:b0ef@    n     n