SourceForge.net Logo

2.2. The Instrument element

An Instrument is a collection of one or more staves (i.e., grand-staff) describing the music.

[7]Instrument::= (instrument [Name [Abbreviation]] [FirstSystemIndent] [MIDI_Info] [Staves] MusicData )  
[8]Name::= (name TextString [Font] [Location] )  
[9]Abbreviation::= (abbrev TextString [Font] [Location] )  
[10]FirstSystemIndent::= x relative location  

Instruments have usually a name. Optionally, also an abbreviated name; in these cases the name will be used at the start of the first system, and the abbreviation for succeeding systems.

The musical content is described by MusicData elements. Polyphony is possible, as notes, rests and other elements can be assigned to different voices. Any voice can move across all staves of the instrument.

Examples: Two instruments, first one on single staff and second with two staves (grand-staff):

(instrument (name "Flute") (musicData ...))
(instrument (staves 2)(name "Piano") (musicData ...))

By default, the instrument will use a 5-line staff. This can be modified using the Staves element, which describes the type and layout of the staves to use for the instrument:

[11]Staves::= (staves {num | overlayered }  

For now the Staves element is just the number of five lines staves to use. One is the default value if no 'Staves' element is specified. For Grand-staff 2 must be coded. In future versions additional options will be included to allow for a full description of any type of desired staff layout.

Instead of a number the keyword overlayered can be used. This is useful for those cases in which it is required than multiple instruments share the same staff. Percussion parts or piano reduction scores are examples of these cases.

[Warning]Warning
Command overlayered is not yet implemented:

If the instrument name is specified, the first system is automatically indented to print it. If no name specified or if you desire a different indentation space, it is possible to specify the desired indentation by using an x displacement element. If relative units are specified (tenths) it will be always assumed than they refer to first staff.

Examples:

First system indentation: 20mm and name 'Flute' in this space:
    (instrument name="Flute" (dx 20mm)(musicData ...))

First system indentation: 20mm and no name
    (instrument (dx 20mm)(musicData ...))