SourceForge.net Logo

2.3. The MusicData element

The MusicData element is just a collection of different objects, mainly Notes and Rests, but also other elements, such as Clefs or KeySignatures, are possible.

[12]MusicData::= { Note | Rest | Chord | Clef | KeySignature | TimeSignature | Barline | Other }*  

Examples:

Single note:
(musicData (n c4 q))

C major scale:
(musicData (n c4 q)(n d4 q)(n e4 q)(n f4 q)(n g4 q)(n a4 q)(n b4 q)(n c5 q))

Short fragment with a measure:
(musicData (clef treble)(key C)(time 2 4)(n c4 q)(n e4 q)(n g4 q)(n c5 q)(barline))

2.3.1. The Clef element

Setting or changing the clef is done with the clef element:

[13]MusicData::= (clef ClefName [Tessitura] [noVisible] )  
[14]Tessitura::= { +8va | -8va | +15ma | -15ma }  

The tessitura implied by a clef can be modified by including a tessitura option, that will draw a 8va or 15ma symbol above (+8va, +15va) or below (-8va, -15ma) the clef, and force the corresponding octave shift. The tessitura option is only usable with G and F clefs.

[Warning]Warning
Tessitura option is not yet supported.

Examples:

(clef G)            G clef
(clef bass)         F clef
(clef treble +8va)  G clef with 8va symbol above

Valid clef names are described in the following table:

ClefNameMeaning
treble, G, G2, violinG clef on 2nd line
bass, F, F4F clef on 4th line
baritone, F3F clef on 3rd line
soprano, C1C clef on 1st line
mezzosoprano, C2C clef on 2nd line
alto, C3C clef on 3rd line
tenor, C4C clef on 4th line
percussionPercussion clef

2.3.2. The Key element

Setting or changing the key signature is done with the key element:

[15]KeySignature::= (key KeyName [noVisible] )  

Examples:

(key F+)           F sharp major key
(key f+)           F sharp minor key
(key d-)           D flat minor key
(key C)            C major key

Valid values for tag KeyName are described in the following table:

KeyNameKey signatureKeyNameKey signature
CC majoraA minor
GG majoreE minor
DD majorbB minor
AA majorf+F sharp minor
EE majorc+C sharp minor
BB majorg+G sharp minor
F+F sharp majord+D sharp minor
C+C sharp majora+A sharp minor
C-C flat majora-A flat minor
G-G flat majore-E flat minor
D-D flat majorb-B flat minor
A-A flat majorf-F flat minor
E-E flat majorc-C flat minor
B-B flat majorg-G flat minor
FF majord-D flat minor

2.3.3. The Time Signature element

Setting or changing the time signature is done with the TimeSignature element:

[16]TimeSignature::= (time TopNumber BottomNumber [noVisible] )  

Examples:

(time 2 4)
(time 3 8)
(time 5 8)

2.3.4. The Barline element

Element 'barline' is used to specify a barline at the end of a measure. You can specify a barline to be 'invisible' (that is, it will not be rendered). If the type of barline is not specified it is assumed to be a normal barline (simple line).

[17]Barline::= { (barline [ BarlineType ] [ noVisible ] ) | BarlineSign }  
[18]BarlineType::= { simple | double | end | start | startRepetition | endRepetition | doubleRepetition }  
[19]BarlineSign::= { | | || | |] | [| | :| | |: | :: }  

To abbreviate writing barlines the Barline element can be either a full element or a graphical sign (as in abc language).

Example:

(n c4 e)(n e4 e)(barline end)
nc4e ne |]