fbpx


The MIDI Forum

  Friday, 13 May 2022
  37 Replies
  1.2K Visits
2
Votes
Undo
  Subscribe
Hello, could someone lend me some "rare" MIDI files, for example midi 2 format or with SMPTE delta times, I can't find any and also the largest "common" midi file.
The largest midi file I have weighs 84.3Kb and my program takes 0.0137 seconds to read and analyze it, I would like to try something bigger
Thank you. :)
Viewing This Post
4 days ago
·
#14599
0
Votes
Undo
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...
3 days ago
·
#14608
1
Votes
Undo


Thanks, it has really big midi files 1.4 mb

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
(strange that uncompressed midi files cannot be uploaded :D )
3 days ago
·
#14609
1
Votes
Undo
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...


Thanks.
VLC only plays file type 1.
Musescore shows only one track of type 0, two tracks of type 1 and does not open type 2
Audacity shows both tracks of the 3 files in the same way

would there be any reason to indicate an error when a file type 0 has more than one track? because it could just be opened as type 1
3 days ago
·
#14610
0
Votes
Undo
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

This file is an XG file. There are three major formats of MIDI files: GM (GM1 and GM2, soon to add GM 2.0); GS; XG

Each one has specific things it uses to set percussion.

Here's a screenshot from my instrument switcher which shows the breakdown of what's what in this file.
It has 3 GM SYSEX commands, and an additional 82 XG SYSEX commands (one being the XG System On/Reset).
It has percussion on 4, 5, and 7.

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. Here's my code comments for checking this

// 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


XG sets percussion with bank selects MSB = 127 (normal percussion kits), MSB = 126 (SFX percussion kits), MSB = 64 (individual SFX bank)

[quotePost](strange that uncompressed midi files cannot be uploaded :D )[/quotePost]
We all agree ;)
2 days ago
·
#14611
2
Votes
Undo
I learned a LOT about MIDI over the past year+. If you click on my profile and go to my posts, you can see all of the questions I've asked along the way, many of which seem to be a point you might be at now in developing your own software. This forum is very helpful for such things :)
2 days ago
·
#14613
0
Votes
Undo
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
2 days ago
·
#14614
0
Votes
Undo

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.


Finding what instrument is playing is harder than it seems and here I thought I could completely ignore sysex messages.
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?.
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?



I don't understand this

// 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

where does 1x and 0y go?
F0 -> start sysex
0A -> variable length of 10 bytes
41
10 -> ┬┐channel?
42
12
40
1A -> 1x?
15
02 -> 0y?
0F
F7 -> end sysex
2 days ago
·
#14615
0
Votes
Undo
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?.


This post has useful info about the SYSEX resets:

https://midi.org/forum/8742-do-midi-files-store-gm-gs-xg-indicator-info

While it is helpful for them to be in a MIDI file, sometimes they are not. Actual MIDI hardware can be set to already be in a specific mode, so wouldn't need the reset per se. Some players will automatically detect the type, and if one can't be determined, will revert to GM.

Things that I look for in my program when parsing a MIDI file:
SYSEX resets
- GM1, GM2, GS, XG
Bank Selects
- GM1 does not have bank selects, so if there are none, there's a good chance it's GM1.
- GM2 should have MSB set to 121 for instruments, MSB set to 120 for percussion (though some of the files I have are they not all properly set)
- XG will have LSB values set (GM and GS do not generally use LSB values, while XG does the opposite and uses mostly LSB values)

Finding what instrument is playing is harder than it seems and here I thought I could completely ignore sysex messages.

Welcome to the club ;) The more I learn, the more I have to fix my program.

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?

Theoretically there could be a maximum of 2,097,152 if every MSB and LSB and Program Change were used. But thankfully they are not.

As for a list, I have several taken from instrument definition files for Cakewalk, which are the most complete that I have found. I got some of them from just searching on Google, I think a few also came from the website for Seikaju.
The Roland SC-8850 was the last GS device to be released by Roland (I believe) and has the largest GS compatibility/instrument list (that I am aware of).
I have lists from a couple of the most recent Yamaha XG devices.
GM1 is a standard list of 128 instruments and... I forget how many percussion. GM2 added additional banks of instruments and percussion. I have another file that includes those.

See attachments for these lists. You can also look in the official manuals for the SC-8850 and the assorted Yamaha manuals, but I found it much easier (after spending DAYS compiling my own lists from the manuals) to use the pre-made instrument definition files.
GM1_GM2.ins - GM1 and GM2 names
sw1000xg.ins - big list of (shorter) XG names
9000PROv100.ins - smaller, but nicer list of XG names (I read in all the shorter names from sw1000xg, then replace any matches with nicer names from this list)
Roland_SC-8850.ins - GS names
plus a few extra that I ended up not using.

where does 1x and 0y go?

Where you have them. :)

I don't understand this

That is my own comments for how I handle it. I ignore the parts in ( ), as it can contain different numbers (device ID I believe) that I don't need to determine if it is a GS reset.
The "part #" and "type" are described in the Roland user manuals for different devices. I think one of my previous posts we talked about it, but I am too tired at the moment to be able to think about it any more tonight. ;)

Hopefully this helps out a bit.
2 days ago
·
#14622
0
Votes
Undo
Ahh, so now that I am more awake, here's what I check for each of the SYSEX. This is what works for my particular usage, You may or may not need the same.

I scan the file byte by byte, and a SYSEX event is found and flagged with F0. I then check the length byte, and from there further check the rest of the SYSEX to see if it a reset.

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)
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))


For Yamaha XG Reset

// 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))


And for Roland GS Reset

// 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))


The GM1 and GM2 System On do not specify a device.
The XG and GS DO specify a device ID of some sort. For my purposes, it is not relevant, so I check every byte except for the ID byte.

And finally, for the GS percussion channel assignment SYSEX.
Information about this can be found.... in the manual? I'll have to dig through my stuff when I have more time to see where I got it from. I just did a quick look through the SC-8850 manual but didn't see it, but I'm sure it's in there. SYSEX explanations start around page 229.
https://cdn.roland.com/assets/media/pdf/SC-8850_OM.pdf

// 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;
}
2 days ago
·
#14623
0
Votes
Undo

The bank selector allows many different instruments, is there a list with the names?

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
1 day ago
·
#14624
0
Votes
Undo
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 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)





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 GM2?
F0 7E 7F 09 00 F7 -> GM OFF according to teragonaudio.com
F0 7E 7F 09 02 F7 -> GM OFF according casio manual


If there is no active type, it would be the "classic" midi, what is its name? Is GM equal to GM1?



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, this was the first midi list I found for my tests. Are the instruments different for GM GM2 GS XG? I have a list of 400 instruments that comes with my Casio piano, but only change the MSB
1 day ago
·
#14625
0
Votes
Undo
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?

Yes, that is perfectly fine. However, if you write it back to a MIDI file later you need to include the length byte.

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 have only seen it with 7F. But it can be any device number. 7F broadcasts to all connected devices. Generally, a software MIDI player doesn't care which device number is there. MIDI hardware may only respond to it's own device ID or 7F.
See page 4 of the General MIDI Level 1 specs (page 6 of the pdf).
https://midi.org/specifications/midi1-specifications/general-midi-specifications/general-midi-1
Also page 22 of the General MIDI Level 2 specs (page 26 of the pdf).
https://midi.org/specifications/midi1-specifications/general-midi-specifications/general-midi-2

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

GM OFF is F0 7E 7F 09 02 F7

XG files will usually have a GM ON followed by an XG Reset, without turning GM off.


If there is no active type, it would be the "classic" midi, what is its name? Is GM equal to GM1?

Yes, they are used interchangeably.
1 day ago
·
#14626
0
Votes
Undo
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

That sounds really neat. I know that when I play back XG files on my computer, I can get them sounding pretty good, but when I hear the same file recorded from an actual XG device, the difference is can be astounding. I don't want to hijack this thread, but I'd be curious to hear some of these MT-32 files on your hardware versus how they would play for me on my computer.
1 day ago
·
#14627
0
Votes
Undo
Are the instruments different for GM GM2 GS XG?

GM is a common subset of GM2, GS and XG. Other instruments differ.
However, GM2, GS and XG banks don't overlap, so, theoretically it's possible to support all standards simultaneously.
0
Votes
Undo
I'd be curious to hear some of these MT-32 files


You can hear them converted to MP3 on sites like this one.
5 hours ago
·
#14651
0
Votes
Undo
Does channel 16 have something to do with percussion? I've only seen it on linthesia https://github.com/linthesia/linthesia/blob/main/src/libmidi/MidiTrack.cpp#L164
0
Votes
Undo
Does channel 16 have something to do with percussion?

That depends on the device receiving the MIDI messages. Having percussion on channel 10 is just a convention, not a requirement. Some devices let you choose which channel(s) is(are) for percussion while other devices don't give you a choice.
  • Page :
  • 1
  • 2
There are no replies made for this post yet.
Be one of the first to reply to this post!