Skip to content

mxm, IT's mad science

Sections
Personal tools
You are here: Home » Products » Open Source » Python Midi Package » Simple math operations with MIDI
Downloads
You can download mxm products here.

Due to it's technical and international nature, this section is in english.

Max M Has a blog too.

og er glad for mad

 

Comment

Above in this comment thread: Python Midi Package

Simple math operations with MIDI

Posted by Anonymous User at 2008-09-04 04:55 PM
Hi,
I have some python classes to represent notes, scales, intervals. What I need is to istantiate such classes after reading a MIDI file. So, if the file contains a short melody (e.g. C - E - G), I have to istantiate the note class three times, then interval and so on.

Do you think I can use your module for this?
And if in a file there is a melody and a drum pattern, is it possible to identify the two instruments?

Thanks,
Carlo

Instruments

Posted by Anonymous User at 2010-04-24 10:30 AM
Hi,

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