Beyond MIDI: The Handbook of Musical Codes
MuseData utilizes character spacing of data within each line, since the meaning of many elements of the system are inferred from column placement. An 80-column row is assumed. The first character in each record uses a control key to identify the record type. There are currently 23 valid control keys. In alphabetical order they are:
2.1 Regular Note Records: Sound Information [A..G, r]
The most common type of record is the regular note or rest record. This is really the heart of the representation. This type of record can be identified by one of the seven key names A, B, C, D, E, F, G or the letter r (for rest) in Column 1. Complete sound information for pitch and duration is provided in Columns 1-9. Information pertaining to printing and interpretation is stored in Columns 13-80. Columns 10-12 are always left blank.
A. Pitch Information [Columns 1-4]
Pitch notation requires three parameters pitch name (A . . G), chromatic inflection (sharp, flat, natural), and octave number. The first and third parameters are given explicitly for every note in MuseData. Chromatic (or enharmonic) inflection is also explicit for every note, because this facilitates accurate conversion to sound information. The complete pitch specification given in Columns 1-4 is thus of variable length, taking only two columns if there is no altered chromatic inflection. Pitch name is specified in Column 1 by the relevant capital letter (A..G) or an r for a rest.
Chromatic inflection is indicated in Columns 2-3. The codes are # (sharp), ## (double sharp), f (flat), and ff (double flat). Naturals are never indicated here; when graphically necessary, they are signalled by a flag in Column 19 (actual notated accidental).
An octave number in the range 0..9 is given in Column 2, 3, or 4 as the final element of the pitch specification. Middle C initiates Octave 4, the next higher octave is Octave 5, and the next lower octave is Octave 3. Thus Middle C = C4, while Bf3 (A#3) is the whole step below it. The whole step above it may be designated as D4 (also as C##4 and Eff4). The maximum range in current use extends from Cff0 to B##9.
B. Duration Information [Columns 6-9]
Duration is specified in units called divisions. The number of divisions per quarter note is specified initially in a musical attribute record. The number of these divisions pertaining to the note or rest is specified, with right justification, in Columns 6-8. If a quarter note has four divisions, a sixteenth note will have one division. Column 9 is reserved for a tie flag (-), which is appended to the initiating note.
Duration means the complete logical duration of a pitch as opposed to the shortened or articulated duration that might be appropriate in a sound file. When the notated duration of a pitch is different from the intended duration, it is the intended duration that is represented. This favors appropriate results in the conversion to a sound file.
From the data in Columns 1 to 9 it is possible to construct sound output of the musical part. Here is the score for a common children's folk song ("Three Blind Mice"), in which each quarter note has two divisions:
C. Chords [" "]
A regular note may be followed by additional chord tones. A chord is thus made up of one regular note and one or more extra chord notes. The control key for an extra chord note is a blank space (" "). The format for this type of record is as follows:
N.B. If the duration field (Columns 6-8) is blank, it is understood that the extra chord note has the same duration as the regular note. The duration of the extra notes need not be the same as that of the regular note, but must not exceed that of the regular note. If all durations in the chord are the same, the pitches may be encoded in any order; any of the pitches may be encoded as the regular note. For purposes of analysis, it is possible to assign different notes of a chord to different tracks (Column 15).
D. Cue Notes and Grace Notes [c, g]
There are three types of small-size notes: small-size regular notes (treated as explained above), cue notes, and grace notes. Small-size regular notes and cue notes line up timewise with regular notes in a score, whereas grace notes have space of their own and are attached to a following regular note or to the end of a measure. Small size regular notes should be used to represent accompaniments and other musical material which is intended to be played. Cue notes should be used to represent notes that show in one part what is going on in another part or to represent a variant to regular notes.
An instrumental cadenza, expressed as small notes in a score and executed essentially in free time, would probably be represented with grace notes. If, on the other hand, the cadenza extended for several measures and were executed basically in measured time, it would probably be represented with regular notes, at either small or full size.
The control keys for grace notes and cue notes are g and c respectively. The formats for these records are as follows:
Grace notes and cue notes may include extra chord tones. In this case the same keys g and c are used as control keys but the records have the following formats:
2.2 Regular Note Records: Graphic and Interpretive Information
All remaining columns (13-80) are related to information pertinent to printing and data interpretation. A blank in any column reserved for a specific purpose means that no information is required. Columns 10-12 are also left blank.
A. Footnote, Level, and Track Information [Columns 13-15]
These columns are used as follows:
Where more than one musical line is represented in a printed part, it is essential for purposes of analysis to know for each note (or chord) the musical line or track to which the note belongs. In some cases this is interpretive information, provided as a service by the encoder in Column 15. Column 16 is left blank. Columns 17 to 43 extend the information given in Columns 1 9 with details about the notation of the pitch and duration. Occasionally this information will conflict with the information in Columns 1 to 9, since it is concerned with attributes related to correct printing, analysis, and interpretation.
B. Graphic Note Type [Column 17]
The graphic note types, ranging from a long (longa) to a 256th note, and their full- and cue-size codes, are shown in the following listing:
C. Dots of Prolongation [Column 18]
D. Actual Notated Accidentals [Column 19]
Although all pitches are given explicitly in Columns 1-4, accidentals are signalled by a flag in Column 19. The codes are these:
E. Time Modification [Columns 20-22]
Two digits, separated by a colon (:), are used to indicate unusual durational relationships. For standard cases, such as triplets (3:2), the colon and the second digit are usually omitted. The numbers 10-35 are represented by the letters A-Z.
F. Stem Direction and Staff Assignment [Columns 23-24]
Stem direction is indicated explicitly in Column 23 for every note with the following codes:
G. Beam Codes [Columns 26-31]
Codes for as many as six concurrent beams (through the 256th-note level) can be represented by concatenating the follow codes:
H. Additional Notations [Columns 32-43]
Discrepancies between content originating with a composer and that provided by an editor or encoder can be differentiated in the encoding scheme through the use of a wide range of codes in Columns 32-43. The character & in any of these columns, followed by a digit (1..9, A..Z), is used to indicate a specified editorial level. All codes to the left of the first & belong to the lowest (least edited) editorial level.
The following codes, which have been chosen for representing common elements of musical notation for Western music from the sixteenth through the nineteenth centuries, are somewhat arbitrary, since the encoding scheme is not complete and may be augmented and/or altered to meet the special requirements of the music being encoded.
1. Ties, Slurs, and Tuplets.
The following codes extend the representation of ties, slurs, and tuplets:
The designations slur1, slur2, slur3, and slur4 are arbitrary. It is possible for slurs to overlap timewise in a part (e.g., in piano music) and therefore necessary to have several open-slur, close-slur pairs available. Tuple numbers are not printed unless specified by an asterisk (*) in the first record of the group and an exclamation point (!) in the last record of the group.
The following codes are used for ornaments:
3. Technical Indications.
Performance information for string and keyboard instruments is represented as follows:
4. Articulations and Accents.
The following codes are used for articulations and accents:
Accidentals on ornaments, for which the codes are listed below, must follow directly after the ornament code:
5. Other Indications and Codes.
I. Text Underlay [Columns 44-80]
In Columns 44-80 multiple lines of text may be set off by the verticule (|) character. For the carol "Deck the Halls with Boughs of Holly," which has three verses, the text for the first note would be indicated as Deck|See|Fast.
J. Information not Represented
All graphical information described in preceding sections can be represented in MuseData using print suggestion records, which are discussed in a later section. In most cases, however, this is not necessary. Intelligent software can deduce this type of information correctly most of the time. Print suggestions are generally reserved for those cases where software might not place graphical elements correctly.
Other than specifying basic pitch and duration, regular note records contain no specific sound information. Dynamics (ff, pp, etc.) are encoded but not quantified. Ornaments are specified, but their execution is not. Articulation information is present in the form of slurs, dots, etc., but no quantitative information is given. MuseData does provide a means for including specific information for sound realization, but this information takes the form of suggestions and is not considered part of the primary data (see section on sound records below).
2.3 Other Record Types
The creation of scores from parts inevitably involves the coordination of parts at every turn. Certain situations involve an additional level of interdependency. For example, in the figuration of a basso continuo part (represented by a stream of numbers that represent possible harmonic realizations), each figure relates to a particular note but not necessarily in a 1:1 manner. One harmony may extend over several notes; several harmonies may occur in conjunction with one note; some tones within the realization may be sustained while others are changed, and so forth. A similar degree of complexity can pertain to parts that are sometimes combined and sometimes divided, e.g., the Oboe I/Oboe II situations discussed in preceding sections.
A. Basso Continuo Figuration [f]
The MuseData system supports the representation of numerals and other cyphers for basso continuo figuration with a record that uses the control key f. The format is as follows:
Figures take their position from the first regular note that follows the figure record(s). In the case where the figures change during the duration of a note, the advancing parameter (Columns 6-8) is used to indicate the elapsed time between changes. In the case where a figure appears after a note has sounded, the blank space is used as a place holder to advance the figure division pointer.
The figure fields are set off by one or more blanks. Figure numbers may extend from 1 to 19. They may be prefixed by the characters #, n, f, and x. They may be followed by the suffixes #, n, f, +, \, and x. The #, n, f, and x signs may stand alone as figures. A b indicates a blank figure. This is used as a place holder in a list and also to start a continuation line with no figure. The first figure field is for the top of the figure list. For example, in the figure list:
6 #4 2the 6 would be represented in the first field.
The figures, signs, and modifiers are these:
B. Combined/Divided Parts [b, i]
In order to represent two musical parts simultaneously on one staff, and also to represent music on the grand staff (keyboard music) in a single data file (i.e., as a single musical part), it is necessary for the representation to have a backup command. This command essentially subtracts a specified number of divisions from the division counter in a measure, thereby allowing simultaneous musical tracks to be represented.
If it is possible to decrease the division counter by means of the backup command, then we must also have a means for increasing it without printing a rest. This is accommodated with an invisible rest record type. The control keys for these commands are b and i respectively. The format is as follows:
The final length of a measure (in divisions) is given by the furthest extent of the division counter. It is good encoding practice to advance the division counter to the end of the measure, if it is not already there when the final note in the measure has been encoded.
C. Measure Lines [m]
Measure breaks (also measure lines or bar lines) have their own record type in MuseData. The control key is m, and the format is as follows:
Bar lines are divided into two types controlling and non-controlling. These are defined as follows:
D. Generalized Musical Directions [*]
Musical directions which are not attached to specific notes such things as rehearsal numbers, text instructions, crescendos and diminuendos, dynamics, piano pedal indications, and octave transpositions have their own record type. The control key is *, and the format is as follows:
Example 2. f <decreasing wedge> p
Example 3. <increasing wedge> p
Direction types (Columns 17-18) are specified by a one- or two-letter code. Currently used direction types are these:
E. Mixed Fonts and Text Diacritical Marks
In the verbal markings of a musical score or part it is occasionally necessary to change a font in the middle of an ASCII string. For example, the direction più f might call for the word più to be in italics and the sign f to be the forte character from the music font.
This example also illustrates the necessity of being able to represent accents and other diacritical marks over letters. Since the ASCII character set is reliable only for seven-bit values in the range of 32 to 127, we must use an escape sequence to represent these other characters. We use the backslash character to initiate the sequence. This is followed by a number, and then by the letter being affected. The table below shows the escape sequences for various letter/diacritical mark combinations. All combinations except \2s also apply to capital letters.
Because it is sometimes hard to remember whether the number or the letter comes first after the back- slash escape character (\), we have defined the sequences both ways: \1n = \n1; \1o = \o1; \2s = \s2; etc. The back-slash character itself is represented by two back-slashes (\\).
F. Comments [@, &]
There are two ways to include comments in a MuseData file. They are (1) with a single line comment, initiated by the control key @, or (2) with the comment toggle switch, indicated by the control key &.
G. Record Length Extender [a]
Although the normal maximum length of a MuseData record is 80 columns, if more columns are needed, these may be added with a continuation record, whose control key is a. This means to append the current line to the previous line.
H. The End-of-File Record [/]
The end of musical data and the end of a file are specified by an end-type record, whose control key is /. The format is as follows:
I. Print Suggestion Records [P]
Suggestions for printing that may be ignored by the user without jeopardizing the logical coherence of the music are called print suggestion records. Print suggestions concern such matters as positioning of beams and slurs, orientation of ties, local positioning of notes to avoid collisions with other objects, and other matters requiring prioritization or accommodation in a particular graphic context. The control key is P and the various formats are explained below.
A print suggestion record can follow any record that contributes to the printed output of the music. This includes musical directions, bar lines, regular notes and rests, extra notes in a regular chord, grace notes and cue notes, extra grace/cue notes in a chord, and figured harmony.
Print suggestions use a multiple-field system. Each field is introduced by a capital C, followed immediately by a number and a colon, e.g., C8: or C23:. The data following this designation (all columns up to the next field or to the end of the record) will apply to the item in the specified column of the previous (non-sound) record. A print suggestion which has a code C0: is a general suggestion and is not related to any specific column in a previous record. At the present time, we can offer print suggestions in the following situations:
J. Sound Records [S]
Sound records are used for communicating suggestions for compiling sound (MIDI) files. The control key is S and the various formats are explained below.
A sound record can follow any record that produces a sound or influences time in some way. This includes regular notes and rests, extra notes in a regular chord, grace notes and cue notes, extra grace/cue notes in a chord, and figured harmony.
Sound information can be given for a variety of attributes connected with a note. Since sound directions may apply to a wide variety of musical attributes, e.g., the attack and dynamic envelope of a note, the time of attack and length of a note (or rest), and directions for performing ornaments, it makes sense to use a multiple-field system, similar to the one used for print suggestions.
To illustrate this with an example, suppose in the previous note record there were a trill indicated by a t in Column 33. In this case we would use C33: in a sound record to introduce information on how that trill should be executed in a sound file. Of course, each ornament or pitch or duration will have a different set of needs regarding its sound specification. At the present time, sound information can be provided for the following situations: