File Specification: CS302 Midi Note File
I assume that you have read the
CS302 Midi Event File specification before you read this.
The CS302 Midi Note File starts with the word "CS302-Midi-Note-File".
After that, the file should contain note or pedal event specifications.
The format of these specifications are keywords followed by values.
Keywords and values are words separated by whitespace.
There is no concept of a line of text -- the input composed of simple words (this makes it easier
to read input in C++).
Here are the two specification formats:
- ``NOTE pitch volume starttime stoptime:'' play a note at the given pitch and volume
starting and stopping at the given times.
- ``DAMPER starttime stoptime:'' depress the damper pedal at the given start time,
and release it at the given stop time.
Times are doubles, and refer to seconds after the file has started playing.
Other units and values are the same as in the
CS302 Midi Event File specification.
Some Examples
As in the Event specification,
the first example is a simple file that plays a C-major chord for one second, starting at time 0 and ending at
time 1. The file is
C-Major-MNF.txt, and its MIDI is
C-Major.mid.
CS302-Midi-Note-File
NOTE 60 64 0 1
NOTE 64 64 0 1
NOTE 67 64 0 1
|
The second example, where we hold the damper pedal for two seconds, is in
C-Major-Damper-MNF.txt
(MIDI: C-Major-Damper.mid):
CS302-Midi-Note-File
NOTE 60 64 0 1
NOTE 64 64 0 1
NOTE 67 64 0 1
DAMPER 0 2
|
All of the Midi Event File Examples exist as Midi Note Files:
- Two-Repeat-MNF.txt,
Two-Repeat.mid, two notes, played one after another.
- C-Major-Scale-MNF.txt,
C-Major-Scale.mid:
A C major scale, where each note is played for 1/2 a second,
and each successive note is played right after the previous note has stopped.
- C-Major-Scale-Damper-MNF.txt,
C-Major-Scale-Damper.mid:
The same C major scale as above, only now the damper pedal is held down thoughout.
- C-Major-Scale-Overlap-MNF.txt,
C-Major-Scale-Overlap.mid:
A C major scale,
and each successive note is played a half a second after the previous note, but each
note is held for a second. Thus, the scale sounds a little blurry.
- Repeating-Louder-MNF.txt,
Repeating-Louder.mid:
Middle C, repeating every 1/10th of a second, getting louder at each repetition.
- Chopin-Black-Key-MNF.txt,
Chopin-Black-Key.mid: Chopin's "Black Key" Etude, Opus 10, #5.
- Chopin-Military-Polonaise-Beginning-MNF.txt,
Chopin-Military-Polonaise-Beginning.mid: The
beginning of Chopin's "Military" Polonaise, Opus 40, #1.
- Gershwin-RIB-MNF.txt,
Gershwin-RIB.mid: Gershwin's Rhapsody in Blue, played by the Composer on
a Duo-Art Piano Roll, and then converted to MIDI.
- Rachmaninoff-Elegy-MNF.txt,
Rachmaninoff-Elegy.mid: Rachmaninoff's Elegy, Opus 3, #1.
- Scriabin-Etude-Beginning-MNF.txt,
Scriabin-Etude-Beginning.mid: Beginning of Scriabin's Etude, Opus 8, #10.
- bach_565-MNF.txt,
bach_565.mid: Bach's D minor Toccata,
BWV 565.