dewdrop_world

Joined: Aug 28, 2006 Posts: 858 Location: Guangzhou, China
Audio files: 4
|
Posted: Sun Apr 27, 2008 8:26 pm Post subject:
TempoClock and changing meters |
 |
|
Sometimes it depresses me that there's so little activity on the supercollider board here... but no sense in complaining, the only way to deal with it is to start something! I don't have much free time, but I'm sure I can think of some topics here and there, things that I've been working on, that might be useful. Actually there is quite a lot lately that is generally useful -- right now I'm working on a piece for violin and computer that is mostly through-composed, though it will have some aleatoric sections. That means devising structures to represent the form and keep the computer in sync with the score.
Lately I've been working on TempoClock and meter changes. Believe it or not, in five years of working with supercollider I haven't done anything that requires a single meter change! Either it's been closely related enough to dance music to stay in 4/4 the whole time, or it's unmetered (that is, beats are simply a time reference with no larger organization).
TempoClock uses a couple of numbers to represent the meter:
- beatsPerBar, assuming 1 is one beat
- baseBarBeat = the beat number from which bar lines will be measured
- baseBar = the bar number when the meter was last changed
For instance, starting from beat 0, if you have 4 bars of 4/4 and 4 bars of 3/4, it would break down like this:
beatsPerBar = 4, baseBarBeat = 0, baseBar = 0
^^ representing bars 0-3 with barlines at 0, 4, 8, 12
beatsPerBar = 3, baseBarBeat = 16, baseBar = 4
^^ representing bars 4-7 with barlines at 16, 19, 22, 25 etc.
You're not limited to integers for beatsPerBar -- 5/8 would be represented by 2.5, with some bar lines occurring at *.5 -- but the bar line is really arbitrary, just a calculation, doesn't need to be tied to integers.
You can identify any point in time relative to the meter using several methods:
Code: | clock.nextTimeOnGrid(-1, 0) -- next barline
clock.nextTimeOnGrid(-2, 0) -- 2 barlines from now -- -3 = 3 barlines etc.
clock.nextTimeOnGrid(-1, 1) -- next barline + 1 beat, etc.
clock.nextTimeOnGrid(4, 0) -- next multiple of 4 beats above baseBarBeat
clock.bars2beats(barNumber) + beatWithinBar |
nextTimeOnGrid is called automatically by myClock.play(thing, quant), where the quant parameters are passed into nextTimeOnGrid. So all this is transparent.
This all depends on supplying the right time for the meter change. You could set beatsPerBar using regular setter syntax -- myClock.beatsPerBar = 3.5 -- but weird things happen if that action is scheduled for any time other than the exact bar line when the meter should change. So I prefer this addition, which is custom for now but I hope to be able to check it into svn soon.
Code: | + TempoClock {
setMeterNextBar { arg beatsPerBar;
if(this.beats <= (this.nextBar - beatsPerBar)) {
this.schedAbs(this.nextBar, { this.setMeterAtBeat(beatsPerBar, this.nextBar) });
} {
this.setMeterAtBeat(beatsPerBar, this.nextBar);
}
}
} |
Using that method, you can be sure that the 3 meter parameters are always valid.
For the piece, I have in mind a conductor process that will do the meter changes automatically. For some rhythm-generator processes, I will also need a representation of the accent structure within the bar, but I haven't decided yet what that should look like. I'm writing these processes using my chucklib extensions.
Hope this piques some interest --
James _________________ ddw online: http://www.dewdrop-world.net
sc3 online: http://supercollider.sourceforge.net |
|
v-un-v
Janitor


Joined: May 16, 2005 Posts: 8932 Location: Birmingham, England, UK
Audio files: 11
G2 patch files: 1
|
Posted: Mon Apr 28, 2008 1:22 am Post subject:
Re: TempoClock and changing meters |
 |
|
dewdrop_world wrote: | Sometimes it depresses me that there's so little activity on the supercollider board here... |
It's finding the time to apply oneself, however it is great that you are still posting
Keep up the good work! _________________ ACHTUNG!
ALLES TURISTEN UND NONTEKNISCHEN LOOKENPEEPERS!
DAS KOMPUTERMASCHINE IST NICHT FÜR DER GEFINGERPOKEN UND MITTENGRABEN! ODERWISE IST EASY TO SCHNAPPEN DER SPRINGENWERK, BLOWENFUSEN UND POPPENCORKEN MIT SPITZENSPARKSEN.
IST NICHT FÜR GEWERKEN BEI DUMMKOPFEN. DER RUBBERNECKEN SIGHTSEEREN KEEPEN DAS COTTONPICKEN HÄNDER IN DAS POCKETS MUSS.
ZO RELAXEN UND WATSCHEN DER BLINKENLICHTEN. |
|
dewdrop_world

Joined: Aug 28, 2006 Posts: 858 Location: Guangzhou, China
Audio files: 4
|
Posted: Tue Apr 29, 2008 8:35 pm Post subject:
|
 |
|
I realize I'll probably be talking mostly to myself for awhile at least... I think the concern remains that somebody comes here, looks at the SC board and the ChucK board and reaches the erroneous conclusion that SC is dead. A quick glance over the mailing list mirror at nabble.com should dispel that notion... but how would someone know that just by looking here?
The only way to deal with it is to start something...
James _________________ ddw online: http://www.dewdrop-world.net
sc3 online: http://supercollider.sourceforge.net |
|