Tempo Tracker

The operation of |harmgen| and |melplayer| is synchronized with the human input through the use of a subsymbolic tempo tracker. This tempo tracker operates by measuring inter-onset intervals (IOI), which is the time elapsed between the onset of successive notes. The acutal duration of notes is not considered, although doing so would certainly improve the tracker's accuracy.

Tempo_duple
tempo_duple

The tracker is built around a 10x9 matrix that is maintained inside the |mtx| object. Each column of the matix holds the beat period for a different metric subdivision: from left to right, these are .25 (sixteenth), 1/3 (triplet eighth), .5 (eighth), .75 (dotted eighth), 1 (quarter), 1.5 (dotted quarter), 2 (half), 3 (dotted half), and 4 (whole). Notice that the sibdivisions are mostly duple; tuplet subdivisions and multiples could easily be added, but are left out of this model for clarity's sake.

The rows represent a history of the last ten IOI's. The |pd row| subpatch directs each new IOI to a row in the matrix; it starts with row 1 and, with each new IOI, moves toward row 10. When row 10 is reached, it jumps back to row 1 and start again. In this way, each of the last ten IOI's, with all of it's subdivisions and multiples, is stored inside the matrix.

When the |mtx| receives a BANG (when a new IOI is generated), it outputs its contents into |mtx_mean|, which returns the mean of each column. This mean is the average length of each subdivision over the last ten IOI's. The x1 (quarter) subdivision is taken as the basic pulse; it is used to generate the output pulse, as well as to handle future inputs.  Ten input events seems like a good window to draw average IOI values from; if more events are used, the tracker has trouble following intential accelerandi and other expressive effects; if fewer events are used, the tracker behaves erratically, as it attempts to follow the unintential deviations from tempo that are present in all human musical performance.

Gravity
tempo_duple

The |gravity| subpatch is responsible for handling new input IOI's. The current beat period (calculated as described above) is received in the right inlet. |gravity| uses this value to define a "bin" for each metric subdivision. Values that separates each bin from it's neighboring bins (halfway between the value for each subdivision of the established beat period) are sent to a network of |moses| objects (which "part a numerical stream"). The IOI falls down the cascade of |moses| objects and is routed toward the subdivision bin that it is closest to. For example, if the current beat period is 1 second, and the input IOI is 300, it is routed to the 1/3 (eighth triplet) subdivision bin.  The IOI is then scaled to form a "base" x1 (quarter note) value. An IOI routed to the "triplet" bin is multiplied by three; an IOI routed to the "half note" bin is multiplied by .5. This "base" value is then output from |gravity|. It is used to calculate the other eight subdivisions, which are all sent to the |mtx|.

Very long and very short IOI's are treated specially. Very short IOI's (shorter than a 32nd note) are assumed to come from trills, ornamentation, or "slipped" notes; when one is detected, a "trill" message is sent, and the IOI is ignored. Very long IOI's (longer than a dotted whole note) are assumed to come from a lack of input from the user; a "break" message is sent (which currently reinitializes the tracker) and the IOI is ignored.

Another special case involves initialization of the tracker. The first IOI that is received after the tracker is reset is ignored. The second IOI is treated more nomally: it is assumed to be the base (quarter note) value, and all of the possible subdivisions of this base are calculated. This base and it's subdivisions are then input to all ten rows of the tempo matrix, so that the mean value of the base column (used to generate the output beat period and to handle new input) is actually the value of the this second IOI. The tracker can then proceed as described above.

This initizialization scheme does somewhat limit it's flexibility: it assumes that the second IOI will be a quarter note. Furthermore, the tracker has no way to change from the using the quarter note as it's basic pulse; if the user starts to play in cut time, or in a triple meter, the tracker will proceed as if nothing had happened. Adding the capability to change the metric subdivision that constitutes the trcker's "basic pulse" would greatly improve the tracker's accuracy.

This tempo tracker is largely based on work by Dr. Robert Rowe, and on the extensive work of Drs. Desain and Honing. Please see the Animating Oscar bibliography for details. A discussion of tempo tracking and quantization systmes can be found in my paper, Theories and Models of Human Rhythmic Perception.


Email Greg OSCAR Main PageConnecting the Dots