Reading General MIDI files
I want to be able to read in General MIDI files (either type 0 or type 1) into my patch (which will be turned into a Max standalone). In addition to obviously getting the note info out, I also need to be able to extract program change messages and continuous controller (CC) messages from the file. For reasons which I'll spare you, I also can't use Java, so no mxj objects allowed. Here's what I've looked at, and challenges:
seq - doesn't read in type 1 (multi-track) MIDI filesdetonate - reads in type 0 and type 1 files, but no ability to read program change or CC data from files. This thread identifies the same problem.midifile by John MacCallum - mxj objects not OK.ajm.midi2coll by Adam Murray - doesn't output program changes, and also dependent on mxj.
Any other ideas or leads??
I had an idea to try and see if there were Javascript tools to tackle this. I found jasmid, which has two sub-components, midifile.js and stream.js which seem like they populate a Javascript array with the MIDI info.
I stink at Javascript though, and wondering if anyone out there could tweak the above files to work in a Max-land js object? Ideally, I'd love to be able to give the object the path to the .mid file, and then get all the info out the other end...
Also have a look at note~ (noteformax.com - I think) and bachproject.net. I've been irking with them trying to decide which one fits my needs best. Still haven't decided but they seem to be further ahead than detonate.
well, last but not least there is [filein].
@Artmusicsouth - thanks, those are good ideas to explore, I didn't know that they had MIDI support...
Since this thread has high google ranking: Seems that with v. 7.3.2 seq and follow now read MIDI type 1 files, see https://cycling74.s3.amazonaws.com/support/version_7_3_2.html
:)
this is huge news!!! very exciting, thank you for the notification.
Extra info for those who doesn't know to check kinMidiFileReader in the Kinetic toolbox.
Thanks - generally helpful to have another option, but this one too is Java-based... Going back to my original post from many years ago, for my purposes I can't use Java.
Googling around I found javascript code to read MIDI files. I wonder if it's possible to port one these JS projects to Javascript in Max?
Any javascript/max ninja hints?
https://github.com/colxi/midi-parser-js
https://github.com/nfroidure/MIDIFile
https://github.com/mudcube/MIDI.js/
See my post above from 9/6/2013 - that's what I was hoping to do, but my Javascript skills were never up to the task. Would still love it if someone could do this!