After processing the event normally, a series of one or more bytes should be read until one is reached that does NOT have the high-bit (0x80) set. The last flag is set when the event is followed by a delay. The channel is the standard MIDI channel number the event takes place on, except that channel 15 is used for percussion. The type value indicates what type of event this is and how to process the following data bytes. The first byte is an event which tells you how many bytes to read to perform the event. Like a type-0 MIDI file, MUS only supports a single track. Consequently, few if any MUS files will have secondary channels present. However, it does not look like the secondary mapping was ever used in the official MUS creation programs, and all MIDI channels except percussion were stored as primary. In other words, if primar圜hannels is 2, then events on MUS channels 0 and 1 will be fine, but should any events occur on channels 2-8, those events will play on channel 15 as percussion, which is almost never what you want - this design choice was probably made to ensure any bugs in the channel mapping code were very obvious. 10 If any channels are used that are outside the primary/secondary range, they will be mapped to MUS channel 15 (percussion.) This means when producing a MUS file, all events must appear on channels in the following ranges: The first channel used in the secondary range (10-14) will be assigned to MUS channel 10.Īs an example, if channels 2, 4, 9 and 12 are used (with 9 being MIDI percussion, normally called channel 10), then the song will show two primary channels (0 and 1) and one secondary channel (10), plus percussion (15). The percussion channel is not considered in the primary or secondary count.Ĭhannels are allocated in the order they are used, so the first channel used in the primary range (0-8) will be MUS channel 0. MIDI percussion channels 9 and 15 are assigned to MUS channel 15, which is used for percussion. mus file from MIDI data, channels 0-8 are considered primary, and channels 10-14 secondary. All the primary channels should always be played. The primary and secondary channels are presumably set up such that secondary channels can be dropped as needed, if the audio hardware is not polyphonic enough to play all the required notes. This means the MIDI percussion channel normally described as channel 10 will be called channel 9 here as we are counting from 0, not 1. The channel values described in this section start from 0, to reflect the raw values read from the MUS file. The instrument numbers are 0-127 for standard MIDI instruments, and 135-181 for standard MIDI percussion (notes 35-81 on channel 10). This is presumably so hardware like the GUS can have the required instrument samples loaded into memory before the song begins. The instrument patch list is simply an array of MIDI patch numbers that are used in the song. Number of secondary channels used in this song, starting from MUS channel 10 Number of primary channels used in this song, starting from MUS channel 0 Offset of first byte of song data, relative to start of file Length of the song data in bytes (the 16-bit value means songs can not be longer than 64kB)
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |