0

Trying to figure out a good way of solving this problem but wanted to ask for the best way of doing this.

In my project, I am looking at multiple instrument note pairs for a neural network. The only problem is that there are multiple instruments with the same name and just because they have the same name doesn't mean that they are the same instrument 100% of the time. (It should be but I want to be sure.)

I personally would like to analyze the instrument itself (like metadata on just the instrument in question) and not the notes associated with it. Is that possible?

I should also mention that I am using pretty-midi to collect the musical instruments.

  • MIDI files contain instrument numbers. – CL. Dec 29 '18 at 18:03
  • I should also mention I am looking over hundreds of files so those instrument numbers change don't they? – Eric Cacciavillani Dec 29 '18 at 18:23
  • If the files conform to standards like General MIDI, GS, or XG, then the instrument numbers have a specified meaning. – CL. Dec 29 '18 at 22:05
  • I see what you guys are talking about but there are times though where I get the same instrument with a different program number is all...nope wait I am an idiot...sort of at least...Example being I am picking up drums as well when I request for all instruments with program.number == 0 – Eric Cacciavillani Dec 29 '18 at 22:20
  • Hang that was terribly spoken let me try that again. You guys were right it's entirely based on instrument number (which makes sense thank Christ) but for drums the instrument numbers seem to overlap do drums have their own instrument number sequence? – Eric Cacciavillani Dec 29 '18 at 22:32
  • 1
    In General MIDI files, drums are on MIDI channel 10. Each individual drum sound is assigned to a pitch. e.g. pitch 36 is kick drum and pitch 38 is snare drum. [This is the official pitch map.](https://www.midi.org/specifications/item/gm-level-1-sound-set) – SSteve Dec 30 '18 at 01:12

1 Answers1

1

In MIDI files, bank and program numbers uniquely identity instruments.

In General MIDI, drums are on channel 10 (and, in theory, should not use a Program Change message).
In GM2/GS/XG, the defaults for drums are the same, but can be changed with bank select messages.

CL.
  • 173,858
  • 17
  • 217
  • 259