MIDI mapping to amplitude

Mapping one range of values to another needed range of values is a crucial technique in computer music. In this example, we want to map MIDI data values that range from 0 to 127 into a useful range for controlling the amplitude—and thus the loudness—of a sound in MSP.

MIDI input objects

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.

Crossfade and blur movie files using jit.xfade and jit.matrix

This example shows a couple of different Jitter techniques. It shows how you can very simply use a MIDI control value to alter a Jitter attribute. In this case, the MIDI values from a modulation wheel (continuous controller 1), which range from 0 to 127, are divided by 127.0 to provide an xfade value from 0. to 1. to the jit.xfade object, to crossfade between two movie files.

MIDI Input in Ableton Live

This example shows how to listen to a specific MIDI CC in Max for Live. Implementing MIDI reception for Max for Live is a little different from implementing it for straight ol’ Max. Instead of using, for example, the ctlin object, we need to use midiin, and then use midiselect to look for exactly what we want. Also, we need to make sure our plug-in is in a Live MIDI track, and that the MIDI monitoring is set to IN.

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.