# Pitch

Pitches are stored in `**ratio` spines (columns). Each `**ratio` spine will be converted into a track when outputting to a Standard MIDI File, and only one note can be active in the spine/track at any given time. Pitches remain active in a spine until another one is given further down in the spine, or if `0` is used to turn off a pitch. The duration of the pitch is controlled by a timeline found in a separate spine.

Pitches can be represented in various units. The basic representation is a rational number, such as `3/2`, representing a just perfect fifth above the reference pitch for the spine. This can alternatively be given as the floating-point number `1.5`, or as `701.955c` in cent units. Mathematical expressions such as `(3/2)*(80/81)^(1/4)` can be used to describe ratios, which in this case means a just perfect fifth flattened by 1/4th of the syntonic comma. Irrational numbers for equal-temperament can use exponentiation, such as `2^(7/12)`, which is equivalent to `700c` (700 cents) for an equal-tempered perfect fifth).

Usually pitches are described as intervals compared to a reference pitch, but they can also be given as specific frequencies, such as `300z` for 300 Hz, or as a fractional MIDI note number, such as `60.5m`, which represents an equal-tempered quarter-tone sharp above middle C (using A-440Hz and equal-temperament as a an implicit tuning reference for MIDI pitches).

## Reference pitch

The reference pitch is specified in the form `*ref:A4`, where `A4` is the A above middle C. A reference pitch is required for pitches described as intervals (fractions, real numbers, including mathematical expressions). Frequency and MIDI number pitches do not rely on a reference pitch.

Below is an example of playing harmonics of three different references:

C4 (middle C) will be used as the reference pitch if none is given in a ratio column. The reference pitch can be tuned off of EQ/A440 by adding/subtracting a cent interval from the note name. The cent interval should have the letter “c” following it:

Frequencies in Hertz can be used as a reference if the frequency has the letter “z” after it:

The reference pitch may also change after the start of the score:

If the reference pitch changes often and should apply to all `**ratio` columns, then a separate `**ref` column can be used:

A `.` character in the `**ref` spine will continue the reference pitch from a previous line.

## Harmonics

As illustrated in the above example, integer values are harmonics, with `1` being the fundamental of the reference pitch, `2` being an octave higher, and so on. Rests are indicated by `0`.

## Fractions

To get intervals between harmonics, rational numbers can be used, such as `3/2` for a perfect fifth. In the following example, `5/1` is the 5th harmonic of the reference pitch (two octaves and a major third), `5/2` is an octave lower (major tenth), `5/3` is a major 6th above the reference, `5/4` is a major third, and `5/5` is the reference pitch. Also: `5/10` is an octave lower than the reference, `5/8` is down a minor 6th, and `5/6` is down a minor third.

## Floating-point numbers

Ratios can be simplified into numbers containing fractional values after a decimal point.

## Exponents

Here is an example of exponent notation to generate 12-TET:

## Mathematical expressions

When describing pitches as integers fractions and exponents, basic mathematical operations can be used to express the ratio in a factored form for clarity:

Note that multiplication has priority over division, so `3*3/2*2` will be treated as `(3*3)/(2*2)` rather than `((3*3)/2)*2`. Also note that exponentiation has priority over multiplication. Parentheses can be used to control the operator priority, but the current parser is not very advanced, so avoid complicated expressions.

## Cents

Cents can be used instead of or in addition to fractions. A floating-point number followed by the letter `c` will be interpreted as cents, and cents will be above (or below) the reference pitch.

Here is an example of playing an Equal-tempered C major scale at the same time as C major in Just intonation (listen to the beating when the two notes are less in tune):

Here is an example of a quarter-tone chromatic scale using cent intervals relative to the reference pitch:

## MIDI key number

MIDI key numbers can be used in `**ratio` spines by following the key number by the letter `m`. A reference pitch is not needed if key numbers are used, since MIDI note 69.0 is assigned to the frequency 440 Hz and other integer values for MIDI keys are assumed to be in equal temperament.

Here is an example of quarter-tones using fractional MIDI key numbers:

## Frequency

Specific frequencies can be used by appending a floating-point number with the letter `z` (for “Hz”). If only frequencies are given in a `**ratio` column, then the reference pitch is not necessary. Here is a C major scale in equal temperament using frequencies and cents for comparison:

## Symbols

See the Symbols page for a description of giving arbitrary names to pitches.