Copyright © 2007 , 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. 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 makes it very easy and flexible to author an LAML song text. One of these, M-x make-chords, creates the initial chords file, with the overall markup. Two specialized embedding commands, M-x embed-in-chord (bound to C-x C-e ) and M-x x-embed-in-chord (bound to C-x C-x ) makes it handy to embed a word or phrase in a chord (with or without the x attribute).
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.
It is also possible to use the font-size attribute to adjust the font size. I 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 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 song-front-matters.
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 A particular chord. |
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-title | The song title |
song-verses | A container around individual song verses |
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 ? ) | ||
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). | |
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 | |
![]() ![]() ![]() 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 )* | ||
See also | enclosing element | verse | |
![]() ![]() ![]() 3 Chords | |||
In this section we document the 12 main chords. 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 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. Can also appear alone without contents. | ||
XML content model | (#PCDATA) | ||
XML attributes Required: * Default values: red | x | CDATA | Some extra 'abstraction' of this chord. Such as 7,6,dim,... |
See also | enclosing element | line | |
cs | |||
Description | C sharp. A particular chord. Can surround one of more words in the song. Can also appear alone without contents. | ||
XML content model | (#PCDATA) | ||
XML attributes Required: * Default values: red | x | CDATA | Some extra 'abstraction' of this chord. Such as 7,6,dim,... |
See also | enclosing element | line | |
d | |||
Description | A particular chord. Can surround one of more words in the song. Can also appear alone without contents. | ||
XML content model | (#PCDATA) | ||
XML attributes Required: * Default values: red | x | CDATA | Some extra 'abstraction' of this chord. Such as 7,6,dim,... |
See also | enclosing element | line | |
eb | |||
Description | E minor. A particular chord. Can surround one of more words in the song. Can also appear alone without contents. | ||
XML content model | (#PCDATA) | ||
XML attributes Required: * Default values: red | x | CDATA | Some extra 'abstraction' of this chord. Such as 7,6,dim,... |
See also | enclosing element | line | |
e | |||
Description | A particular chord. Can surround one of more words in the song. Can also appear alone without contents. | ||
XML content model | (#PCDATA) | ||
XML attributes Required: * Default values: red | x | CDATA | Some extra 'abstraction' of this chord. Such as 7,6,dim,... |
See also | enclosing element | line | |
f | |||
Description | A particular chord. Can surround one of more words in the song. Can also appear alone without contents. | ||
XML content model | (#PCDATA) | ||
XML attributes Required: * Default values: red | x | CDATA | Some extra 'abstraction' of this chord. Such as 7,6,dim,... |
See also | enclosing element | line | |
fs | |||
Description | F sharp. A particular chord. Can surround one of more words in the song. Can also appear alone without contents. | ||
XML content model | (#PCDATA) | ||
XML attributes Required: * Default values: red | x | CDATA | Some extra 'abstraction' of this chord. Such as 7,6,dim,... |
See also | enclosing element | line | |
g | |||
Description | A particular chord. Can surround one of more words in the song. Can also appear alone without contents. | ||
XML content model | (#PCDATA) | ||
XML attributes Required: * Default values: red | x | CDATA | Some extra 'abstraction' of this chord. Such as 7,6,dim,... |
See also | enclosing element | line | |
gs | |||
Description | G sharp. A particular chord. Can surround one of more words in the song. Can also appear alone without contents. | ||
XML content model | (#PCDATA) | ||
XML attributes Required: * Default values: red | x | CDATA | Some extra 'abstraction' of this chord. Such as 7,6,dim,... |
See also | enclosing element | line | |
a | |||
Description | A particular chord. Can surround one of more words in the song. Can also appear alone without contents. | ||
XML content model | (#PCDATA) | ||
XML attributes Required: * Default values: red | x | CDATA | Some extra 'abstraction' of this chord. Such as 7,6,dim,... |
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. Can also appear alone without contents. | ||
XML content model | (#PCDATA) | ||
XML attributes Required: * Default values: red | x | CDATA | Some extra 'abstraction' of this chord. Such as 7,6,dim,... |
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. Can also appear alone without contents. | ||
XML content model | (#PCDATA) | ||
XML attributes Required: * Default values: red | x | CDATA | Some extra 'abstraction' of this chord. Such as 7,6,dim,... |
See also | enclosing element | line | |
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 |