Ekmelily – Notation of Microtonal Music

Ekmelily is an extension for LilyPond that supports variable accidentals and key signatures for the notation of microtonal music in several equal-temperament tunings – 12, 19, 24, 31, 36, 48, 53, 72, 96-EDO – and in 5-limit JI. For this purpose, it introduces predefined and user-defined notation styles. Each style describes a set of symbols for the alterations, usually up to the five-quarters-tone. Furthermore, Ekmelily defines own note names based on the names for semi- and quarter-tones given in LilyPond.

Ekmelily requires LilyPond version 2.19.22 or higher.

See Esmuflily for other music symbols (clefs, note heads, articulations, etc.) from SMuFL compliant fonts.

Download and Installation

  • Download
    The folder ly contains the include files. Copy the file(s) for the desired tuning(s) as well as the main include file ekmel-main.ily into an appropriate folder.
  • Optionally install a font, e.g. Ekmelos.
  • Documentation
    This page as pdf.
  • Tables
    … with all accidentals and note names supported by Ekmelily.

Usage

Add the following lines near the top of your LilyPond input file. All commands are optional – except for \include of the desired tuning – but should be specified in this order.

ekmFont = FONTNAME
\include "ekmel..."
\language "LANGUAGE"
\ekmelicStyle STYLENAME
\ekmelicUserStyle USERSTYLENAME #'((ALTERATION ELEMENT ...) ...)

Ekmelily + Esmuflily

To combine Ekmelily with Esmuflily, add e.g. the following lines near the top of your LilyPond input file.

ekmFont = FONTNAME
ekmSystem = TUNING
\include "cosmufl.ily"
\language "LANGUAGE"
\ekmelicStyle STYLENAME

The default values correspond with LilyPond:

FONTNAMEEkmelos
TUNING24, i.e. it includes ekmel-24.ily
LANGUAGEnederlands in most tunings
STYLENAMEstc (Stein / Couper) in TUNING 24

Fonts

Ekmelily requires a font for accidentals defined by code point, character literal, or string. This applies to all accidentals in the predefined notation styles. Each of them is a SMuFL recommended character or Ekmelos specific optional glyph (starting at code point U+F600).

Ekmelily uses Ekmelos by default. Another font can be selected, either with the variable

ekmFont = FONTNAME

(or ekmelicFont as in previous versions) preceding the include file,
or with the command line option1

-dekmfont=FONTNAME

(or -dekmelic-font as in previous versions).

The glyphs from LilyPond's Emmentaler font can be used with markup in a user-defined notation style. See the Example lilysingle.

Drawing paths

Ekmelily supports drawing paths instead of font glyphs, which allows e.g. to produce stand-alone SVG output. This requires the Scheme procedure ekm-path-stencil as it is provided for Ekmelos by the include file ly/ekmelos-paths.ily.

A trailing # in FONTNAME switches to drawing paths, which effects all accidentals defined by code point or character literal, in particular, all accidentals in the predefined notation styles. To draw Ekmelos glyphs as paths, add the following lines near the top of your LilyPond input file. Note that a single "#" is equivalent to "Ekmelos#".

ekmFont = "#"
\include "ekmelos-paths.ily"
\include "ekmel..."
...

Tunings

Ekmelily supports different tunings available as separate include files. Each provides its own set of languages and predefined notation styles. The first language and notation style specified in the following table is the default in the respective tuning. Some languages have alias names (in parentheses).

TuningInclude fileLanguagesNotation styles
12ekmel-12.ilynederlands english deutsch català (catalan) español (espanol) italiano français português (portugues) norsk suomi svenska svenska_ny vlaamsstd sag msag
19ekmel-19.ilynederlands english deutsch català (catalan) español (espanol) italiano français português (portugues) norsk suomi svenska svenska_ny vlaamsstd sag msag
24ekmel-24.ilynederlands english deutsch català (catalan) español (espanol) italiano français português (portugues) norsk suomi svenska svenska_ny vlaamsstc stz go stvt arrow sag msag arabic persian four haba bl
24 2ekmel-arabic.ilyitaliano arabicarabic helmakam
31ekmel-31.ilynederlands deutsch español (espanol) français italiano português (portugues)std sag msag stz sth
36ekmel-36.ilynederlands english deutsch norsk suomi svenskago arrow sag msag wys bos haba
48ekmel-48.ilynederlands english deutschsag msag gostz
53ekmel-53.ilymakam thm ktm english numberaeu aeuek thm sag dia
72ekmel.ilynederlands english deutsch norsk suomi svenskaarrow rhm rhmk sims hesse sag msag wys gostz gostc bos fern haba
96ekmel-96.ilynederlands english deutschsag msag persian om
5JIekmel-5ji.ilynederlandssag msag he

Note: Ekmelily versions prior to 3.0 support only 72-EDO.

Languages and Note names

Each tuning provides one or more languages for note names, which can be selected with the command

\language "LANGUAGE"

If LANGUAGE is not supported by the respective tuning, the default language is selected.

See the Tables with all note names supported by Ekmelily. They are based on the names for semi- and quarter-tones given in LilyPond.

Enharmonically equivalent note names

Some notation styles support two distinct, enharmonically equivalent accidentals, e.g. arrow, hesse, rhm, and sims for the one-quarter-tone and the three-quarters-tone. Therefore, Ekmelily defines two note names each, e.g. cqs and csaqf ("english") or cih and ciseh ("deutsch"). However, LilyPond does not support different accidentals for the same alteration. As a provisional solution, the combined note names like csaqf and ciseh) have slightly differing alterations (+1/1024) and therefore cause inaccurate MIDI output.

NoteNames context

Ekmelily supports the NoteNames context and its properties. Note names can be drawn in any supported language by setting the printNotesLanguage property. Else, the language selected for music entry is used.

The format can be specified with the printAccidentalNames property. The first three values below are equivalent to LilyPond's normal behaviour.

#tScale name and accidental (default)
#fScale name
'lilyNote name
'allAll alias note names stacked vertically
'alterationAlteration name
'fractionScale name and fraction of alteration
'accidentalAccidental

Predefined Notation Styles

Each tuning provides one or more predefined notation styles, which can be selected either with the command

\ekmelicStyle STYLENAME

or with the command line option1

-dekmelic-style=STYLENAME

If STYLENAME is not supported by the respective tuning, the default notation style is selected.

The following table shows all predefined notation styles. N indicates the default style in tuning N.
See the Tables with all accidentals in these styles. They require a SMuFL compliant font. All optional glyphs (starting at code point U+F600) are private supplements of Ekmelos.

Stylename TuningsAccidentals
stdStandard12 19 
stdStandard31 
stcStein / Couper24 
stzStein / Zimmermann24 31 
stvtStein / Van Blankenburg / Tartini24 
sthStein / Half flat 331 
blBlackwood 424 
fourDigit 424 
goGould24 36 
arabicArabic 524 arabic 
helmakamHel Makam 6arabic 
persianPersian24 
persianPersian 796 
aeuArel-Ezgi-Uzdilek 853 
aeuekArel-Ezgi-Uzdilek 953 
diaDiatonic 1053 
thmTurkish folk music53 
arrowArrow24 36 72 
bosBosanquet commatic36 72 
habaHába24 
habaHába 1136 72 
wysWyschnegradsky36 72 
fernFerneyhough72 
gostcGould / Stein / Couper72 
gostzGould / Stein / Zimmermann48 72 
hesseHesse 1272 
rhmRichter Herf / Maedel 1372 
rhmkRichter Herf / Maedel kink arrow 1472 
simsSims72 
omOpenMusic 1596   
heHelmholtz-Ellis5JI 
sagSagittal12 19 24 31 36 48 53 72 96 5JI 
msagMixed Sagittal 1612 19 24 31 36 48 72 96 

Universal Notation Styles

These notation styles are available for all tunings. They do not define any accidentals, except for the special symbols (default, leftparen, rightparen), so that the default accidental is drawn for each alteration.

The special symbols of void are automatically added to every predefined notation style.

Stylenamedefaultleftparenrightparen
voidNothing (empty markup)#xE26A#xE26B
alterationThe alteration value, e.g. 14"("")"
alteration-slashThe alteration value, e.g. 14"("")"
stepThe step of the alteration (integer)"("")"

Note: alteration, alteration-slash, and step use the text font selected in LilyPond, not the selected font of Ekmelily. See the Example numeric which is similar to alteration.

User-defined Notation Styles

A new notation style derived from the currently selected style can be created with the command

\ekmelicUserStyle USERSTYLENAME #'(
  (ALTERATION ELEMENT ...)
  ...
)

USERSTYLENAME is a freely chosen style name. If it is an empty string "", the name of the currently selected style extended with the suffix -user is taken.

ALTERATION is a rational number or the name of a special symbol. For each specified alteration, a new symbol is defined which is the composition of the elements. For all other alterations where the previous symbol of ALTERATION appears likewise (usually combined with other symbols), this symbol is also replaced with the new one. Therefore, the order of alterations in the definition list can be significant, in particular, when a replaced symbol is again defined but for another alteration. See the Example diaQuarter.

ELEMENT is one of the following:

  • a code point (integer), e.g. #xE47B for Wilson plus
  • a character literal, e.g. #\b for flat
  • a string, e.g. "bb" for double-flat
  • markup, e.g. ,(markup #:semisharp)

Two or more elements are juxtaposed with a padding of 0.12 staff units, but no extra space is inserted between the characters of a string. Note that in a SMuFL compliant font, all accidental glyphs have a zero side-bearing. This also applies to the Basic Latin (ASCII) characters in the Ekmelos font, so that e.g. "bb" is drawn without padding and #\b #\b with padding. See the Example hewm.

Special Symbols

Every notation style includes the following special symbols which are assigned to names instead of alterations.

Symbol name 
defaultDefault accidental for alterations without a defined accidental. This applies to the universal notation styles and to some styles for 53 and 96-EDO, or it can occur with \transpose.
leftparenLeft parenthesis for cautionary accidentals.
rightparenRight parenthesis for cautionary accidentals.

The special symbols of every predefined notation style are equal to the universal notation style void.

They can be user-defined like accidentals:

\ekmelicUserStyle USERSTYLENAME #'(
  (default ELEMENT ...)
  (leftparen ELEMENT ...)
  (rightparen ELEMENT ...)
  ...
)

Note: If both, the accidental and the parentheses are defined by a single code point, character literal, or string, the entire cautionary accidental is drawn as a single string. This enables the use of a ligature if one is provided by the selected font.

Additional Commands

\ekmelicOutputSuffix
Set the name of the selected notation style as the output filename suffix for the current \book section.
\ekmelic-style-name
Draw the name of the selected notation style as markup.
\ekmelic-font-name
Draw the name of the selected font as markup.
\ekmelic-char ALTERATION
Draw the accidental of ALTERATION (a rational number) according to the selected notation style as markup.
Used property:
  • font-size (1)
\ekmelic-elem ELEMENT
Draw ELEMENT with the selected font as markup. ELEMENT is a code point (integer), a character literal, a string, or markup. This command is intended to combine glyphs from the selected font with other markup in a user-defined notation style.
\ekm-fraction ARG1 ARG2
Draw a fraction of ARG1 and ARG2 as markup, with a fraction bar according to style: The default draws a horizontal bar. This is a variant of LilyPond's \fraction but with consistent vertical alignment. slash draws a diagonal bar. line draws a solidus (U+002F) with horizontally stacked numbers. This command is used by the next two commands.
Used properties:
  • font-size (0)
  • style ('())
\ekmelic-fraction ALTERATION
Draw ALTERATION (a rational number) as markup. If the denominator is 1, only the numerator is drawn, else a fraction according to style, and with fraction-size relative to the current font size unless style is line.
Used properties:
  • fraction-size (0)
  • style ('())
\ekmelic-fraction-small ALTERATION
Draw ALTERATION (a rational number) as markup like \ekmelic-fraction but with a 4 steps smaller fraction size.
\ekmelic-table NATURAL COMPOSITE ORDER
Draw a table of all accidentals in the selected notation style as markup, including the natural symbol if NATURAL is true, and all composite accidentals if COMPOSITE is true. Enharmonically equivalent accidentals and special symbols are always ignored. The accidentals are arranged in a row with the respective alteration placed beneath, and sorted by ascending or descending alteration if ORDER is 1 or -1, respectively, or by absolute alteration if ORDER is 2 or -2.
Used properties:
  • font-size (0)
  • width (4): Horizontal extent for each accidental.
  • baseline-skip: Distance between accidental and alteration.

Examples

See also the file styles/user-styles.ly for further examples of user-defined styles.

ekmFont = "Bravura"
\include "ekmel.ily"
\language "english"
\ekmelicStyle sims
Sets the predefined Sims notation for 72-EDO, selects the English note names, and draws the accidentals with the Bravura font.
\include "ekmel-24.ily"
\ekmelicStyle stz
\ekmelicUserStyle myNotation #'(
  (-3/4 #xE327)
  (1 #xE262 #xE262))
Sets the predefined Stein / Zimmermann notation (stz) for quarter-tones (24-EDO) and modifies it into a user-defined notation with the Sagittal flat 11 medium diesis down symbol (U+E327) for three-quarter-tones flat, and two sharp symbols (U+E262) for double-sharp.
\include "ekmel-24.ily"
\ekmelicStyle stz
\ekmelicUserStyle myNotation #`(
  (,THREE-Q-FLAT #xE327)
  (,DOUBLE-SHARP #xE262 #xE262))
This is the same example as above but it makes use of the corresponding Scheme symbols.
\include "ekmel.ily"
\language "english"
\ekmelicUserStyle hewm #'(
  (1 #\x)
  (-1 #\b #\b)
  (1/2 #\#)
  (-1/2 #\b)
  (1/4 #\^)
  (-1/4 #\v)
  (1/6 #\>)
  (-1/6 #\<)
  (1/12 #\+)
  (-1/12 #\-))
Sets the HEWM (Helmholtz / Ellis / Wolf / Monzo) notation for 72-EDO and selects the English note names. Note that double-flat is defined with #\b #\b which is drawn with a padding contrary to "bb".
\include "ekmel-24.ily"
\ekmelicStyle stz
\ekmelicUserStyle stockhausen #'(
  (1/4 #xED58)
  (-1/4 #xED59)
  (3/4 #xED5A)
  (-3/4 #xED59 #xE260))
Sets the notation after Karlheinz Stockhausen for 24-EDO with the fractional sharp symbols (U+ED58, U+ED5A), and the quarter-tone flat symbol (U+ED59).
\include "ekmel.ily"
\ekmelicUserStyle smuflHesse #'(
  (1/4 #xE27A)
  (-1/4 #xE27B)
  (1/6 #xE2A4)
  (-1/6 #xE2A1)
  (1/12 #xE479)
  (-1/12 #xE47A))
Sets a variant of the Hesse notation for 72-EDO using SMuFL characters: Gould arrows   (U+E27A, U+E27B), Sims half arrows   (U+E2A4, U+E2A1), and Bosanquet commatic symbols   (U+E479, U+E47A). It is very similar to the Arrow notation.
\include "ekmel-24.ily"
\ekmelicUserStyle diaQuarter #'(
  (1 #xF61C)
  (-1 #xF61D)
  (3/4 #xE265)
  (-3/4 #xE266)
  (1/2 #xE263)
  (-1/2 #xE264)
  (1/4 #xE262)
  (-1/4 #xE260)
  (5/4 #xF61C #xE262)
  (-5/4 #xF61D #xE260))
Sets the Standard sharp / flat symbols, single thru quintuple, like the predefined Diatonic notation (dia) but for quarter-tones (24-EDO). The quadruple symbols (U+F61C, U+F61D) are private supplements of the Ekmelos font. Note that here, the order of alterations is significant since the standard accidentals in the default notation (stc) are rearranged.
\include "ekmel-48.ily"
\ekmelicUserStyle lilysingle #`(
  (0    ,(markup #:natural))
  (1/8  ,(markup #:musicglyph "accidentals.natural.arrowup"))
  (-1/8 ,(markup #:musicglyph "accidentals.natural.arrowdown"))
  (1/4  ,(markup #:semisharp))
  (-1/4 ,(markup #:semiflat))
  (3/8  ,(markup #:musicglyph "accidentals.sharp.arrowdown"))
  (-3/8 ,(markup #:musicglyph "accidentals.flat.arrowup"))
  (1/2  ,(markup #:sharp))
  (-1/2 ,(markup #:flat))
  (5/8  ,(markup #:musicglyph "accidentals.sharp.arrowup"))
  (-5/8 ,(markup #:musicglyph "accidentals.flat.arrowdown"))
  (3/4  ,(markup #:sesquisharp))
  (-3/4 ,(markup #:sesquiflat))
  (7/8  ,(markup #:musicglyph "accidentals.sharp.slashslashslash.stemstem"))
  (-7/8 ,(markup #:musicglyph "accidentals.flatflat.slash"))
  (1    ,(markup #:doublesharp))
  (-1   ,(markup #:doubleflat))
  (leftparen ,(markup #:musicglyph "accidentals.leftparen"))
  (rightparen ,(markup #:musicglyph "accidentals.rightparen")))
Sets single glyphs from LilyPond's Emmentaler font for 48-EDO, as well as parentheses for cautionary accidentals. ±9/8 and ±5/4 are omitted here since they are set automatically to combinations of ±1 with ±1/8 and ±1/4.
#(define-markup-command (numeric-accidental layout props)
  ()
  (let ((alt (ly:chain-assoc-get 'alteration props 0)))
    (interpret-markup layout
      (cons '((font-size . -3)) props)
      (markup #:vcenter #:ekmelic-fraction alt))))

\ekmelicStyle void
\ekmelicUserStyle numeric #`(
  (default ,(markup #:numeric-accidental)))
Sets alteration values instead of accidental symbols. They are drawn as fraction, or integer if the denominator is 1, with the command \ekmelic-fraction and with a 3 steps smaller font size. This is applicable to all tunings. The void notation ensures that the default accidental is used for each alteration.

Author and License

Ekmelily was written by Thomas Richter, thomas-richteraonat

Copyright © 2013-2025 Thomas Richter

Ekmelily is licensed under the GNU General Public License, version 3 or later.
This license is available in the file LICENSE.txt and at www.gnu.org/licenses.

  1. abLilyPond produces a warning “no such internal option”, which can be ignored. Warnings can be suppressed with the command line option --loglevel=ERROR or --loglevel=NONE.
  2. abcekmel-arabic.ily is a variant of ekmel-24.ily for Arabic scores, like LilyPond's arabic.ly and hel-arabic.ly but with the correct accidentals U+ED30 – U+ED38. It also supports Arabic maqamat (keys).
  3. sth uses the optional glyphs U+F612 – U+F613 for the semi-flats.
  4. bl uses the optional glyphs U+F610 – U+F611.
  5. arabic: See ekmel-arabic.ily for Arabic maqamat.2
  6. helmakam uses the optional glyph U+F61B for the slashed double-flat. See ekmel-arabic.ily for Arabic maqamat.2
  7. persian in the 96-EDO tuning uses the optional glyphs U+F676 – U+F677 and U+F76C – U+F783.
  8. aeu uses the optional glyph U+F619 for the reversed slashed flat. See LilyPond's turkish-makam.ly for keys.
  9. aeuek equals aeu but does not use the reversed slashed flat, i.e. eksik-bakiye = koma.
  10. dia uses the optional glyphs U+F61C – U+F61D for the quadruple sharp / flat.
  11. haba in the 36- and 72-EDO tunings uses the optional glyphs U+F660 – U+F670.
  12. hesse uses the optional glyphs U+F606 – U+F60B for the degrees within the semitone.
  13. rhm uses the optional glyphs U+F600 – U+F605 for the degrees within the semitone.
  14. rhmk uses the optional glyphs U+F784 – U+F789 for the degrees within the semitone.
  15. om uses the optional glyphs U+F758 – U+F75F.
  16. msag uses the large double sharp U+E47D. Hence it is different from std even for 12-EDO.