Time

There are multiple ways to indicate time in a Ratioscore. The left-most timing spine (column) will be used to control time in the score, with possibilities being:

Spine heading     Meaning
**time Absolute time in seconds (excluding tempo changes).
**dtime Delta time in seconds.
**ms Absolute time in milliseconds.
**dms Delta time in milliseconds.
**recip Musical time in divisions of a whole note.
none No timeline: treat each data line as 1 second long.

**time

A **time spine gives the time in seconds to start notes on each line. Time values need to be sorted from low to high in the score. Here is an example of playing a new note once every quarter second, and then once every half second, then once every second:

If a note is still sounding by the end of the score, it will be extended for one second before being turned off.

**dtime

The **dtime spine gives the time in seconds to wait until playing the next line of the score. Here is an example that produces the same rhythms as the previous example using **time:

**ms

The **ms spine is similar to **time, but the units are milliseconds (1000 milliseconds equals one second).

**dms

The **dms spine is similar to **dtime, but the units are delta milliseconds.

**recip

The **recip timeline describes time in terms of musical rhythms. Numbers represent divisions of a whole note, such that 4 means a quarter note, 8 a half note, 12 a triplet eight note and so on. One or more augmentation dots can be added after the number, such as 2. for a dotted half note, or 20.. four a doubly-dotted quintuplet sixteenth note.

Implicit time

If there is no timeline in the score, then an implicit **dtime is used, with each data line in the score played for one second (plus any tempo changes). Tempo changes can be given in any **ratio or **drum spine.

Tempo

All time spines can be altered by tempo changes. This will cause time descriptions such as **time, **dtime, **ms and **dms to no longer represent physical time.

Tempo changes are indicated by *MM#, where # is a floating-point number of beats to perform in one minute (MM = “Maelzel’s Metronome”). *MM60 is the default tempo for a time spines, and is equal to one beat per second.

Fractions

The **time, **dtime, **ms, and **dms timelines can use rational numbers in addition to floating point numbers.

[Note: needs to be implemented]

For fractions that are larger than one, the integer part can be split from the fractional part:

[Note: needs to be implemented]

For **recip timelines, fractional values are reversed and a % character is used instead of a slash. For example, 4 and 4%1 both represent a quarter note, with the denominator of the reciprocal fraction being 1 by default. Triplet whole notes are 3%2 (i.e., 3/2 = 1.5 triplet whole notes create a regular whole note).

Barlines

[Move this to another documentation page about Humdrum file structure]

Barlines are indicated by placing an equals sign (=) in each column of the score. An optional measure number can follow the equals sign. The divisions of the score into measures does not have to be equal or metrical.

Multiple timelines

Multiple timelines can be present in the Ratioscore, but only the leftmost one will be used to perform the **ratio spines.

In this case only the first **dtime spine will be used (constant 16th note rhythm). To use the second timeline, add a filter line to the score:

The filter line can be placed anywhere in the score (top, bottom, middle). The extract filter pulls out the specified spines, which are from the second spine to the end of the line in this case, removing the first **recip spine. This will perform the score using a repeated 8-16-16 rhythm instead of the constant 16th notes.

Independent timelines

Here is an example of storing parts one after the other in the score rather than in a single timeline.

Note that the timeline data type does not have to match between the different parts, and one or more parts can be present in each segment. Only one segment should have tempo changes. Here is the equivalent with all parts in a single timeline:

Metadata and filters can be placed inside of **/*- for each segment, or the start of each segment can be started with !!!!SEGMENT: name, where name is optional.

Gracenotes

If a timeline entry has zero duration, it will be interpreted as a grace note. The previous note will be shortened by 100ms and the grace note start time moved back 100ms. If the previous note is less than 200ms, the grace note start time will be 1/2 of the duration between the onset times of its neighboring pitches. Only one grace note in a melodic sequence can currently be handled.

With **time data, a repeated time value means that the first entry is a grace note:

In **recip data, use q to represent a grace note:

The duration of the grace note is fixed at 100ms, regardless of the tempo:

If the duration of the grace note would bring it closer to the previous note than to the note after it, the grace note is shortened to fit half-way between the two notes.

To change the duration of grace notes the interpretation *grace:500 means to set the grace note duration to 500 ms:

Here is an example Turkish music score using grace notes.