Syntax of Tone Sequences

The syntax is used in ekmelib both for the player and for the score.

It is partly adopted from LilyPonde.g. note names, relative octave mode, reciprocal note value, scaling, tie, delimiters, and some commands – and extended with elements to specify proportions, cent values, absolute frequencies et al

A tone sequence consists of tones, chords, commands, and variables, which must be separated from each other by space characters1. On the other hand, space characters are not allowed within a tone, a proportional chord, a command, or a variable.

A tone sequence may have any length, however a longer music sample (several hundreds of tones) slows down the typesetting significantly.

All examples in this page use the German note names.



TONE is a Note, Proportion, Frequency, Rest, or Tick.

Cent, Duration, and Tie are optional. However, tones inside of a chord must not have a duration or tie.



NOTENAME: The possible note names depend on the used ekmelib script for a particular tone system and a language. Available are English and German names in the systems:

An apostrophe (single quote) ' increments the octave by one.
A comma , decrements the octave by one.

In the Absolute Octave Mode (the default), no ' or , means the small octave, one ' the one-line octave, two '' the two-line octave, one , the great octave etc.

In the Relative Octave Mode, a note is related to the range of a fourth above and below the preceding note, ignoring the alteration. Other tones (frequency, proportion, rest, tick) between two notes do not effect the relative octave.

The pitch is calculated from the frequency of the concert pitch.



A proportion relative to the root pitch. NUM and DENOM must be integer numbers. The pitch is calculated from the frequency of the root pitch (F): F × NUM / DENOM


A proportion relative to the preceding tone. NUM and DENOM must be integer numbers preceded by a sign + or -. The pitch is calculated from the frequency of the preceding tone (F):
with +:  F × NUM / DENOM
with -:  F × DENOM / NUM



An absolute frequency in Hz (Hertz). It may have a fractional portion. The case of hz is ignored.


r R s

A rest. R is a full measure rest. s is an invisible rest or skip.
They are all equivalent for the player. They produce an audio signal with the gain 0.



A metronome tick. In the player, this is actually a short high tone followed by silence up to the end of the Duration.


\relative=c' c fis c geses' c,
Tone sequence in the Relative Octave Mode. All tones lie within the one-line octave, but geses without ' would be in the small octave (and hence also the subsequent c,).
d' a' as' gih' d' gih' as' a'
Tone sequence in the Absolute Octave Mode (exercise for quarter tones2).
\relative=c' d a' as gih d gih as a
The same tone sequence in the Relative Octave Mode.
Absolute frequency.
220hz +3/2 +4/3 +5/4 +6/5 +7/6
Naturetone series from 2nd thru 7th partial tone (220 - 770 Hz).
1/1 -5/4 -36/35 -28/27
Tetrachord enharmonic after Archytas (downward).



CHORD is a Regular Chord, a Proportional Chord, or a Chord Repetition.

Cent, Duration, and Tie are optional.

All tones of the same chord start at the same point of time and have the same duration. They must not have an individual duration or tie.

Regular Chord


A chord with any number of tones between the delimiters < and >.

In the Relative Octave Mode, the first note after the chord (after >) is related to the first note inside the chord (after <).

Proportional Chord


A chord made of any number of proportions relative to the root pitch. NUMBER1, NUMBER2, … must be integer numbers. The chord must not contain any space characters. The pitches are calculated from the frequency of the root pitch (F):
1st tone:  F
2nd tone:  F × NUMBER2 / NUMBER1
3rd tone:  F × NUMBER3 / NUMBER1


A proportional chord relative to the preceding TONE. Further tones may also be specified between the delimiters < and >. The pitches are calculated from the frequency of TONE (F), like above. Hence, this is the first tone of the proportions.

Chord Repetition


A shortcut to repeat the last specified chord. Between this and q, individual tones are also allowed.


Each in the Relative Octave Mode.

< d a' >4
Fifth, a above d (for a quarter note).
< d a >4
Fourth, a below d.
<c gesil' her fih'>2
Four-voice chord (for a half note).
Perfect fourth.
Natural third (for a whole note).
< e 5:7 >
Tritone ekmelic.
< e aiser >
(Almost) equivalent interval.
Pythagorean minor third + pythagorean major third (for 2 seconds).
< 54:64:81 >2s
Dito in another syntax.
< d 54:64:81 >2s
Dito with d as the first tone (not 4 tones).



Alters the pitch of the tone or of all tones inside of the chord. CENTVALUE must always be specified with a sign + or - and may have a fractional portion. The pitch is calculated for the frequency of the tone (F):
F × exp(± CENTVALUE / 1200 × ln2)


G a twelfth-tone higher.
Absolute frequency by 10 cents higher.
<e aiser>-50_2
Chord a quarter-tone lower (and for a half note).


The duration is either a Note Value or an Absolute Duration, optionally followed by a Scaling. Without a specified duration, the one of the preceding tone is taken. The default for the first tone (also after a tempo command) is the duration of a whole note.

If the duration immediately follows a number, i.e. in case of a Proportion, a Proportional Chord, or Cent, it must be preceded by _ . Else _ is optional.

Note Value


A reciprocal note value, followed by one or more . for a dotted note.
NOTEVALUE is 1, 2, 4, 8, 16, 32, or 64. 1 (whole note) is the default.

Absolute Duration


An absolute duration in seconds. It may have a fractional portion. The case of s is ignored.



A scaling factor for the duration. NUM and DENOM must be integer numbers preceded by * . A sole NUM is equivalent to NUM/1. Several scaling factors can be combined.


Specified for tempo 4=60.

Quarter note, 1 second.
Quarter note dotted, 1.5 seconds.
Absolute, i.e. always 4 seconds independent of the tempo.
Quarter note scaled as triplet part, 2/3 seconds.
Eighth note scaled as quintuplet part, 2/5 seconds.
Whole note scaled, 35 seconds.



Ties the tone or chord with the subsequent one. Both must have the same pitches (frequencies).


A tone sequence can be polyphonic. Beside chords, simultaneously playing tones can be specified with additional voices as follows. Up to 16 voices are supported. They can be of different length.



Beginning of a new voice. The tone sequence starts at the same point of time as that of the preceding voice, i.e. from the beginning of either the entire tone sequence or a section (see below).



Section in the tone sequence. All voices included in it start from the beginning of this section. A section must not be embedded within another section, i.e. <<<<>>>> is not allowed.

The delimiters \\, << and >> have no impact on the Relative Octave Mode, i.e. the first note after one of these delimiters is related to the last note before it. Therefore it is advisable to specify the relative command at the beginning of each voice.



The commands relative and tempo have alternative forms without a NAME. The commands relative, pitch, tempo, time, and supplement have corresponding attributes in the HTML ekmaudio and ekmscore elements which insert the respective command at the beginning of the tone sequence.

Note: Both commands and variables have a leading \ and NAME can also be used as the name of a variable which then replaces the command.

Octave Mode

\relative=NOTE \relative \=NOTE \=

NOTE sets the Relative Octave Mode and specifies the reference point for the octave of the subsequent note. NOTE itself must always be specified in the Absolute Octave Mode. Without NOTE, the Absolute Octave Mode is set. This is the default.

Concert / Root Pitch


Sets the frequency in Hz of the concert pitch A' for notes, or of the root pitch for proportions and proportional chords. It may have a fractional portion. The default is 440 Hz.



NOTEVALUE=RATE sets the number of reciprocal note values per minute. DURATION sets the absolute duration of a whole note in seconds. It may have a fractional portion. The subsequent tone has by default the duration of a whole note. The default is "4=60".

This command has no effect in the score.

Time / Meter

\time=NUM/DENOM \time

Sets the time (meter). NUM and DENOM must be integer numbers. Without a value, the meter will be disabled, i.e. the score does not draw barlines. This is the default.

This command has no effect in the player.

Supplemental data


This is a provisional command. See the corresponding supplement attribute.

Gain value


Sets the gain value, i.e. the sustain level, but only for the subsequent tones of those voice in which the command is specified. It may have a fractional portion. The nominal maximum is 1. The default is 0.95.

This command has no effect in the score.

Mark (Rehearsal mark)

\mark \mark=NUMBER

Sets a mark ahead of the next tone. The score draws the next symbol in the sequence A,B,C,…, however skipping the letter I. NUMBER is an integer number for the symbol to draw.

Example: … \mark … \mark … \mark=8 … \mark … \mark … draws the marks A B H J K.



Draws a barline ahead of the next tone. It is not counted as a measure, like those according to time.

This command has no effect in the player.



A variable NAME is an abbreviation for a predefined tone sequence. Each variable is defined by a separate file. This is a plain text file with the tone sequence and with the same name as the variable and the filename suffix txt. The name must consist of letters a-z, A-Z, digits 0-9, and minus - only, and must not start with 0-9. It may also be the name of a command which is then replaced by the variable. The name list is reserved for a file with the list of all online available variables and should not be used.

The tone sequence may contain commands but no further variables (embedded variables).

See also the var attribute and the edit window to maintain variables. Files of variables can also be created with a simple text editor like e.g. TextEdit on OS X, or Notepad on Windows.

Online Variables

The following table shows all variables which are online available at They define intonation exercises2 and tunings.

22 basic exercises each:
\vQuarter tones
\sSixth tones
\zTwelfth tones
\wEkmelic tones in varying sequences
Welle der Nacht:
\welle-der-nacht-hHarp tuning
\welle-der-nacht-o1Scale for 1st oboe
\welle-der-nacht-o2Scale for 2nd oboe
\welle-der-nacht-oExercise for both oboes
\welle-der-nacht-strExercise for strings
\welle-der-nacht-sExercise for soprano
Ekmelischer Gesang for Solo-violin:
\ekmelischer-gesang-t2Scale upward
\ekmelischer-gesangExercise for violin
Ekmelischer Satz for String quartet:
\ekmelischer-satzExercise for strings
\foehn“Föhn”: Organ push button setting
\indago-h“Indago”: Harps main tuning
\indago-o“Indago”: Organ push button base setting
\vom-leben-das-beste“Vom Leben das Beste”: Guitar tuning
Supplementary tone sequences:
\aa'20s r8s
\introa'10s r6s t4 t t t


< > << >> \\

These elements mark the beginning and end of a chord, a section, and a voice, respectively. They may adjoin the neighbouring elements directly or they may be separated by space characters1.

The sequences /* and */ can be used as an alternative to the characters < and >. They are intended for tone sequences in the seq attribute of HTML ekmaudio and ekmscore elements to discriminate them from the HTML-specific characters < and >.

Error Messages

The following errors can occur in a tone sequence. They will be listed in the edit window.

Unknown note name
A note name which is not defined in the used ekmelib script.
Invalid note value
A tone or chord with an invalid note value, i.e. none of the numbers 1, 2, 4, 8, 16, 32, or 64.
Unknown \ expression
An unknown command, or a variable which has not been loaded or which is included in the tone sequence of another variable.
Unknown element
An unknown element, i.e. neither a tone, nor a proportional chord, command, variable, or delimiter.
Invalid characters
Invalid characters at the end of a tone or chord.
Illegal zero value
A time parameter, a frequency, or the denominator of a proportion or scaling with the value 0.
Zero duration
A tone or chord with the duration 0.
Tie of different tones
A tie between tones of different pitches (frequencies).
Open tie
A tie at the last tone or chord at the end of the tone sequence, of a voice \\, or of a section >>.
Tie at an extra tone
A rest r, R, s, or a tick t with a tie.
Delimiter inside chord
A delimiter \\, <<, >>, or < inside of a chord. Only the closing delimiter > is allowed.
Extra tone inside chord
A rest r, R, s, or a tick t inside of a chord.
Duration inside chord
A tone with a duration inside of a chord.
Tie inside chord
A tone with a tie inside of a chord.
Empty chord
Only the delimiters < and > without tones in between.
Open chord
A chord without a closing delimiter >.
Useless end of chord
A closing delimiter > without a previous opening <.
No chord to repeat
A chord repetition q without a previous chord.
Section not in voice 1
A section within a higher voice.
Invalid parameter
A command with an invalid parameter.


cih ciseh hisih deseh
c+50 his+50 deses+50
cis-50 hisis-50 des-50
Enharmonically equivalent specifications for C a quarter-tone up.
c4 d er fih g asil hesel her c
Ekmelic series 1 on 1 (partial-tone series) with 8 degrees, in the Relative Octave Mode. Each tone takes a quarter note (4).
c'2s cis' er' fih' gesil' asil' hesel' hesil' c''
Ekmelic series 3 on 2 with 8 degrees, in the Absolute Octave Mode. Each tone takes two seconds (2s).
110hz1.5s +3/2 +4/3 +5/4 +6/5
+7/6 +8/7 +9/8 +10/9 +11/10
+12/11 +13/12 +14/13 +15/14 +16/15
Naturetone series from 2nd thru 16th partial tone (110 - 880 Hz). Each tone takes one and a half seconds (1.5s).
1/1_4s -5/4 -36/35 -28/27
Enharmonic tetrachord (28:27) (36:35) (5:4) after Archytas of Tarent. Each tone takes four seconds (_4s).
t4 t d''2 a' gih' cisih'' gih' heseh' a' d''
Two tick signals (t) in quarter note distance (4), followed by half notes (2) with semitone and quarter tone steps (ih eh), in the Absolute Octave Mode.
1/1_4s 3/2 2:3
Perfect fifth, one after the other and as a chord. Each tone takes four seconds (_4s).
<a' d>2 es'4 dih q es dih gih gel2 <h, e>4 gel' q
One solo voice with fourth's (from exercise for “Ekmelischer Gesang for Solo-Violin” 2).
fih'2 eih es d cis c4 d fih2 c2. d4
aseh2 geh fiseh e eser d1~ d2.~ d4
Two voices separated by \\ (from exercise for “Welle der Nacht” 2).
\relative=c' heser'2
  r1 r diser
  r1. gil,2~ gil1
  r1 eih~ eih
  r2 al,~ al1~ al
  fil1~ fil~ fil
Section between << and >> with five voices separated by \\ (from exercise for “Welle der Nacht” 2).


Thomas Richter, thomas-richteraonat
  1. abActually, a space character can be any Unicode white-space character: Space, Tab, Line Feed et al according to the JavaScript character class \s (= [ \f\n\r\t\v​\u00a0\u1680​\u180e\u2000​-\u200a​\u2028\u2029\u202f\u205f​\u3000\ufeff]).
  2. abcdeFrom “Ekmelische Musik. Aufführungspraxis und Intonationsübungen” (“Ekmelic Music. Performance Practice and Intonation Exercises”) by Franz Richter Herf, 1979. The scores with all exercises are available for download. They include links to the Ekmelic Player, each with one tone sequence.