Specifications

7.3 Events and sequencing 79
metronome and co unter. A more useful timebase is given in Fig. 7.19 that allows
you to specify the tempo as beats per minute (BPM) and to add a “swing”
1
to
the beat. Notice first that start and stop control via the first inlet also resets
f 0 + 1
t b b
metro 125
outlet bangs outlet time
inlet bpm
swap 60000
/
inlet beats
/ 4
t b f
del
t b b
inlet swing percent
/ 100
+ 1
t f f
*
t b f
f $3
loadbang
f $2
f $1
t b b b
0
inlet control
sel 0
fig 7.19: A more useful musical timebase abstraction with BPM and swing
the counte r when the timebase is stopped. Bangs from
metro
are duplicated with
a
delay
object so we can position every other beat relative to the main rhythm.
To convert beats per minute to a period in milliseconds it is divided by 60000
and multiplied by the number of beats per bar. The last para meter provides
swing a s a percentage which is added to the delay prior to incrementing the
counter.
Select sequencer
s time
r time
select 0 1 2 3 4 5 6 7 8
mod 8
4
timebase 60 4 0
sel 1024
938
r time
fig 7.20: Select based triggering
The simplest way to obtain regular patterns
for repetitive sounds is by using
mod
to wrap
the incoming time to a small range, say 8
beats, and then use
select
to trigger events
within this range. You do not have to fill out
all the select values, so for example, to pro -
duce a single trigger at time = 1024 you can
connect one
select
matching this number . A
good practice is to broadcast a global time
message so that other patches can pick up a common refere nce . In Fig. 7.20
the output from the timebase abstraction goes to a
send
. To create a sequencer
where you can manually set the time at which an event is triggered, use a com-
1
Swing is where every other beat is moved slightly in time giving a different feel to the
rhythm.