Useful MIDI Objects
This patch shows objects that are useful when working with MIDI in Max.
This patch shows objects that are useful when working with MIDI in Max.
This patch shows several of the most basic and useful Max objects.
A metro object (a scheduler of timed, repeated triggering messages) to trigger a counter (which keeps track of, and reports how many events it has received), and then uses the numbers from the counter to play notes on a MIDI synthesizer.
This example demonstrates how to harmonize a single MIDI note with multiple pitches.
To create a poly-rhythm generator, this example chooses a division and articulates every attack point of that division. Use a metro synched to the transport to specify the divisions (or the tempo object, if preferred), and then use a counter (or a % object with the output of tempo) to specify the articulation points.
Load a MIDI file into detonate, send it a “start” message, then send it “next” messages to output each note. Notice that the leftmost outlet sends out the delta time (in ms) until the next note in the score; that value can be tested, and if it’s sufficiently small, say under 50 ms for example, that means that the next note is practically simultaneous with the current one. The example then sends an additional ‘next’ message.
Following on the “MIDIglissando” example, this example shows how to program a rather long glissando with the push of a button.
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.