This chapter discusses various concepts and Humdrum Extras tools related to rhythm.
Humdrum Extras programs recognize an extension to **recip and **kern rhythm representations which allows any rational rhythm to be encoded. A majority of rhythms found in printed music can be represented in standard **recip data. For example a dotted quarter-note is encoded as 4. and a quintuplet sixteenth note is 20. Such rhythms are based upon integral divisions of the whole note. The value 4 means 1/4th of a whole note; 4. means 1/4 of a whole note plus half of that (1/8 of a whole note). Rhythms which are composed of equal divisions of whole notes plus augmentation dots can be represented in this system. But a problem occurs when trying to represent other rhythms as illustrated in Example 2.1, like triplet whole-notes or non-power-of-two tuplet bases.
Example 2.1: Difficult rhythms to represent in **recip data.
In other words when **recip encodes reciprocal durations of notes, the durations must always have a 1 in the numerator (excluding duration additions from augmentation dots). For example an eighth note is represented in **recip or **kern data as 8. This means that the duration of an eighth note is 1/8th that of a whole note. Likewise, 12 means 1/12 of a whole note which translates musically into “triplet eighth-notes”. Here is a demonstration of the calculations that relate 12 to a “triplet eighth-note”:
“1/8” is an eighth-note duration, and “2/3” is the tuplet relation of “three notes in the time of two”, or a “3:2” tuplet. By analogy, 5:3-tuplet eighth notes have the reciprocal duration of 40/3:
This means that a 5:3-tuplet eighth note is equal to 3/40ths of a whole note. Notice that this duration is not a integral division of the whole note since the numerator of the duration (or the denominator in the reciprocal duration) is not 1. The difficulty in the standard **recip representation is that it includes a default value of 1 for the denominator of the reciprocal duration since only integers are allowed for rhythms in **recip data. The quarter note value 4 is more generally the ratio 4/1 with the “/1” implied in **recip data. The Humdrum Extras programs allow for the denominator to be any other positive integer. In order to represent the duration 3/40 in **recip data, the symbol 40%3 can be used, where the % sign indicates a reciprocal duration ratio with a denominator other than one is being represented.
|Encoding||Reciprocal dur.||Dur. (whole-note units)||Musical name|
|4.||4/1 + dot⇒8/3||1/4 + dot⇒3/8||Dotted quarter-note|
|1%2||1/2||2/1||Breve (double whole-note)|
|1%4||1/4||4/1||Longa (quadruple whole-note)|
|1%8||1/8||8/1||Maxima (octuple whole-note)|
|3%2.||3/2+dot⇒1/1||2/3+dot⇒1/1||Dotted triplet whole-note|
Notice that the duration 3/16 at the bottom of the table can represent both 4:3-tuplet quarter notes and dotted eighth-notes (both have a duration of 0.75 quarter notes). The augmentation dot count is necessary in order to determine the musical name of the duration.
The rational-duration extension to the **recip representation is mostly backwards-compatible with **kern. The % sign is a user signifier in **kern, meaning it does not have a fixed meaning, and can be given a temporary meaning. For the rational rhythm extension this character is reserved to separate the two integers in a reciprocal duration value. Example 2.2 shows the method for generating compatible rhythms for standard Humdrum Tools that don’t recognize the extension use the rscale program to scale the rhythm to a timebase which does not require the extension. For example if the duration of triplet whole-notes are decreased by half, they become triplet half-notes which are representable in the standard **recip system.
Example 2.2: Halving note duration in a **kern score to remove rational rhythms. The -o option will read the !!rscale: 1/2 structured global command to return the the original rhythmic scale after processing with Humdrum Toolkit programs.
**kern *M3/1 3%2c 3%2d 3%2e *-
|⇒ rscale -f 1/2 ⇒|
**kern *M3/2 3c 3d 3e *- !!!rscale: 1/2
**kern *M3/2 3c 3d 3e *- !!!rscale: 1/2
|⇒ rscale -o ⇒|
**kern *M3/1 3%2c 3%2d 3%2e *-
A different extension to the **recip rhythm representation uses the symbol 0 (zero) for breves (double whole notes). Note that q is used to represent grace notes with a zero notated duration. Most rhythm-parsing Humdrum Toolkit programs (such as census) recognize this zero convention. By extension, the symbol 00 represents a longa (quadruple whole note), and 000 represents a maxima (octuple whole note); however, most Humdrum Toolkit rhythm-parsing programs do not understand these longer durations as well as exotic rhythm values such as 0000 for a double maxima, or 00000 for a quadruple maxima. Example 2.3 shows how the beat command converts zero rhythms into durations in quarter-note units.
Example 2.3: Duration of various large rhythms in quarter-note units using the “zero” representation.
**kern 4c 2d 1e 0f 00g 000a 0000b 00000c *-
|⇒ beat -d ⇒|
**dur 1 2 4 8 16 32 64 128 *-
Compare this to durational equivalents from rational representations of the same rhythms in Example 2.4, where the analyzed durations of the **recip rhythms in the right column match to those in Example 2.3.
Example 2.4: Duration of various large rhythms in quarter-note units using the rational representation.
**kern 4c 2d 1e 1%2f 1%4g 1%8a 1%16b 1%32c *-
|⇒ beat -d ⇒|
**dur 1 2 4 8 16 32 64 128 *-
Nested tuplets are a recursive representation of rhythm which allows for iterative non-binary subdivisions. It is a further generalization of rhythm that is not accounted for in the **recip representation. Consider the music in Example 2.5 where quintuplets and septuplets are further subdivided into other tuplets. In the top part of the example, the third quintuplet quarter-note is further divided into triplets, with two of those triplet notes even further subdivided into a quintuplet.
Example 2.5: Nested tuplets, with notes equal to 1/50 of a whole note marked in red (see Example 2.7 for the **recip representation of this music).
The reciprocal durations of the shortest notes on the top line of Example 2.5 (highlighted in red) are 50 in the **recip representation. The following equation demonstrates the process of dividing the quarter note three successive times to arrive at this rhythm value: the quarter note is first subdivided by 3/5 then by 1/2 and finally by 2/5:
Going from **recip data to graphical music notation poses a problem in the general case, since the ordering of the subdividing factors are not specified in the data token 50. In other words, this rhythm can be approached from any number of tuplet subdivisions of notes. Consider the smallest notes in Example 2.6. These are also represented as 50 rhythms, as can be seen in the following equation:
Example 2.6: Alternate notational interpretation of the **recip token 50 (highlighted in red).
In order to disambiguate such cases, the ordering of the factors within the brackets in the above equations must be known. This can be done with tuplet layout codes in Humdrum data which give clues to notation renders on how to organize the notation. Layout codes are structured local comments which start with !LO:, followed by the specific layout code, which is TUP for tuplets, followed by a colon-separated list of parameters for the layout code. Example 2.7 show the music of Example 2.5 encoded as Humdrum **kern data. The layout code in the second spine on line 4 of the file (!LO:TUP:r=2.:t=5) indicates the outer quintuplet bracket. The r=2. parameter is the rhythm value (reciprocal duration) of the bracket, and the second parameter, t=5 indicates that the tuplet’s duration will be split into 5 equal parts.
Example 2.7: **recip encoding of the music in Example 2.5, including tuplet layout codes.
2.2. Rhythm scaling¶
The rscale program can be used to multiply or divide the duration of all rhythms in a score. The two main purposes of rhythmic scaling are (1) to remove rational rhythm representations, and (2) to switch between early and modern rhythm units for the beat.
The Humdrum Toolkit programs will not understand reciprocal rhythms such as 3%2 for triplet whole notes. Typically a datafile with rational rhythms will contain a line such as !!!rscale-alt: 1/2 which indicates that the original file contains reciprocal rhythms, and a rhythm-scaling by 1/2 will remove them. For example, if 3%2 (triplet whole-note) is halved, then the reciprocal rhythm becomes 3 (triplet half-note). See the rscale usage in Example 2.2 for such cases.
A related concept is the *rscale: tandem interpretation which indicates that a rhythmic scaling should be applied to a spine when creating graphical notation. This interpretation is used frequently in Humdrum scores of music from the early Renaissance created by the Josquin Research Project (also available on GitHub). Music of the fifteenth century was written in mensural notation, and the JRP edition tries faithfully preserve the original rhythm levels in modern notation, with the beat typically occurring at the whole-note level rather than the quarter note.
JRP Humdrum scores are in resolved notation, such that a whole note in one part is always equal in duration to a whole note in another part. When an original part is in a different rhythmic scaling from the other parts (typically the cantus firmus), the rhythms are scaled to match the other parts, along with an *rscale: interpretation giving the factor which needs to be applied to the part to generate rhythmic values of the original notation. Example 2.8 demonstrates this sort of case. Two parts switch to reverse-C mensuration in the second measure while at the same time, increasing their rhythmic durations by a factor of two. Notice that the first and third parts have two whole notes per measure at this point while the second and fourth parts have four whole notes per measure.
Example 2.8: Josquin, Missa L’homme armé sexti toni, Credo, mm. 234–7.
The music can easily be converted to resolved and reduced notation as shown in Example 2.9.
Example 2.9: Resolved and reduced version of the music in Example 2.8.
|rscale -f 1/2 jrp://Jos0602c | autostem | sed 's/\*rscale:/*Xrscale:/g; s/\*met(/*Xmet(/g'|
2.3. Composite rhythm¶
The beat program can be used to calculate the duration of each line of a Humdrum file containing **kern or **recip data. Musically this called the composite rhythm, which is the rhythm of all parts considered as a single stream. The following musical example shows four parts on the top two staves along with a staff beneath showing the composite rhythm of all parts. In measures 1, 3 and 4, no single part contains a complete measure of eighth notes, but when considered together the rhythmic texture is a sequence of continuous eighth notes.
Example 2.10: J.S. Bach, Chorale Hilf, Gott, laß mir’s gelingen, BWV 343, mm. 16–19. Composite rhythm of all parts given on the bottom line of the system.
|⇒ beat -dp ⇒|
!!!COM: Bach, J.S. !!!OTL: Hilf, Gott, laß mir’s gelingen !!!SCT: BWV 343 **kern **kern *clefF4 *clefG2 *k[b-] *k[b-] *M3/4 *M3/4 *^ *^ =16- =16- =16- =16- 8dL 4G 4.b- 4g 8e-J . . . 8fnXL 4F . 4.d 8FJ . 8a . 4G 4E-X 4g . . . . 8c =17 =17 =17 =17 2A;y 2D; 2f#; 2d;y [4d 4D 4a 4f# =18 =18 =18 =18 8dL] 4.G 2b- 2g 8B-J . . . 4e- . . . . 8E-X . . 8dL [4B- 4dd 4fnX 8B-J . . . =19 =19 =19 =19 4G 4B-] 2cc 8enXL . . . 8d 8cL 4A . 8e 8AJ . . 8f#J 8B-L 4G 4b- 4g 8dJ . . . = = = = *v *v * * * *v *v *- *-
!!!COM: Bach, J.S. !!!OTL: Hilf, Gott, laß mir’s gelingen !!!SCT: BWV 343 **dur **kern **kern * *clefF4 *clefG2 * *k[b-] *k[b-] *M3/4 *M3/4 *M3/4 * *^ *^ =16- =16- =16- =16- =16- 0.5 8dL 4G 4.b- 4g 0.5 8e-J . . . 0.5 8fnXL 4F . 4.d 0.5 8FJ . 8a . 0.5 4G 4E-X 4g . 0.5 . . . 8c =17 =17 =17 =17 =17 2 2A;y 2D; 2f#; 2d;y 1 [4d 4D 4a 4f# =18 =18 =18 =18 =18 0.5 8dL] 4.G 2b- 2g 0.5 8B-J . . . 0.5 4e- . . . 0.5 . 8E-X . . 0.5 8dL [4B- 4dd 4fnX 0.5 8B-J . . . =19 =19 =19 =19 =19 0.5 4G 4B-] 2cc 8enXL 0.5 . . . 8d 0.5 8cL 4A . 8e 0.5 8AJ . . 8f#J 0.5 8B-L 4G 4b- 4g 0.5 8dJ . . . = = = = = * *v *v * * * * *v *v *- *- *-
The -d option for beat is used to extract the duration of each data line. The -p option prepends the duration analysis data to the start of each line (-a will append the analysis data to the end of the line).
The -f option will display duration information as fractional ratio values instead of decimal numbers. When the -f option is used, the value of one represents the duration of a while note (rather than a quarter note with the default floating-point duration vales).
Example 2.11: Extracting durations as rational numbers instead of floating-point values.
|myank -m 16-19 h://370chorales/chor199.krn | ridx -GL | beat -dpf|
Example 2.12 gives an example of extracting the distribution of durations for the composite rhythm of 370 Bach chorales. First the composite rhythm is extracted from the chorales. Next the rhythm is stripped of its Humdrum syntax structure with ridx -H (which is equivalent to “rid -GLId | grep -v ^=”) and then the raw data lines are sorted and counted with sortcount.
Example 2.12: Create a frequency distribution of composite rhythm durations in 370 Bach chorales.
|beat -df h://370chorales | ridx -H | sortcount -p|
69.43 1/8 19.46 1/4 7.11 1/16 2.79 1/2 0.94 3/4 0.18 1 0.04 3/8 0.03 1/32 0.02 3/16 0.01 2 0.01 3/2
The most common composite rhythm value is the eighth note (69.43%), then in decreasing frequency: quarter note, sixteenth note, half note, dotted half note, whole note, dotted quarter note, 32nd note, dotted eighth note, breve, and dotted whole note.
Below is a more complicated example which contains a polyrhythmic composite rhythm. The right-hand rhythm in measure 9 is five eighth notes in the time of three which has a duration of:
The duration of 3/40th of a whole note is represented in extended **recip by the rhythm value 40%3. Likewise, the septuplets in the last measure are \(\scriptstyle 3/7 \times 1/8 = 3/56\) whole notes, which is the **recip rhythm 56%3.
Example 2.13: F. Chopin, Nocturne in B major, op. 9/3, mm. 8–10.