MML: Frequency Module

  1. Cent
  2. Note
  3. Noteset and octave
  4. Scale
  5. Tuning

As mentioned, reduced very crudely, music is a function of time and frequency. A basic description of music thus entails both a time and a frequency module.

Music theorists distinguish between the possible notes in an "octave" and the actual notes. Possible notes are called the gamut, actual notes are expressed in terms of the so-called naturals and their variations. The cent is the smallest useful unit of frequency difference. One octave consists of 1200cent in the equally tempered tuning system.

Frequency module

1 Cent

cent
the smallest relative unit for measuring frequency differences between notes (ie the interval)

cent

Keep in mind that both noteset and cent are relative units.

There are 1200cent in one octave. Average users can tolerate deviances of up to 50cent from a base note, while professional musicians typically pick up differences between 10 - 20 cent. A well-trained musician with good discriminating abilities can pick up differences of as little as 5cent.

From a machine perspective frequencies can be analyzed in terms of much smaller unites. Such absolute value frequencies are measured in Herz (Hz).

The cent is usually written as a "c" character with a vertical slanted line through it, ie ANSI 155 (¢, or ¢).

See the table showing the difference between just intonation and equal temperament.

Top

2 Note

note
a specific pitch of frequency of a given length (duration) within a certain framework of frequencies

note

A note is the basic music object and desribed in terms of both frequency and time. The MML note concept is an abstract unit of description, and may relate to the "note" of Common Western Notation. However, there is not a one-to-one correlation between these concepts.

Although a note may be described in terms of frequency and time, in some music paradigms the actual time of a song is left to the interpreter or performer. The same is valid for some paradigms for which frequency may be relative and left open for interpretation.

A phrase of music may be notated as follows:

CGEDGD

This states only frequency, and then not very precise as the octave of the notes is not known. Stating notes in this format tells only half the story: nothing is mentioned about time. Yet a performer may be able to play these notes by jamming around with the frequency values, which is not possible if only time (ie duration) values were given. This implies that frequency is more fundamental than time. For this reason notes will firstly be described in terms of their frequency indicators, and secondly by the time values assigned to the particular frequency.

Notation systems are biased towards frequency, and MML will follow this tradition. Notes will thus be marked with these alphabetical note names, and time will be marked in a secondary form (such as :4 for a quarter note). A markup language might as well take time as primary. The notions of primary and secondary are here restricted to the context of structural markup. From the point of view of the actual note, both concepts are necessary -- it is like the particle-wave duality of light in quantum physics.

In MML notes can be expressed absolutely as frequencies, or relatively with conventional notation.

Relative note frequency values

Note names: long form

note="A"
note="B"
note="C"
note="D"
note="E"
note="F"
note="G"

Note names: short form

In the short form the note attribute is dropped and only its value is stated (these values would typically be stated as content of elements such as bar):

A
B
C
D
E
F
G

These alphabetical note names refer to the so-called naturals.

When these relative note names are used, the octave should also be declared to fix frequency values within the range set, eg 3C refers to note C in octave 3.

Example: long form

Here are a few C notes, each in a different octave:

note="3C"
note="7C"
note="4C"
note="2C"

Example: Short form

3C
7C
4C
2C

Notes values

Apart from the note name, referring to pitch, its length is also important. In Western staff notation relative length units are as follows:

1 = whole
2 = minim / half
4 = crotchet / quarter
8 = eighth
16 = sixteenth
32 = thirty-second
64 = sixty-fourth

In MML convention a length unit number follows the note name, separated by a colon.

Examples

Here are examples of an A note with different relative note length values. Note that the time indicators (eg 2) follow the frequency indicator (A) because frequency seems to be more fundamental than time. The colon (:) is used as separator.

A:2
A:4
A:8
A:16
A:32
A:64

The default is the whole note. However, a song as a whole, or any part of it, may have a different default note length. To have economical markup it is advised that a value deviating from the default value be declared for smaller structural units, for example on beat level.

Examples

Here is a bar (bar number 20) with eighth notes as default:

<bar barid="20" note="8">...</bar>

Here is a beat within this bar with sixteenth notes as default:

<bar barid="20" note="8" beat="3:16">...</bar>

Absolute note frequency values

Absolute note values are expressed in terms of frequency noted in Herz (Hz). When all notes are expressed absolutely, there is no need to state octaves. Mapping of note values to frequency values occurs in look-up tables set by the tuning system used.

Top

3 Noteset and octave

noteset
set of notes within a cycle of steps

noteset | scale

The name octave is derived from Latin referring to the eight white notes on a keyboard that form a set. Octaves are repeated cyclically at higher or lower frequencies.

Together with the 5 black notes there are 12 notes in an octave. This is only in Western tempered music. Other music systems may have only 5 notes to the "octave", or even in excess of 20 notes. The Western octave contains a set of notes, each of which is in a 2:1 relationship with their counterparts in another set, ie in another octave. Technically an octave refers to the distance of a number scale degrees or steps within a set of notes. As the octave is not universal, a more neutral term will be used in MML: noteset, which is not restricted to the 8-note, 2:1 relation set, but is used as a generic term that may as well apply to a 5-note "octave".

A seven-octave piano keyboard ranges in frequency from about 20Hz to 5'000Hz. There are different conventions for numbering octaves, such as the Helmholz method, (starting about in the middle of the piano keyboard and numbering outwards, thus a dual method) and the method used by music physicists (starting at one end, the lower end, and numbering serially upward).

A noteset (with tuning "octave") can be indicated with two methods:

When a noteset (with tuning "octave") number is indicated together with the note name, the number in MML precedes the note name.

<song
 noteset="3"
 note="3:4">

The note value is read as a quarter note in the third octave.

As 20Hz is about the lowest humanly audible frequency (lower frequencies are not so much heard as felt), numbering octaves in MML will begin with octave 0 (ie zero) at A= 27.5Hz given a certain tuning system or as specified in the table in the *.tun file. Music theory conventions usually indicate the octave number as a subscript after the note name, eg C4. This notation is impossible in markup code. The number thus needs to be un-subscripted (eg C4). However, as frequency seems to be more fundamental than time, this format is used in MML to indicate a C with a quarter note value. In MML the octave number thus needs to preceed the note name to avoid confusion: thus middle C is 4C because it is in the 4th octave.

The dominant noteset may be declared once in the song of the song. Local changes of the change can be declared on note level with the note attribute.

Values

The human ear is capable of hearing sounds in the range of frequencies 20Hz to 20KHz (or more likely: 17-18KHZ). Music typically ranges between 2 to 5KHz, however, the 2' pitch pipe organ reaches 8'372Kz. Harmonics of cymbals reach up to 16'000Hz (octave 9 in the table below). Here is a table showing the frequencies of A notes in different octaves, given 4A = 440HZ.

Concert tuning: A=440Hz
Octave number Helmholz number Approximate frequencies for first A of each octave
0   27.5Hz
1 A, 55Hz
2 A 110Hz
3 a 220Hz
4 a' 440Hz
5 a" 880Hz
6 a"' 1'760Hz
7 a"" 3'950Hz
8   "7'900Hz"
9   "15'900Hz"
Octaves 8 and 9 above are theoretical octaves.
The approximate frequencies are for a given tuning (for A = 440Hz). When "A" has another value (eg 442Hz), the frequencies of the other notes will also be different.

In MML the information above is typically contained in a mapped file. For A=440 the filename would be 440.tun, and for A=442 the filename would be 442.tun. Also see tuning.

Example of octave 4
<bar barid="3" noteset="4">
</bar>
Markup example in song
...
 <song noteset="4">
 ...
 </song>
 ...
Example of octave number with note

Here are a few C notes in different octaves.

5C
3C
2C
7C

Example of different octaves in a single bar
<bar barid="21" noteset="3">A 4A 2A A 
</bar>

This is read as follows:
There are four A notes, each on a different beat. The A notes on beats 1 and 4 are on octave 3, as specified by the noteset attribute; the second beat on octave 4, the third on octave 2.

Top

4 Scale

scale
a scale determines the relationships between notes and is used for tuning these relationships

scale

The scale determines which base frequencies are allowed within a set of notes. There are many different scales used in different cultures. In Western music the dominant scale consists of 12 tones in an octave. Other music systems, such as the Javanese gamelan or Indian raga, use other configurations.

Even in Western music there are a few different scales in use. Due to a certain tradition the so-called equal temperament currently dominates Western culture and global popular music. In the equal temperament system the octave is divided equally between the notes. From a physics point of view this results in an out of tune scale, but our ears are so accustomed to it that it sounds right.

Here are some of the other scales that have been used in western music:

Scale beginning note
Aeolian A
Locrian B
Ionian C
Dorian D
Phrygian E
Lydian F
Mixolydian G

Avante garde composers in twentieth century Western societies have experimented with as many as 19 and 24 tones to an octave, but this music has not reached the masses. In order to be globally relevant, MML will have to consider these other schemes.

Top

5 Tuning

tuning
the adjustment of note pitches in relation to other notes

tuning

The tuning of instruments is not so straightforward as it appears to be, especially on fixed pitch instruments such as keyboards. Tuning is based on the notion of scales, and there are many different scale systems in use all over the world, even within the tradition of Western music. Notes within the dominant Western scale stand in certain mathematical relationships to one another. The Pythagorean scale commonly used in Western music emphasis thirds and sixths as consonances (ie notes that sound good together with the base note).

When the frequencies of notes are calculated on the basis of the ratios between notes, the direction in which the calculations are made is important. Moving up the scale gives one answer, moving down gives another answer. For this reason the G-sharp and A-flat notes have different frequencies, yet there is only one note-key on a typical keyboard for both. Organs and harpsichords often provide separate keyboards for these different notes -- so that a performer could play a G sharp that differs in frequency from an A flat (notes which have the same frequency on standard keyboards).

To accommodate different tuning possibilities, MML will map a tuning file to the markup file.

There are two important notions here:

Base frequency

In Western music the note A is usually used to tune other notes by. In practice different frequencies are used for A (either 440Hz or 442Hz), which means that other notes then are also tuned to different sets of frequencies.

Example

In MML the frequency of the referenced A (or other note) should be indicated.

<tuning>4A:440<tuning/>

or

<tuning>4A:442<tuning/>

Relationships between notes

The base frequency itself serves as a reference point. Other notes are in certain relationships to the base note, and their exact frequency values depend on the system of tuning.

Here are the major tuning schemes, based on the frequency relationships between notes.

As different tuning systems can be implemented, a markup file (*.mml) should map tuning data from a data file containing tables of frequencies. Such tuning files should be saved as *.tun or *.tuning files.

This table shows the difference between just intonation and equal temperament in frequency.

Major scale Chromatic scale Equal temperament Just intonation How far equal is off just
1 1 0 0 0
  2 100 111.73 11.73
2 3 200 203.91 3.91
  4 300 315.64 15.64
3 5 400 386.31 -13.69
4 6 500 498.04 -1.96
  7 600 590.22 -9.78
5 8 700 701.96 1.96
  9 800 813.69 13.69
6 10 900 884.36 -15.64
  11 1'000 996.09 -3.91
7 12 1'100 1'088.27 -11.73
8 13 1'200 1'200 0
Values are in cent (¢)

Top

© 1999, 2000 Author: Jacques Steyn