For LARGE MIDI files, you can have a look here:
http://www.midimusicadventures.com/queststudios/midi-soundtracks/complete-soundtracks/
Just found out...
Windows Media Player does not care about type 2 MIDI files, it plays both tracks simultaneously.
It also does not mind if a type 0 MIDI file has more than one track, just plays all as type 1.
You can try these with other players...
The midi file indicates in some way if it is GM Level1 or GM Level2, because at GM level1 the notes transmitted by channel 10 are percussion, in level2 it uses channel 10 and 11, I even have a midi file that has the drums for the channel 7, it sounds like drums because it uses the bank select but I don't know how to detect that it's drums and not a piano
// GS Custom Percussion Assignment
// F0 0A 41 (10) 42 12 [40 1A 15] [02] 0F F7
// [.. 1x ..] x = part# / (probably) ch# 1-9, 0, A-F
// [0y] y = type: 0 = standard, 1 = drum map 1, 2 = drum map 2
GM percussion is always on Channel 10.
GM2 percussion can be on 10 and/or 11, set with MSB = 120 (instrument channels have MSB = 121)
GS percussion can be on any channel, and is set with a SYSEX command.
// F0 0A 41 (10) 42 12 [40 1A 15] [02] 0F F7
// [.. 1x ..] x = part# / (probably) ch# 1-9, 0, A-F
// [0y] y = type: 0 = standard, 1 = drum map 1, 2 = drum map 2
F0 -> start sysex
0A -> variable length of 10 bytes
41
10 -> ¿channel?
42
12
40
1A -> 1x?
15
02 -> 0y?
0F
F7 -> end sysex
I found https://midi.org/forum/8860-general-midi-level-2-ch-11-percussion according to what I understand I must first search SYSEX to know if it is GM, GS or XG what are the sysex messages for each one ? Can there be more than one at a time?.
Finding what instrument is playing is harder than it seems and here I thought I could completely ignore sysex messages.
The bank selector allows many different instruments, is there a list with the names? although perhaps there are too many more than 2 million, right?
what if you have an instrument (program) 113 to 120 on a channel other than 10?
where does 1x and 0y go?
I don't understand this
// GM reset
// F0 7E 7F 09 01 F7 (GM1 hardware)
// F0 05 7E 7F 09 01 F7 (GM1 software)
// F0 7E 7F 09 03 F7 (GM2 hardware)
// F0 05 7E 7F 09 03 F7 (GM2 software)
case 0x05:
cur_pos = buffer_tell(global.edit_buffer);
if ((buffer_peek(global.edit_buffer, cur_pos, buffer_u8) == 0x7E) &&
(buffer_peek(global.edit_buffer, cur_pos + 1, buffer_u8) == 0x7F) &&
(buffer_peek(global.edit_buffer, cur_pos + 2, buffer_u8) == 0x09) &&
((buffer_peek(global.edit_buffer, cur_pos + 3, buffer_u8) == 0x01) || (buffer_peek(global.edit_buffer, cur_pos + 3, buffer_u8) == 0x03)) &&
(buffer_peek(global.edit_buffer, cur_pos + 4, buffer_u8) == 0xF7))
// Yamaha XG reset
// F0 43 (10) 4C 00 00 7E 00 F7 (hardware)
// F0 08 43 (10) 4C 00 00 7E 00 F7 (software)
case 0x08:
cur_pos = buffer_tell(global.edit_buffer);
if ((buffer_peek(global.edit_buffer, cur_pos, buffer_u8) == 0x43) &&
/*(buffer_peek(global.edit_buffer, cur_pos + 1, buffer_u8) == 0x10) &&*/
(buffer_peek(global.edit_buffer, cur_pos + 2, buffer_u8) == 0x4C) &&
(buffer_peek(global.edit_buffer, cur_pos + 3, buffer_u8) == 0x00) &&
(buffer_peek(global.edit_buffer, cur_pos + 4, buffer_u8) == 0x00) &&
(buffer_peek(global.edit_buffer, cur_pos + 5, buffer_u8) == 0x7E) &&
(buffer_peek(global.edit_buffer, cur_pos + 6, buffer_u8) == 0x00) &&
(buffer_peek(global.edit_buffer, cur_pos + 7, buffer_u8) == 0xF7))
// GS reset
// F0 41 (10) 42 12 40 00 7F 00 41 F7 (hardware)
// F0 0A 41 (10) 42 12 40 00 7F 00 41 F7 (software)
case 0x0A:
cur_pos = buffer_tell(global.edit_buffer);
if ((buffer_peek(global.edit_buffer, cur_pos, buffer_u8) == 0x41) &&
/*(buffer_peek(global.edit_buffer, cur_pos + 1, buffer_u8) == 0x10) &&*/
(buffer_peek(global.edit_buffer, cur_pos + 2, buffer_u8) == 0x42) &&
(buffer_peek(global.edit_buffer, cur_pos + 3, buffer_u8) == 0x12) &&
(buffer_peek(global.edit_buffer, cur_pos + 4, buffer_u8) == 0x40) &&
(buffer_peek(global.edit_buffer, cur_pos + 5, buffer_u8) == 0x00) &&
(buffer_peek(global.edit_buffer, cur_pos + 6, buffer_u8) == 0x7F) &&
(buffer_peek(global.edit_buffer, cur_pos + 7, buffer_u8) == 0x00) &&
(buffer_peek(global.edit_buffer, cur_pos + 8, buffer_u8) == 0x41) &&
(buffer_peek(global.edit_buffer, cur_pos + 9, buffer_u8) == 0xF7))
// GS Custom Percussion Assignment
// F0 0A 41 (10) 42 12 [40 1A 15] [02] 0F F7
// [.. 1x ..] x = part# / (probably) ch# 1-9, 0, A-F
// [0y] y = type: 0 = standard, 1 = drum map 1, 2 = drum map 2
else if ((buffer_peek(global.edit_buffer, cur_pos, buffer_u8) == 0x41) &&
/*(buffer_peek(global.edit_buffer, cur_pos + 1, buffer_u8) == 0x10) &&*/
(buffer_peek(global.edit_buffer, cur_pos + 2, buffer_u8) == 0x42) &&
(buffer_peek(global.edit_buffer, cur_pos + 3, buffer_u8) == 0x12) &&
(buffer_peek(global.edit_buffer, cur_pos + 4, buffer_u8) == 0x40) &&
/*(buffer_peek(global.edit_buffer, cur_pos + 5, buffer_u8) == 0x00) &&*/
(buffer_peek(global.edit_buffer, cur_pos + 6, buffer_u8) == 0x15) &&
/*(buffer_peek(global.edit_buffer, cur_pos + 7, buffer_u8) == 0x00) &&*/
(buffer_peek(global.edit_buffer, cur_pos + 8, buffer_u8) == 0x0F) &&
(buffer_peek(global.edit_buffer, cur_pos + 9, buffer_u8) == 0xF7))
{
part_num = buffer_peek(global.edit_buffer, cur_pos + 5, buffer_u8);
part_num -= 0xF;
part_type = buffer_peek(global.edit_buffer, cur_pos + 7, buffer_u8);
global.custom_drums[part_num - 1] = part_type;
}
The bank selector allows many different instruments, is there a list with the names?
For GM1 System On and GM2 System On
//GM reset
//F0 7E 7F 09 01 F7 (GM1 hardware)
//F0 05 7E 7F 09 01 F7 (GM1 software)
//F0 7E 7F 09 03 F7 (GM2 hardware)
//F0 05 7E 7F 09 03 F7 (GM2 software)
F0 7E 7F 09 01 F7 -> GM ON
F0 43 10 4C 00 00 7E 00 F7 -> XG reset
Is there the same code to turn off GM2?
F0 7E 7F 09 00 F7 -> GM OFF according to teragonaudio.com
F0 7E 7F 09 02 F7 -> GM OFF according casio manual
There is: https://github.com/jazz-soft/JZZ-midi-GM
You can have them printed from your MIDI file using this tool: https://github.com/jazz-soft/test-midi-files
Thanks, in my code I read always assuming that the variable length byte exists, I save it and use it to read the rest of the message so it always looks like in hardware, is it ok to do that?
For GM I found this http://midi.teragonaudio.com/tech/midispec/sysen.htm it says that the third byte is the channel, in this case it ignores the channel, can it be something other than 7F?
I was analyzing the file that I uploaded, in this case it would be a GM and XG file at the same time
F0 7E 7F 09 01 F7 -> GM ON
F0 43 10 4C 00 00 7E 00 F7 -> XG reset
Is there the same code to turn off GM?
F0 7E 7F 09 00 F7 -> GM OFF
If there is no active type, it would be the "classic" midi, what is its name? Is GM equal to GM1?
Hello,
Very interesting to be reminded about the website re the adventures/queststudios.
I'd been to that site some time ago, but lost the links to it. Seeing it again, I note the reference to the long/complete soundtracks. I need to check some of them out.
I use the Roland card LAPC-I as part of my midi system, this is MT-32 compat, so it will respond to the SYSEX load of the special sounds (instruments & sound effects). I've heard bits from other soundtracks and these special sounds can add a LOT to the effectiveness of the soundtrack. This is of course one of the interesting aspects of the Roland card, there are so many 'extras' readily available. My Yamaha MU90r has a C/M mode as an alternative to the default XG mode, and this will cope with the 'normal' MT-32 sound set, but this does NOT allow the special/extra sounds as the sound programming is totally different.
Geoff
Are the instruments different for GM GM2 GS XG?
Does channel 16 have something to do with percussion?
Having percussion on channel 10 is just a convention, not a requirement.
I've only seen [Channel 16 having to do with percussion] on linthesia https://github.com/linthesia/linthesia/blob/main/src/libmidi/MidiTrack.cpp#L164
Does channel 16 have something to do with percussion?