In the Musical Instrument Digital Interface (MIDI) standard, a key-on or a key-off event will use at most three bytes each, cf.
[40], However, in case several key events occur on the same MIDI-channel, running status can be used. In principle running status means that the first byte of, e.g. key-on is omitted. In addition, the key-on event having a velocity of zero is equivalent to the key-off event. Thus, combining running status and using key-on with zero velocity, as the key-off event will reduce the number of bytes needed to encode key events.
EXAMPLE:
Without running status, the sequence
91 2E 23 8E, 91 2B 50 8E, 81 2E 64 00, 81 2B 64 00
means
"Key 2E ON Velocity 23 MIDI Ch 1",
"Key 2B ON Velocity 50 MIDI Ch 1",
"Key 2E OFF Velocity 64 MIDI Ch 1",
"Key 2B OFF Velocity 64 MIDI Ch 1". Using running status will reduce the sequence into
91 2E 23 8E, 2B 50 8E, 2E 00 00, 2B 00 00,
That is, the command byte is omitted and velocity zero is used for key off.
The SP-MIDI content can be stored in, a Standard MIDI File (SMF) of type 0 or type 1
[40]. In a type 0 SMF, one header chunk and one track chunk is used. In a type 1 SMF one header chunk and several track chunks are used. SMF type 2 should not be used
In general it is more efficient to store the MIDI data as a type 1 file. The increased efficiency is reached if each track contains one MIDI channel and one instrument (This is often the case). Evidently, running status can be applied on each individual track reducing the track size. To further reduce the size of the file use one track per used MIDI channel. That is, if a temple/conductor track exists merge it with the first instrument track. Remove, all meta events which are not necessary, e.g.
"track name",
"lyric". To summarize, the following measures can be taken in order to reduce the SMF:
-
use SMF type 1 (or check if type 1 is smaller than type 0 and use the smallest);
-
use running status;
-
one and only one instrument per track. Try not to change channels;
-
do not change tempo in the middle of the music, i.e., only set tempo once;
-
use beat, instead of SMPTE, to set tempo;
-
copyright is on automatically;
-
remove controller messages, which are optional according to [39];
-
turn off the options below:
-
sequence Number - MIDI sequence ids;
-
text - embedded text for anything;
-
sequence / track name;
-
instrument name;
-
lyric;
-
marker - for synchronization purposes;
-
cue point;
-
midi channel presix - associate channels with all events following;
-
sequencer-specific settings.
Items 1 to 3 above optimize the notes, while items 4 to 8 optimize the overall melody. The above measures will provide an SMF, which is ready for compression. However, prior to compression the composer/content author can consider to use few values for key velocity and thereby increasing the redundancy of the file.
Content creators should not expect the full support for the following features:
-
MIDI message channel pressure;
-
MIDI message pitch bend;
-
individual stereophonic panoramic (pan) as expressed in Table 5 in [39];
-
MIDI message master volume.
Content creators should not expect a time granularity better than 5ms to be supported by the SME.
To ensure interoperability, the first value of the MIP Table should be no more than 6 voices.