Max has dedicated objects for parsing each particular type of MIDI channel message coming into the computer, such as notes, pitchbends, controllers, etc., and it has corresponding output objects for formatting and transmitting MIDI messages to be sent out of Max.
This patch shows objects that are useful when working with MIDI in Max.
A max user asked the following:
I would like to create a virtual mixer with max and control Pro Tools 9. But pro tools does not have MIDI learn for the mixer.
This example shows how to control glissando using MIDI. A little bit of revision: MIDI notes can only be played with whole numbers 0-127. Some synths allow you to specify an alternate tuning other than 12-tone equal temperament, but that’s not what we’re after in this case. So, let’s say, if you’re converting frequency to midi note values you will need to calculate the desired pitchbend from the fractional part of the value you obtain from ftom.
For producing a score out of time and then saving as a standard MIDI file, detonate is the best way to go, and it can save in either format 0 or format 1. Admittedly, you could save a format 0 MIDI file with text and seq by writing the text file, reading it back into seq, then writing that as MIDI, and it could all happen in a few milliseconds.
Given a hypothetical grand master fader that can be controller with the continuous controller 13 (assuming for the sake of this example that your device is also set to receive on MIDI channel 1), you can send the message 176 13 127 to a midiout object to turn the fader up to full. Another way to do this would be to use a ctlout object, send the number 1 in the right inlet, the number 13 in the middle inlet, and then send 127 in the left inlet.
The easiest way to establish MIDI connection between Max and other applications on the same computer is via the "virtual" MIDI ports Max provides. Max creates two virtual input ports and two virtual output ports that can be accessed by other MIDI applications. (You can see those virtual ports listed in Max's MIDI Setup, by choosing MIDI Setup... from the Options menu.)