Hey, I'm completely new to the maxmsp world, and I would like to know if there is an easy way to import midi files to max, on demand, as in, I choose when, what file, stop , pause etc... thanks in advance.
Here's a hint. Start with the Max tutorials 12-16 (they're not all
specifically MIDI-related, but can't hurt). Also check out the MSP
tutorial 19, that goes over how to do basic stuff with getting MIDI into
Max and producing sounds. Of course this isn't all the documentation on
MIDI, but it's more than enough to start with I'd think. Of course the
other part of the equation is reading files in, so check out the "Files:
How Max Handles Search Path and Files" appendix in the Max tutorials.
Also search through the mailing list archives--there is a *lot* of
information on the lists such that you can probably find that someone
else has already tried to do what you're doing now. Often there will
even be an example patch available explaining.
The two official Max objects that deal with importing midi files have their advantages and drawbacks:
“seq” will import a midi file with all midi attributes (program changes etc.) but only works with Type 0 midi files. (Why this hasn’t been upgraded to support Type 1 after all these years is beyond me).
“detonate” will import Type 1 midi files as well as Type 0 but it wont import midi attributes – only note events.
The object we chose to use in the Maestro project for importing midi files including all attributes (even including lyrics) is the excellent “psw.midifile-parser” by Peter Swinnen.
You may want to check out Maestro to see the implementation of this. When playing a song using our tapping mechanism each tap will send out just the relevant portion of midi data for the current song position (notes and attributes). By tapping in the right rhythm you are stringing together consecutive midi chunks of the original midi file so it sounds (and feels) like your playing the song- notes, controllers and all.