Copyright © 2011 , Kurt Nørmark | ![]() |
This is the manual of the LAML chords song format, which is based on a simple XML DTD. In this format it is possible to carry out simple chords markup of a song text. This includes chord decorations and and chord inversions (by means of a given bass note). The song document is an XML-in-LAML document. In other words, the song source complies with an XML DTD, but it is written as a Scheme/Lisp expression, which uses mirror functions that correspond to the XML elements of the chords.dtd.
The song format is supported by a few Emacs commands, which make it convenient and flexible to author an LAML song text via the Emacs text editor. One of these, M-x make-chords, creates the initial chords file, with the overall markup. A number of specialized embedding commands, M-x embed-in-chord (bound to C-x C-e ), M-x x-embed-in-chord (bound to C-x C-x ), M-x b-embed-in-chord (bound to C-x C-b ), and M-x x-b-embed-in-chord (bound to C-x B ) make it handy to embed a word or phrase in a chord (with or without additional attributes).
As a slightly advanced feature, the LAML chords processor is able to transpose a song, via use of the transpose attribute of the song-front-matters element. The transposition also affects the bass note of chord inversions.
It is also possible to use the font-size attribute to adjust the font size. You can use this attribute to ensure that a song text fits a single page. You can also adjust the indentation to fit your preferences via use of the indentation attribute. Finally, you can color the chords by using the chord-color attribute.
It may be useful to consult the LAML chords examples.
Seen from the context of LAML, the LAML Chords facility serves as a simple example of my personal use of LAML within the area music notation (keyboard/MIDI).
For chord presentation purposes, we support a number of variations. See the attributes h-hame, cs-or-db, ds-or-eb, fs-or-gb, gs-or-ab, and as-or-hb of the song-front-matters element.
a | A particular chord. |
c | A particular chord. |
cs | C sharp. |
d | A particular chord. |
e | A particular chord. |
eb | E minor. |
f | A particular chord. |
fs | F sharp. |
g | A particular chord. |
gs | G sharp. |
h | H, also often notated as B. |
hb | H flat, also known as B flat. |
line | A line of song verse. |
song | The top level element. |
song-author | The author/composer of the song |
song-front-matters | This element defines a number of parmeters and processing options of this song. |
song-source | The book or internet address, which describes the origin of the song and/or the chords of the song. |
song-title | The song title |
song-verses | A container around individual song verses |
unison | Play without chords. |
verse | A container around the lines of the song |
![]() ![]() ![]() 1 Song and song-front-matters | |||
In this section we document the song and the song-front-matters elements. | |||
song | |||
Description | The top level element. Notice that it is possible to inore this element, and hereby to leave song-front-matters and song-verses as top-level elements. | ||
XML content model | ( song-front-matters , song-verses * ) | ||
song-front-matters | |||
Description | This element defines a number of parmeters and processing options of this song. | ||
XML content model | ( song-title ? , song-author ? , song-source ? ) | ||
XML attributes Required: * Default values: red | transposition | CDATA | The number of half tone steps for transposition. An integer number between -11 and 11 |
indentation | CDATA | The indentation of the song. An integer, denoting pixels | |
font-size | CDATA | The font size used for the song text. A percentage. 100 means normal size. | |
compact-lines | ( true | false ) | A boolean value that controls the line compactness. The value true does not give nice results in MS Internet Explorer. (I do not know why). | |
rendering-mode | ( normal | simple ) | Either normal or simple. In simple mode, chords with the o attribute valued "t" are not shown. The o attribute is short for optional. "t" and "f" are short for true or false respectively. | |
chord-color | CDATA ( black ) | The Color used for the chords. Must be a color value acceptable by CSS | |
h-name | ( h | H | B | b ) | Controls the presentation of the chord name H. H and h are aliases for each other. Similarly, B and b are aliases for each other. | |
cs-or-db | ( cs | db ) | Controls the presentation of the chord which internally is notated cs (C sharp) | |
ds-or-eb | ( ds | eb ) | Controls the presentation of the chord which internally is notated eb (B flat) | |
fs-or-gb | ( fs | gb ) | Controls the presentation of the chord which internally is notated fs (F sharp) | |
gs-or-ab | ( gs | ab ) | Controls the presentation of the chord which internally is notated gs (G sharp) | |
as-or-hb | ( as | hb ) | Controls the presentation of the chord which internally is notated hb (H sharp) | |
See also | enclosing element | song | |
song-verses | |||
Description | A container around individual song verses | ||
XML content model | ( verse * ) | ||
See also | enclosing element | song | |
song-title | |||
Description | The song title | ||
XML content model | (#PCDATA) | ||
See also | enclosing element | song-front-matters | |
song-author | |||
Description | The author/composer of the song | ||
XML content model | (#PCDATA) | ||
See also | enclosing element | song-front-matters | |
song-source | |||
Description | The book or internet address, which describes the origin of the song and/or the chords of the song. | ||
XML content model | (#PCDATA) | ||
See also | enclosing element | song-front-matters | |
![]() ![]() ![]() 2 Verse and line | |||
Below we describe the verse and line elements | |||
verse | |||
Description | A container around the lines of the song | ||
XML content model | ( line ) * | ||
XML attributes Required: * Default values: red | n | CDATA | The verse number - an integer. It not supplied, no verse numering appears |
chords | ( true | false ) | A boolean attribute that controls if chords are shown for this verse. Chords can - of course - only be shown if they appear in the markuped song text. | |
See also | enclosing element | song-verses | |
line | |||
Description | A line of song verse. Individual words can be embedded in one of the chords elements. | ||
XML content model | (#PCDATA | a | c | cs | d | e | eb | f | fs | g | gs | h | hb | unison )* | ||
See also | enclosing element | verse | |
![]() ![]() ![]() 3 Chords | |||
In this section we document the 12 main chords. We also include the unison form. In chord markup the suffix s, such as in cs, means 'sharp'. Similarly, the suffix b, such as in eb, means 'minor'. We use the name 'h' for the chord, which sometimes (and perhaps more often) called b. We support a number of auxiliary functions, which act as conveninent shortcuts for some often used chord abstractions. These are cm, c7, c6, and cm7, and similar functions for the other main chords. In addition, the chord named db can be used as an alias of cs; ds can be used as an alias of eb; gb can be used as an alias of fs; ab can be used as an alias of gs; And as can be used as an alias of hb. The abstractions, such as db7, db6, dbm, and dbm7 are also availble. | |||
c | |||
Description | A particular chord. Can surround one of more words in the song. The attributes names are very short, in order not to end up with very long verse lines. This form Can also appear alone without any textual contents. | ||
XML content model | (#PCDATA) | ||
XML attributes Required: * Default values: red | x | CDATA | Some extra 'abstraction' of this chord. Such as 7,6,dim,... |
b | ( c | cs | d | eb | e | f | fs | g | gs | a | hb | h ) | The bass note of this chord | |
o | ( t | f ) | If t this chord is optional. t means true and f means false. The default value is f. Optional notes are not shown in simple rendering mode. | |
See also | enclosing element | line | |
cs | |||
Description | C sharp. A particular chord. Can surround one of more words in the song. The attributes names are very short, in order not to end up with very long verse lines. This form Can also appear alone without any textual contents. | ||
XML content model | (#PCDATA) | ||
XML attributes Required: * Default values: red | x | CDATA | Some extra 'abstraction' of this chord. Such as 7,6,dim,... |
b | ( c | cs | d | eb | e | f | fs | g | gs | a | hb | h ) | The bass note of this chord | |
o | ( t | f ) | If t this chord is optional. t means true and f means false. The default value is f. Optional notes are not shown in simple rendering mode. | |
See also | enclosing element | line | |
d | |||
Description | A particular chord. Can surround one of more words in the song. The attributes names are very short, in order not to end up with very long verse lines. This form Can also appear alone without any textual contents. | ||
XML content model | (#PCDATA) | ||
XML attributes Required: * Default values: red | x | CDATA | Some extra 'abstraction' of this chord. Such as 7,6,dim,... |
b | ( c | cs | d | eb | e | f | fs | g | gs | a | hb | h ) | The bass note of this chord | |
o | ( t | f ) | If t this chord is optional. t means true and f means false. The default value is f. Optional notes are not shown in simple rendering mode. | |
See also | enclosing element | line | |
eb | |||
Description | E minor. A particular chord. Can surround one of more words in the song. The attributes names are very short, in order not to end up with very long verse lines. This form Can also appear alone without any textual contents. | ||
XML content model | (#PCDATA) | ||
XML attributes Required: * Default values: red | x | CDATA | Some extra 'abstraction' of this chord. Such as 7,6,dim,... |
b | ( c | cs | d | eb | e | f | fs | g | gs | a | hb | h ) | The bass note of this chord | |
o | ( t | f ) | If t this chord is optional. t means true and f means false. The default value is f. Optional notes are not shown in simple rendering mode. | |
See also | enclosing element | line | |
e | |||
Description | A particular chord. Can surround one of more words in the song. The attributes names are very short, in order not to end up with very long verse lines. This form Can also appear alone without any textual contents. | ||
XML content model | (#PCDATA) | ||
XML attributes Required: * Default values: red | x | CDATA | Some extra 'abstraction' of this chord. Such as 7,6,dim,... |
b | ( c | cs | d | eb | e | f | fs | g | gs | a | hb | h ) | The bass note of this chord | |
o | ( t | f ) | If t this chord is optional. t means true and f means false. The default value is f. Optional notes are not shown in simple rendering mode. | |
See also | enclosing element | line | |
f | |||
Description | A particular chord. Can surround one of more words in the song. The attributes names are very short, in order not to end up with very long verse lines. This form Can also appear alone without any textual contents. | ||
XML content model | (#PCDATA) | ||
XML attributes Required: * Default values: red | x | CDATA | Some extra 'abstraction' of this chord. Such as 7,6,dim,... |
b | ( c | cs | d | eb | e | f | fs | g | gs | a | hb | h ) | The bass note of this chord | |
o | ( t | f ) | If t this chord is optional. t means true and f means false. The default value is f. Optional notes are not shown in simple rendering mode. | |
See also | enclosing element | line | |
fs | |||
Description | F sharp. A particular chord. Can surround one of more words in the song. The attributes names are very short, in order not to end up with very long verse lines. This form Can also appear alone without any textual contents. | ||
XML content model | (#PCDATA) | ||
XML attributes Required: * Default values: red | x | CDATA | Some extra 'abstraction' of this chord. Such as 7,6,dim,... |
b | ( c | cs | d | eb | e | f | fs | g | gs | a | hb | h ) | The bass note of this chord | |
o | ( t | f ) | If t this chord is optional. t means true and f means false. The default value is f. Optional notes are not shown in simple rendering mode. | |
See also | enclosing element | line | |
g | |||
Description | A particular chord. Can surround one of more words in the song. The attributes names are very short, in order not to end up with very long verse lines. This form Can also appear alone without any textual contents. | ||
XML content model | (#PCDATA) | ||
XML attributes Required: * Default values: red | x | CDATA | Some extra 'abstraction' of this chord. Such as 7,6,dim,... |
b | ( c | cs | d | eb | e | f | fs | g | gs | a | hb | h ) | The bass note of this chord | |
o | ( t | f ) | If t this chord is optional. t means true and f means false. The default value is f. Optional notes are not shown in simple rendering mode. | |
See also | enclosing element | line | |
gs | |||
Description | G sharp. A particular chord. Can surround one of more words in the song. The attributes names are very short, in order not to end up with very long verse lines. This form Can also appear alone without any textual contents. | ||
XML content model | (#PCDATA) | ||
XML attributes Required: * Default values: red | x | CDATA | Some extra 'abstraction' of this chord. Such as 7,6,dim,... |
b | ( c | cs | d | eb | e | f | fs | g | gs | a | hb | h ) | The bass note of this chord | |
o | ( t | f ) | If t this chord is optional. t means true and f means false. The default value is f. Optional notes are not shown in simple rendering mode. | |
See also | enclosing element | line | |
a | |||
Description | A particular chord. Can surround one of more words in the song. The attributes names are very short, in order not to end up with very long verse lines. This form Can also appear alone without any textual contents. | ||
XML content model | (#PCDATA) | ||
XML attributes Required: * Default values: red | x | CDATA | Some extra 'abstraction' of this chord. Such as 7,6,dim,... |
b | ( c | cs | d | eb | e | f | fs | g | gs | a | hb | h ) | The bass note of this chord | |
o | ( t | f ) | If t this chord is optional. t means true and f means false. The default value is f. Optional notes are not shown in simple rendering mode. | |
See also | enclosing element | line | |
hb | |||
Description | H flat, also known as B flat. A particular chord. Can surround one of more words in the song. The attributes names are very short, in order not to end up with very long verse lines. This form Can also appear alone without any textual contents. | ||
XML content model | (#PCDATA) | ||
XML attributes Required: * Default values: red | x | CDATA | Some extra 'abstraction' of this chord. Such as 7,6,dim,... |
b | ( c | cs | d | eb | e | f | fs | g | gs | a | hb | h ) | The bass note of this chord | |
o | ( t | f ) | If t this chord is optional. t means true and f means false. The default value is f. Optional notes are not shown in simple rendering mode. | |
See also | enclosing element | line | |
h | |||
Description | H, also often notated as B. A particular chord. Can surround one of more words in the song. The attributes names are very short, in order not to end up with very long verse lines. This form Can also appear alone without any textual contents. | ||
XML content model | (#PCDATA) | ||
XML attributes Required: * Default values: red | x | CDATA | Some extra 'abstraction' of this chord. Such as 7,6,dim,... |
b | ( c | cs | d | eb | e | f | fs | g | gs | a | hb | h ) | The bass note of this chord | |
o | ( t | f ) | If t this chord is optional. t means true and f means false. The default value is f. Optional notes are not shown in simple rendering mode. | |
See also | enclosing element | line | |
unison | |||
Description | Play without chords. Of typographical reasons it is recommended to use this form on a single word, although it logically apply to a longer phrase of a song line. | ||
XML content model | (#PCDATA) | ||
See also | enclosing element | line | |
![]() ![]() ![]() 4 Emacs Support | |||
In this section we describe the Emacs support for use of the LAML Chords facility. The names of basic chords mirror functions in Scheme are c, cs, d, eb, e, f, fs, g, gs, a, hb, h. These are documented above. These functions are, of course, supported by Emacs. The s in cs means 'sharp' (one half tone up), and the b in hb means flat (one half tone down). In addition, the following alternative chord names are supported: db (= cs), ds (= eb), gb (= fs), ab (= gs), and as (= hb). A number of additional, named mirror functions are derived automatically by the Chords Scheme software. These are CHORD-NAMEm for minor chords, CHORD-NAME7 for the seventh variation, CHORD-NAME6 for the sixth variation, and CHORD-NAMEm7 for the seventh minor variation, where CHORD-NAME is one of c, db, cs, d, ds, eb, e, f, gb, fs, g, ab, gs, a, as, hb, and h. Emacs supports all these names via completion in the chords embedding editing commands, see below. Many of these chord names translate to use of the x attribute with the the attribute value "m", "6", or "7". The following chord-embedding Emacs editing commands are supported:
These editing commands prompt for chord names, and they use completions to avoid simple typos. In addition to the chord embedding commands, the following chord-related editing command is supported:
| |||
Mirror name: | chords |
Automatic loading of common XML-in-LAML library? | No |
List of action elements | (song-front-matters song-verses) |
Generation of named mirror functions: | Yes |
Mirror name prefix: | None |
Transliteration of CDATA? | Yes |
List of elements for which transliteration does not apply: | '() |
List of elements for which all white spacing is preserved: | '() |
Name of HTML character transformation table: | html-char-transformation-table |
Are default DTD attributes passed explicitly? | No |
Are attributes only allowed to be text strings? | Yes |
Is extended textual contents allowed? | No |
Is white space represented by this mirror? | Yes |
How are duplicated XML attributes handled: | 'keep-all |