Re: Question on Oparray's

From: John Lazzaro (lazzaro@CS.Berkeley.EDU)
Date: Mon Mar 19 2001 - 19:45:04 EST


> What sorts of issues should I deal with to be able to use my non-kline
> envelopes while adjusting tempos?

If you want to specify your envelope segments in terms of absolute
time, then you won't have to keep track of tempo: each time your
k-rate code is called, time has passed by an increment of 1/k_rate
from the last time it ran, and each time your a-rate code is called,
time has passed by an increment of 1/s_rate. You can get the absolute
time elapsed since the start of the instrument's lifetime using
the ksig standard name itime (has value 0 at first kcycle).

Links for details about these standard names can be found:

http://www.cs.berkeley.edu/~lazzaro/sa/book/append/stnames/index.html

Since the kline() and other envelope core opcodes specify their
times in seconds, taking an absolute time approach in your own
envelopes would result in the same sort of behaviors. If instead,
you want specify your envelopes in scorebeats, which would be
modifiable by tempo changes, you would want to use the core
opcodes devoted to sensing (and perhaps changing) the current
tempo:

http://www.cs.berkeley.edu/~lazzaro/sa/book/saol/simple/index.html#tempo

Once you have the current tempo (units: beats per minute), you can
multiply/divide to convert between seconds and scorebeats. Note
that since the default tempo is 60 beats/minute, if you never change
the tempo scorebeats has effective units of seconds too.

                                                                --jl

P.S. Things have been pretty busy here, so I haven't actually been
able to carefully read through the language-specification emails
to the lists lately -- it takes about a day of immersion into SAOL
rate semantics issues before I can express a reasoned opinion on
possible language changes, and that day is hard to find at the moment.



This archive was generated by hypermail 2b29 : Mon Jan 28 2002 - 12:11:07 EST