electro-music.com   Dedicated to experimental electro-acoustic
and electronic music
 
    Front Page  |  Radio
 |  Media  |  Forum  |  Wiki  |  Links
Forum with support of Syndicator RSS
 FAQFAQ   CalendarCalendar   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   LinksLinks
 RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in  Chat RoomChat Room 
 Forum index » DIY Hardware and Software » Supercollider
Multiple Clocks ?
Post new topic   Reply to topic Moderators: v-un-v
Page 1 of 1 [3 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Author Message
SplinterPsyche



Joined: Jun 27, 2008
Posts: 1
Location: Berlin

PostPosted: Fri Jun 27, 2008 11:41 am    Post subject: Multiple Clocks ?
Subject description: Beginners Question !
Reply with quote  Mark this post and the followings unread

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 Confused
Back to top
View user's profile Send private message
dewdrop_world



Joined: Aug 28, 2006
Posts: 858
Location: Guangzhou, China
Audio files: 4

PostPosted: Sat Jun 28, 2008 7:41 pm    Post subject: Reply with quote  Mark this post and the followings unread

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
View user's profile Send private message Visit poster's website AIM Address
dewdrop_world



Joined: Aug 28, 2006
Posts: 858
Location: Guangzhou, China
Audio files: 4

PostPosted: Sun Jun 29, 2008 7:43 am    Post subject: Reply with quote  Mark this post and the followings unread

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
View user's profile Send private message Visit poster's website AIM Address
Display posts from previous:   
Post new topic   Reply to topic Moderators: v-un-v
Page 1 of 1 [3 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
 Forum index » DIY Hardware and Software » Supercollider
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Forum with support of Syndicator RSS
Powered by phpBB © 2001, 2005 phpBB Group
Copyright © 2003 through 2009 by electro-music.com - Conditions Of Use