| Author |
Message |
SplinterPsyche
Joined: Jun 27, 2008 Posts: 1 Location: Berlin
|
Posted: Fri Jun 27, 2008 11:41 am Post subject:
Multiple Clocks ? Subject description: Beginners Question ! |
 |
|
Hi,
i just started programming my first supercollider-composition and would like to know if and how it's possible to have different clocks for different Patterns ?
so let's say i have defined two clocks like this (using the crucial lib):
t = Tempo.new;
t.bpm = 27;
u = Tempo.new;
u.bpm = 300;
and for example two patterns like:
p = Pbind(\instrument, \plong,
\midinote, Pseq([36, 38, 27, 42, 67, 38, 22, 45, 39], inf)).play;
q = Pbind(bla bla bla ....).play;
Now, how can i assign clock "t" to pattern "p" and clock "u" to pattern "q" ? And after that change the tempo of one clock during playback dynamically (i.e. u.bpm = u.bpm +1 sort of thing) ?
Is this possible or am i totally on the wrong track here ?
Thanks alot
SP
p.s. sorry if this is a totally stupid question, but i am a total newbie to sc  |
|
|
Back to top
|
|
 |
dewdrop_world

Joined: Aug 28, 2006 Posts: 858 Location: Guangzhou, China
Audio files: 4
|
Posted: Sat Jun 28, 2008 7:41 pm Post subject:
|
 |
|
First thing is, a Tempo object is not a clock by itself, so you can't run patterns on a Tempo.
I would suggest using TempoClock directly. TempoClock doesn't have a bpm method but it's very easy to do
t = TempoClock(myBpm / 60);
Then, "play" is implemented for patterns with the following arguments:
aPattern.play(clock, protoEvent, quant)
So you need only to use the appropriate clock as the first argument to play, e.g.,
myPattern.play(t);
myOtherPattern.play(u);
hjh _________________ ddw online: http://www.dewdrop-world.net
sc3 online: http://supercollider.sourceforge.net |
|
|
Back to top
|
|
 |
dewdrop_world

Joined: Aug 28, 2006 Posts: 858 Location: Guangzhou, China
Audio files: 4
|
Posted: Sun Jun 29, 2008 7:43 am Post subject:
|
 |
|
Forgot the bit about tempo changing - you can change a TempoClock's tempo at any time like this:
t.tempo = myNewBpm / 60;
or
// the bpm+1 example you gave
t.tempo = t.tempo + (1 / 60);
James _________________ ddw online: http://www.dewdrop-world.net
sc3 online: http://supercollider.sourceforge.net |
|
|
Back to top
|
|
 |
|