Scorefiles Have Notes of Various Types

Notes in most software synthesis languages always have a duration. However, when responding to real-time events, the duration is not necessarily known. When a performer presses his finger on a klavier-style keyboard, the computer must begin a note now but has no idea when the performer will lift his finger from the keyboard. MIDI breaks notes into on/off pairs. Scorefiles represent both the MIDI-style and the note-list-style of note by including a note type in the note specification. The note types are noteOn, noteOff, noteDur, noteUpdate and mute. NoteOn is the start of a musical note, similar to the MIDI noteOn. NoteOff is the end of a musical note or, more precisely, the point when the performer lifts his finger from the key, triggering the beginning of the final portion of the envelopes. NoteDur is a note with a duration. NoteUpdates are explained later. Mutes are notes that make no sound, used for a variety of purposes such as MIDI system exclusive messages.

The following example shows three notes, a noteOn, a noteOff and a noteDur:

guitar (noteOn, 4) freq:c4;
t +2; 		
guitar (noteOff, 4); 		
t +2; 		
guitar (2) freq:c5;

We now see why the duration parameter does not have a label. Supplying a duration in place of the note type identifies the note as a noteDur.

The number 4 following the note type in the first two notes is a noteTag. Since noteOns and noteOffs are only “half a note” as it were, there needs to be some way to match them up. We could simply say that a noteOff matches the most recent noteOn played by the same part. But then it would not be possible to do chords or polyphony in a single part. MIDI handles the situation by using the MIDI channel (in mono mode) or a combination of the key number and channel (in poly mode). However, MIDI's approach is problematic in many cases. For example, in a general computer music system, we do not want to be limited to 88 discrete pitches. We would like to be able to specify slight retuning without disturbing the matching of a noteOn and a noteOff. Therefore, we prefer to avoid use of key number or frequency to identify notes.

As mentioned above, scorefiles use noteTags to match noteOns and noteOffs. NoteTag matching does not depened on frequency at all. Therefore, there's no need to repeat the freq: parameter in the noteOff.

NoteTags also serve another significant purpose. They make phrase-level structure possible.