Description of the MUSDATA System for Representing Musical Scores with variable length ASCII Records We live today in what has been called the electronic age. Information, which previously was communicated primarily through printed materials, is now accessable in a variety of forms. The evolution of this process has been relatively straighforward. First, the printing process itself became automated. Then ways were developed to control this process electronically. It then became possible to store electronally the data that controlled the process. As standards developed for the form this data should take, it became possible to communicate the original information electronically, without having to make a printed copy first. With the development of the electronic display screen, printing (or the production of hardcopy, as we now refer to it) became just one option for the communication of information. This is a familiar story. But it is worth repeating, because in the case of communicating musical information, the process is not yet complete. Traditionally, musical information has been represented by a music score, through a process we call common musical notation (CMN). Beginning in the late 1950's experiments were conducted in the automation of this process (musical typewriter, etc.). In the mid 1960's, it was demonstrated that the information controlling the printing process could be stored as data (DARMS was one such early attempt to do this). The 1970's saw the beginning of several serious attempts to produce commercial grade music notation by computer. The advent of personal computing in the early 1980's brought with it several software programs to construct common musical notation on a display screen and to make printed copies of this notation. Yet, though all of this activity, no common standard has emerged for exchanging musical data between the various software programs. And without this standard, the process of representing music in the electronic age cannot be called complete. I believe there are two factors responsible for the absense of a music representation standard at this time. (1) The representation of the instructions for printing common musical notaion is fairly complex. Unlike text (and its satelites, e.g., numbers, in-line mathematical symbols, etc.), which can be represented by a one dimensional array of isomorphic codes (e.g., ASCII characters), common musical notation on the printed page is essentially a two dimensional representation. The meaning of a symbol, a quarter note for example, depends on its height relative to a set of staff lines, as well as its horizonal position along the staff lines. (2) The primary customer for most music printing software has the isolated user. As such, developers have concentrated on implementing those features which would give the user complete control of the process, from the initail entry of data to the final printing. The idea of separating these functions, so data entry could be done at one location by one group of people and printing could be done by a completely different group of people, did not seem to have much value in the fast growing and highly competitive market for this type of software. As a result, systems were developed that did not breakout or isolate an intermediate stage of electronic representation that was independent of the workings of the program itself. Every music printing program has built into it such a representation scheme, but this scheme (a) is closely tied to the way the program is written, and (b) is often consider secret and proprietary by the owners of the program. If one were to try to design a "software neutral" representation scheme, what would be some of its properties? This question has been asked many times and had been debated in many quarters. The answers seem to depend on applications that people envision for the representation. My task here is not to espouse a general solution to the representation problem based on some hierarchy of applications, but rather to explain the particular choices we have made in the design of our MUSDATA system. Nevertheless, I feel it is important to explain our system in the context of the larger question, because this question has been constant force in our decision process. We can identify four properties which define the corner stones of our philosophy of representation: flexibility, readability, versatility, and expandability. We regard our representation scheme as being very much like a computer programming language. Here is a list of similarities: (1) Our representation is organized as a set of files. Each file represents the music of a single part. Scores are represented as a collection of such files. (2) Files are organized as a set of time-ordered, variable length ASCII records. Just like a program, the order of the records is essential to the representation. (3) The first character in each record determines the nature and function of the record. The analogy in a computer program would be the computer instruction itself, (e.g., if, loop, print, etc.) (4) The attempt has been made to make the representation as logical and readable as possible (also an important feature in computer progamming languages.) (5) There is a provision for including comments in the representation We now begin a detailed description of MUSDATA. There are two major parts to this description: (1) how files are organized, and (2) how the specific elements of music are represented by the records in a file. We will begin with (2). Description of Records ---------------------- As noted in (3) above, column one of each reach record contains a key, which determines the purpose and format of the record. There are at the moment 23 valid keys. (This leaves 73 vacancies for adding new types of records to the representation, a significant factor in expandability). The most common type of record is the &dDregular note or rest&d@ record. This is really the heart of the representation. This type of record can be identified by one of the following eight keys: &dDA&d@,&dDB&d@,&dDC&d@,&dDD&d@,&dDE&d@,&dDF&d@,&dDG&d@, and &dDr&d@. The format for these records is as follows: Regular note/rest control key = A,B,C,D,E,F,G or r ---------------------------------------------------- &dDColumns 1 to 9&d@ contain precise information about pitch and duration. Pitch is specified by a capital letter, anywhere from zero to two sharps or flats, and an octave range number, 0 to 9. Duration is specified in units called divisions. The number of divisions per quarter note is specified in an earlier, "$" type record. Duration means the complete duration of a pitch, not a "shortened" or "articulated" duration. Duration also refers to the "intended" duration, not the "notated" duration of a pitch. (Bach, for example, often notated a long-short triplet pattern with a dotted eighth and sixteenth note. The "intended" duration in this case would be the long-short triplet pattern.) column 1-4: pitch or rest, Cff0 to B##9, C4 = middle C column 5: blank column 6-8: duration (right justified) column 9: tie flag ' ' = no tie '-' = tie From the data in columns 1 to 9, (i.e., pitch and duration), it is possible to construct aural output of the musical part. Columns 10-12: blanks columns 13-15: footnote and level information, track # column 13: footnote flag (blank = none) column 14: level number (optional) column 15: track number (optional) Where more that one musical line is represented in a part (e.g., Oboe I,II, or keyboard music), 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. column 16: blank &dDColumns 17 to 43&d@ contain information about the notation of the pitch and duration. As pointed out above, this information will sometimes conflict with the information in columns 1 to 9. columns 17-22: note description column 17: note type L,b,w,h,q,e,s,t,x,y,z (Longa to 256th note) column 18: dot flag ' ' = no dot '.' = single dot ':' = double dot column 19: actual accidental flag # = sharp X = sharp-sharp n = natural & = flat-flat f = flag S = natural-sharp x = double sharp F = natural-flat columns 20-22: designation of time modification Two digits, separated by a colon (:) 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. column 23: stem direction d = down u = up ' ' = no stem column 24: staff number (' ' = 1) Used in the case of music represented on more than one staff. column 25: blank column 26-31: beams (up to six levels = 256th note) [ = start beam = = continue beam ] = end beam / = forward hook \ = backward hook column 26 is for eighth beams, 27 for sixteenth, ... columns 32-43: other notations Codes are read from left to right. The character "&", 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 editorial level (least edited). The following codes are somewhat arbitrary. They have been chosen for representing common musical notation for Western music from the 16th through the 19th centuries. The encoding scheme is not complete and may be augmented and/or altered to meet the special requirements of the music being encoded. Ties, Slurs, Tuples The designations, slur1, -------------------- slur2, slur3 and slur4 are - = tie arbitrary. The point is that ( = open slur1 it is possible for slurs to ) = close slur1 overlap timewise in a part [ = open slur2 (e.g. in piano music) and ] = close slur2 therefore necessary to have { = open slur3 several open-slur, close- } = close slur3 slur pairs available. z = open slur4 Tuple numbers are not printed x = close slur4 unless specified by a "*" in * = start tuplet the first record of the group ! = stop tuplet and a "!: in the last record of the group. Ornaments It is possible to combine a ---------- trill (t) with a wavy line (~). t = tr. A wavy line is understood to r = turn terminate at the next note k = delayed turn record, unless continued by w = shake the continue (c) code. ~ = wavy line (trill) c = continue wavy line M = mordent j = slide Technical Indications Fingerings are represented --------------------- from the top down. v = up bow 5 n = down bow 531 = 3 o = harmonic 1 0 = open string Fingering substitutions are Q = thumb position (cello) represented using the ":" 1,2,3,4,5 = fingering character. : = next fingering is a 5:42:1 = 5-4 substitution 2-1 Articulations and Accents -------------------------- A = vertical accent (/\) V = vertical accent (\/) > = horizontal accent . = staccato _ = legato = = line with dot under it i = spiccato , = breath mark Accidentals on ornaments (must follow directly after ornament) -------------------------------- s = sharp (ss = double sharp) h = natural b = flat (bb = double flat) u = next accidental is below rather than above ornament Other Indications and Codes The "Z" character means --------------------------- sforzando. Whether this S = arpeggiate (chords) is printed as "sfz" or F = upright fermata "sf" is not determined E = inverted fermata here. The same goes p = piano (pp, ppp, etc.) for re-sforzando. f = forte (ff, fff, etc., fp) "+" indicates an m = mezzo (mp, mf) accidental on the Z = sfz same level as its Zp = sfp note; "^" indicates R = rfz an accidental above ^ = accidental above note the note. + = cautionary/written out accidental columns 44-80: text: multiple lines of text set off by | For the Christmas carol "Deck the halls with boughs of holly," which has three verses, the text for the first note would be &dDDeck|See|Fast&d@ It is instructive to point out the types of information &dDnot&d@ represented in the record described above. In the case of ties and slurs, nothing is mentioned about their orientation (tips up vs. tips down) or their placement. The arrangement of basic beam components is fully described, but nothing is said about the orientation of the beam (length of stems, etc.). No provision is made for describing repeated notes or repeated note pairs under beams (repeaters). No information is concerning the horizontal distance between successive notes is given; in fact, no horizontal information of any kind is specified. The position of a note within a measure is implied by its position in the file, i.e., by the sum of previous durations within the measure. There is also no explicit information on vertical placement. The vertical position of note heads relative to staff lines can be inferred from note pitch and from the controlling clef (specified earlier in a "$" type record), but the vertical position of rests is completely unspecified. The position of ornaments, technical indications, articulations and accents, and other indications and codes attached to notes is completely unspecified. The information described above is very important for printing applications, and we have a means for representing most of it, if necesary (see the section on Print Suggestion records below). But we have chosen to leave this information out of regular note and rest records because the purpose of these records is to describe basic content rather than specific inplementation. The thinking is that intelligent software can deduce this information correctly most of the time, and this leaves us with the task of providing print-specific information only in those cases where notation is unusually complicated. The representation of ornaments and other symbols attached to notes (codes for columns 32 to 43) is very incomplete at the present time. 53 character codes have been defined thus far, leaving room for 42 additional definitions. Rather than try to assign these codes now, we have chosen to leave them available to future uses of the system. We haven't implemented a character definition system at this time, but I can imagine that a character definition record could be designed that would allow encoders to assign specific meaning to any unused character code. As far as representing sound, we have a similar situation. Other than specifying basic pitch and duration, the regular note records contain no sound specific information. Dynamics are specified (ff, pp, etc.) 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. Our reason for leaving this information out of the record is the same as that for music printing. We want the note records to represent application-neutral information and to confine application-specific information to records designed for that purpose. For sound, we have implemented S-type (sound type) records, which are described below. Nothing has been said thus far about representing chords, grace notes or cue-size notes. This is the next topic in this discussion. A regular note may be followed by additional chord tones. A chord is thus made up of one regular note and one or more &dDextra chord notes&d@. The key for an extra chord note is " " (blank). The format for this type of record is as follows: Extra note in a chord control code = ' ' (blank) --------------------------------------------------- column 1: blank columns 2-5: pitch (see regular note) columns 6-8: duration or blanks column 9: tie flag columns 10-42: same as for regular note 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 the that of the regular note, but must not exceed the that of the regular note. (The situation of different durations arrises sometimes with string double stops). If all durations in the chord are the same the pitches may appear in any order (any of the pitches may be coded as the regular note). For purposes of analysis, it is O.K. to assign different notes of a chord to different tracks (column 15). ===================================================================== SUBJECTS TO BE COVERED NEXT (in order) 6. Grace notes, Cue-notes control code = g or c column 1: g = grace note c = cue note (grace size, but written in time) column 2-5: pitch/rest (see regular note) columns 6-7: blanks column 8: note type 0 = eighth note with slash 1 = 256th note 2 = 128th note 3 = 64th note 4 = 32nd note 5 = 16th note 6 = 8th note 7 = quarter note 8 = half note 9 = whole note A = breve column 9: blank column 10-80: same as regular notes 7. Extra Grace/Cue note in a chord column 1: g or c (same as 7 above) column 2: blank columns 3-6: pitch (see regular note) column 7: blank column 8: note type (same as 7 above) column 9: blank column 10-80: same as other grace and cue notes 8. Figured harmony control code = f column 1: f = figured harmony column 2: number of figure fields columns 3-5: blanks column 6-8: advance of figure division pointer Figures take their position from the first regular note that follows the figure records. 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" figure is used as a place holder to advance the figure division pointer. columns 9--12: blanks columns 13-15: footnote and level information column 13: footnote flag (blank = none) column 14: level number (optional) column 15: blank column 16: blank columns 17--: figure fields The figure fields are set off by one or more blanks. &dA &d@ Figure numbers may extend from 1 to 19. They may be modified in front by #,n,f, and x. They may be modified afterward by #,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. 6 For example, in the figure list #4 , the 6 would be in 2 represented in the first field. figures, signs and modifiers: 1 # = sharp 2 n = natural 3 f = flat 4 x = double sharp 5 + = augment 6 \ = diminish 7 / 8 - = short line in 9 _ = long line from previous figure 10 11 b = blank ... 9. Forward and Back space in time control code = i,b columns 1-5: "irst " = forward space (invisible rest) (or "irest") "back " = backspace columns 6-8: duration to skip forward or back up columns 9--12: blanks columns 13-15: footnote and level information column 13: footnote flag (blank = none) column 14: level number (optional) column 15: blank column 16: blank column 17: pass number (optional) This feature can be used to express parallel action in the same part (e.g. keyboard music).