Tempo-Based Timing


Clock Time and Musical Time

The most objective type of time measurement, the one most frequent in everyday discourse and in scientific measurement, is the use of a regular, reliable, and agreed-upon clock; we can call this absolute time or clock time. In Max, time is most commonly referred to in terms of milliseconds (ms), which is a fine enough resolution for most purposes, and we can pretty easily translate arithmetically from ms to seconds, minutes, etc. The Max scheduler allows us to post events (messages) we want to send in the future, using objects such as delay, metro, pipe, etc. If you're not already very familiar with the use of those objects, you might want to read the blog posts "Repetition at a steady rate", "Timed counting", and "Counting through a list".

Music is not commonly organized by direct reference to clock time, though; instead, it uses a different type of time measurement known as musical time, which relies on some agreed-upon more-or-less constant unit of time known as a beat. In the majority of music, and certainly in almost all popular music, there's a sense of regularity, called the beat, that underlies the musical structure at a fairly steady rate. The beat rate is called the tempo, and is measured in beats per minute (BPM). The relationship of musical time to clock time is determined by that tempo. The onset time of each sonic event is the moment when it is perceived to begin, and its duration is how long it lasts, from its onset to its ending; either may be measured in clock time and/or musical time. (This might be a good time to distinguish between duration—how long something lasts—and inter-onset interval, a.k.a. IOI, which is a cognitive science term for the time interval between beginnings of events. Our sense of rhythm is more strongly affected by IOIs than by the actual duration of any one event.) Any instant in time can be ascribed a unique numerical value in either clock time or musical time relative to an established 0 point; such a representation of a single moment is called a timepoint.


Beat and Rhythm

Musicians often discuss tempo in terms of beats per minute (BPM), and they have a pretty good intuitive sense of beat rate when they hear that number. They don't give much conscious thought specifically to what interval of time passes between beats, the IOI in clock time. In a computer program, though, it's often necessary to know the amount of time per beat. You could calculate that easily by taking the number of milliseconds per minute and dividing that by the BPM number. The result would give you milliseconds per beat. For example 60,000 milliseconds per 1 minute, divided by 120 beats per 1 minute, yields 500 milliseconds per 1 beat.

ms/min ÷ beats/min = ms/min · min/beat = ms/beat

You can read more about these time relationships in the blog post "Tempo-relative timing".

Here's a simple demonstration of the beat, marked by repeated thumps of a kick drum. In this example,and in a lot of popular music, beats are grouped in fours. Something happens in the music to cause the listener to group the beats mentally. In this example the first beat in each group of four is played a bit louder than the others, and that's all it takes to lead us to group the beats in fours. Most commony, the beat is notated as a quarter note, and since there are four quarter notes in a group, together they take the time of one whole note. This sort of small grouping of beats is called a measure or a bar, and because there are four beats (four quarters) in a bar, we say the music is in "four-four" time (written 4/4), which is known as the meter of the music. At the beginning of this example, the meter is shown in the meter signature (a.k.a. the time signature), and the tempo is shown above that.


4/4 meter, with an accent on the first beat of each bar

That kind of drum beat is known as "four on the floor", meaning a kick drum note on every beat in 4/4 meter. More commonly, though, a drummer might play the kick drum less frequently, say, every other beat, and play the snare drum on beats 2 and 4 of the measure, as shown below. (This additional accenting of beats 2 and 4 is sometimes referred to as the "backbeat", giving the music a feel that's common in rock, jazz, and hip-hop.) There's also a crash cymbal on the first beat of bars 1 and 3, which leads the listener to group the music mentally in three ways simultaneously: into groups of two beats (kick-snare), four beats (the accented kick drum notes), and eight beats (the crash cymbal).


Backbeat, with snare drum on beats 2 and 4

In addition to these sorts of beat groupings, rhythmic interest is added by division of the beat, into halves (eighth notes), fourths (sixteenth notes), and so on. In the example below, the drummer adds constant eighth notes on the closed hi-hat cymbal, and sometimes divides the kick drum into two eighth notes instead of a single quarter note. The use of eighth notes establishes an underlying pulse that's twice as fast as the beat, giving added energy to the music.


Eighth-note divisions

Even more musical interest is achieved by syncopation, which means displacement of a note from its normally expected rhythmic location. The example below is exactly the same as the one above, except for one thing. In the second and fourth measures, the drummer plays the kick drum note that would be expected to occur on beat 3 a half-beat early, so that it occurs on the second half of beat 2 instead (and also gives it a little added loudness to emphasize its occurrence). That syncopation is unexpected the first time we hear it, but once it's repeated we start to expect it. That one syncopation changes the feel of the music, and makes a distinctive, memorable rhythmic motif.


Syncopations in the kick drum

So far we have seen three ways of making the rhythm interesting: accent on certain events (a change in loudness or timbre), division of the beat (eighth notes, sixteenth notes, etc.), and syncopation (moving a note slightly off the beat, displacing it from where it would normally be expected). A couple of other techniques are ornamentation (added quick notes around a main note) and rests (omitting notes selectively to defy normal expectations). The example below shows the inclusion of those techniques. The first half of the example is the same as the previous example. The use of sixteenth notes on the last beat of the third measure introduces to the listener the notion of there being a faster underlying pulse at the sixteenth-note rate, that appears only occasionally to interject moments of added speed. In the third measure there's an ornamental sixteenth note in the kick drum just before beat 3, and a syncopation—an offset by a sixteenth note—in the snare drum just before beat 4. In the fourth measure, all the instruments stop (rest) momentarily in beat 3, creating a sudden hole in the texture that adds an element of surprise for the listener, and then the snare drum plays sixteenth-note divisions, creating renewed energy (a sort of psychological acceleration) leading into the next measure.


Sixteenth-note pulse, ornaments, syncopations, and rests


The Temporal Grid

The preceding discussion points to a way of thinking about musical timing—and rhythm, which we can define as the articulation of timepoints with sound—in a way that's particularly appropriate for computer music. In this model, music exists on a temporal grid, one in which sonic events reside upon, and are quantized to, conceptual time divisions that correspond to the pulse (the quickest division)—which is the sixteenth-note rate in the above example. According to this model, the grid represents musical time, and the rhythm is articulated by sounds placed on that grid. The grid, and the events on it, exist independent of clock time, but if we know the BPM tempo, we can easily translate the grid into clock time. One advantage of thinking of musical time as a temporal grid is that it's analogous to the way musicians think about notation of rhythms, as shown above. Another powerful advantage of using a musical time grid that's independent of clock time is that we can leave the musical structure intact, changing only the BPM tempo, and all of the clock times can then be adjusted accordingly with straightforward arithmetic.

The music in the previous example could be shown graphically on a grid like this.


Drum set rhythm, displayed graphically on a temporal grid

Many digital audio workstation (DAW) applications use some version of this temporal grid model to show a timeline of musical events, such as MIDI notes, allowing notes to be placed precisely in the desired rhythm by the user, and doing all the necessary calculations of clock time behind the scenes without troubling the user with having to think about them. In the Reason application, for example, the grid idea is used explicity in the ReDrum drum machine and the Matrix pattern sequencer. The user places events on the grid, and those events are translated as MIDI notes (or control values) for playing sounds at the right time. The patterns placed on the grid can then be stored as self-contained rhythmic patterns, which themselves can be arranged on the timeline for the whole musical composition.


Kick drum rhythm, displayed on 16 locations in a stored pattern


Note pattern, displayed on 16 locations in a stored pitch/rhythm matrix


This page was last modified May 27, 2019 by Christopher Dobrian, dobrian@uci.edu.