Don't know if you're still interested in that, but MIDI files seem to ALWAYS use channel number 9 for drums. If you're lucky, sometimes the file contains information about instruments, and you can retrieve them using the sequence_name or instrument_name events.
I'm currently working on an application that produces diatonic harmonica tabs from MIDI files, and I've been trying to identify instruments too. If you're interested, have a look at https://sourceforge.net/projects/harpy/ and get MidiStats.py from the SVN repository.
An alternative I'm currently looking into is to identify instruments based on patch_change events, like MScore does. This will certainly be useful whenever sequence/instrument names are empty, and that does happen a lot ...
By the way, thanks a lot to Max M. for this wonderful module! ;-)
Don't know if you're still interested in that, but MIDI files seem to ALWAYS use channel number 9 for drums. If you're lucky, sometimes the file contains information about instruments, and you can retrieve them using the sequence_name or instrument_name events.
I'm currently working on an application that produces diatonic harmonica tabs from MIDI files, and I've been trying to identify instruments too. If you're interested, have a look at https://sourceforge.net/projects/harpy/ and get MidiStats.py from the SVN repository.
An alternative I'm currently looking into is to identify instruments based on patch_change events, like MScore does. This will certainly be useful whenever sequence/instrument names are empty, and that does happen a lot ...
By the way, thanks a lot to Max M. for this wonderful module! ;-)