Music and Musical Know-how For You

Join Now

Home | How-Tos | Directory | Our Composers | The Rhythms | Play Rhythm | Rhythm Web | Tonematrix | Chord Grid | The Changes | Song Discussions | Public Ideas | SongTrellis Recommends... | Video Links | Great Performances | SongTrellis Music Editor | The Lessons | Jukebox | The Animations | Our Contributors | Latest Topics | Tunetext | Workscore Chord Entry | Chord Entry By Grid | Workscore Composer | Music Tool Lore | Harmonic Interval Palette | Harmony Projects | Search | Video Demonstrations | Playlists | What's a Songtrellis? | FAQ | Feedback

Author David Luebbert
Posted 1/6/11; 11:21:17 PM
Msg# 5789 (top msg in thread)
Prev/Next 5788/5790
Reads 291407

SongTrellis Rhythm Notation and the playRhythm service on SongTrellis

The SongTrellis Rhythm Player, a service available on the SongTrellis website, responds to a basic URL of this form:

Following the rhythm= in the URL, the Rhythm Player service expects to find a rhythm pattern specification. The playRhythm service expects that rhythms will be described using a small, newly coined language which we'll call SongTrellis Rhythm Notation

The simplest rhythm specification

The simplest rhythm pattern specification is a string of an arbitrary number of 1 and 0 characters like this




or this


Such symbol strings are interpreted a symbol at a time from left to right.

Characters of a specification are mapped in one to one correspondence to a series of evenly measured ticks of a clock, of a metronomic click track, or a mentally imagined series of ticks. A 1 is an instruction to the reader to make a sound in synchrony with the next tick of the tick stream. A 0 is an instruction to be silent for the following tick. Musically, a 0 is a specification of a rest.

Any number of 1 and 0 characters can be included in a simple pattern. The pattern is by default considered to be the specification of a loop, a pattern of hits and rests that repeats indefinitely. By default, the SongTrellis website's rhythm player service, which responds to playRhythm URLs, will repeat a pattern 4 times when it is performed.

Adding a reps= parameter to a playRhythm URL controls the number of repetitions that will be performed of a pattern. The parameter value that is placed following the equal sign is always an integer number which specifies the number of times the pattern should be repeated.

For example, the URL

will repeat the four tick pattern 1001 eight times. By default a rhythm is accompanied by a click track when it plays.

Setting fClickTrack=0 in the URL will turn off the click track accompaniment


performs pattern 1001 6 times without a click track

Punctuated rhythm specifications

By punctuating the simplest rhythm specification in a small number of ways, more complex rhythms can be notated.

In all but the simplest rhythmic situations in music, the hits in a rhythm (the instants that a sound is made) do not coincide with the ticks of a metronomic clock. Instead the stream of measured background ticks that provides the rhythmic framework of a piece of music are used to mark the beat within a piece of music. The time within a beat is subdivided by varying counts, and musical events within a piece all begin to sound at an instant marked by a particular subdivision of one of the beats of a piece.

Dash characters (the '-' character) can be inserted between any 1 and 0 character within a simple specification to mark the boundaries of beats within a rhythm cycle. Adding three dashes in the middle of a simple spec, for example, breaks the 1 and 0 sequences of the simple spec into four groups. Those groups specify a sequence of 4 sub-patterns that will sound within the duration of a 4 beat cycle.

Consider the rhythm


a sixteen beat cycle.

If we punctuate that spec with a dash character every four ticks, we will have the four beat pattern


which plays the idea four times faster, with the beat sounding at the beginning of the pattern and every four subticks after that, on the first tick of each subgroup.

If the count of 1 and 0s in the simple pattern up to the next dash character or the end of the entire pattern is n, that beat wii be subdivided into n equal parts, and sounds will be performed at the beginning instant of those subdivisions within the beat.

An example of a beat delimited pattern:


were the original pattern which subdivides the second beat 4 times

the pattern


would play the subpattern 0101 within the duration of the third subdivision of the second beat, effectively playing that pattern using a clock speed of 1/16 of a beat duration (a duration of a quarter beat divided again by 4).

Bracketed sub-patterns of a beat

When a simplest specification, a string of 1 and 0 characters, specifies a beat ( is delimited by dash characters), that simple specification can be bracketed without changing the specifications meaning. For example

01-[0101]-001" specifies the same pattern as 01-0101-001

More interestingly, an integer number can be written immediately after a dash character and before the left square brace, like this:


This stretches the subpattern 0101 to play over the three beat duration of beats 2, 3 and 4 of the total five beat duration specified, with 01 played during beat 1 and 001 played during beat 5.

An integer prefix written in front of a bracketed beat spec instructs the Play Rhythm interpreter to stretch the bracketed pattern over a duration of that count of beats. This has the effect of slowing the clock down by that integer factor until the bracketed pattern is completely performed, at which the original clock setting is reestablished.

The characters 1 and 0 are reserved in rhythm specifications to denote subticks of rhythm pattern. If you need to use an integer scaling factor that begins with the digit 1, place a hat character, '^', in front of the integer count


specifies a 12 beat pattern that stretches the subpattern 0101 over the ten beat duration of beats two through eleven of the pattern.

If the integer used begins with an integer between 2 and 9 inclusive, the hat character may be used as a prefix but is not required syntactically.

Scaled bracketed patterns inside of a beat specification If a bracketed sub-pattern is written within the interior of a beat (ie. the brackets have 1 or 0 characters listed before or after), that sub-pattern will be time scaled so that it is performed over the duration of more that a single beat, by placing an integer number preceded by an underscore character in front of the left bracket.

Example: _3[11011]1-_2[1]_3[1]

Here the first beat of a two beat pattern is subdivided four times, with the 5 subtick pattern 11011 played over the first three quarter of the beat, and a subtick marking the beginning of the last quarter of the beat.

The second beat is subdivided 5 times, with hits occurring at the beginning of the beat and when two-fifths of the beat have elapsed.

Any valid rhythm pattern can be bracketed and time scaled so that it can be performed with the duration of any number of beats or any number of subticks.

Bracketed patterns can be nested to arbitrary depth.

Multi-voice rhythm ensembles are easy to notate so that playRhythm can perform them. Each voice specification is listed in sequence, delimited with a comma.

When a comma is recognized within a rhythm pattern specification, the playRhythm interpreter adds a new voice to the rhythm score, and considers the specification following up to next comma, if any, or to the end of the entire rhythm specification to be the notation of a new rhythm pattern that will be played in synchrony with any previous voices that have been added to the rhythm score that is being built.

If the number of beats and subdivisions of each beat described for each voice of the ensemble is the same, the box notation produced by the playRhythm for each voice will be highly regular, making it much easier to correlate the patterns played in one voice with those in other voices.

If there is a mismatch between the count of beats used in different voices, when the ensemble pattern is repeated, the mismatching patterns will float with respect to one another, so that different parts of the rhythms will be performed against each other on each repetition until the ensemble has been repeated enough times to finally establish a larger repeated rhythmic cycle.

Once a rhythm is found that sounds good, it's easy to substitute the box notation symbol for a particular percussion sound for 1 symbols in the rhythm. The star symbol '*' is a synonym that can replace 0 symbols in the rhythm specification.

The symbols 'B', 'O', 'S', 'H', 'T', 'Ss', 'So' and 'r' which encode types of percussion sounds in Box Notation can substitute for 1 symbols in a specification. If they appear in the rhythm description, they are displayed in the corresponding box of the box notation that is produced.

Default instruments, pitches, and volumes volumes are assigned to these symbols and determine how the rhythm is orchestrated for performance.

For each voice specified in the rhythm notation, a corresponding inst1=, inst2=, inst3= etc name/value parameter can be added to the URL to override the default bindings for the different percussion instrument sounds.

If the symbols 'B', O' and 'S' are used as substitutes for a 1 symbol in the first specified voice of the rhythm,


would cause the B symbol to be performed using instrument 16385 (the standard MIDI default drum kit), volume setting of 80 (can vary from 0 to 127), playing a D pitch from the drum kit in the 4th octave range, 'O' using an E pitch from the fourth octave range at volume 90 using the default drum kit, 'S' using a D pitch from octave range 4, at volume 80 on the default drum kit.

The name/value parameters that can modify a playRhythm URL:

The only required parameter of a playRhythm URL is

rhythm= whose parameter value follows the syntax of SongTrellis Rhythm Notation

bpm= takes an integer value that may vary from 1 to 999 and sets the tempo of the rhythm performance measured in beats-per-minute units. The interpreter's default tempo is 120 bpm.

fClickTrack= takes 0 or 1 as parameter values. A 1 setting, the default, means the beat will be marked using a click track. A 0 setting means that the click track will be suppressed during performance.

reps= takes an integer value, 1 or greater, which determines the number of times the specified rhythm will be performed. The default reps value is 4.

pulse= takes a fractional parameter with integer numerator and denominator as a specification of the beat pulse value (eg. 1/2, 1/4, 1/8, 1/2 would be valid and typical pulse settings) that will be used when a music notation score translation is produced. The default pulse setting value is 1/4.

Inst1= inst2= . . . instN= where N is equal to the count of the number of rhythm voices specified by the rhythm parameter notation.

The values expected are documented in the previous section of this document and define the instrumental orchestration that will be used to interpret specific percussion sound symbols that may substitute for 1 and 0 symbols within a rhythm specification.

blog comments powered by Disqus

Please join our community at SongTrellis. Our contributors welcome your comments, suggestions and requests. As soon as you join the site (or login if you are a member) a response form will appear here.

Last update: Thursday, January 6, 2011 at 11:51 PM.