MIDI

MIDI cc to control umenu

To get the values of only one particular continuous controller, use the ctlin object, or use the route object to parse the controller data coming out of midiparse. To change one range of values into another, use simple math (usually one multiplication and one addition will be enough), or use the scale object.

MIDI to Frequency

Incoming MIDI control values (0 to 127) from a ctlin object can be scaled with the scale object to cover any desired pitch range (in terms of MIDI pitch number), and that pitch range can then be converted to frequency in Hertz with the mtof MIDI to frequency object.

Managing transpositions for sustained MIDI notes

When transposing the pitch of sustained incoming MIDI notes, you need to be certain that the note-off message has the same transposition. Otherwise, any time more than one note is played, each subsequent note changes the transposition before the previous note receives its note-off message. To solve this you need to keep track of what transposition you give to each incoming note, as illustrated in this example.

Harmonizer written in JavaScript

As a demo project to explore JavaScript programming in Max, this patch implements a script that harmonizes any played MIDI note with either a major seventh chord or a minor seventh chord that contains the played note. For any given pitch, there are four different major seventh chords and four different minor seventh chords that contain that pitch.