Creating MIDI Effects

Creating MIDI Effects

Max for Live lets you create MIDI effects devices which receive MIDI information from the Live application, perform some operation on that data (e.g. mapping incoming notes to a user-definied musical scale), and then pass MIDI data downstream to another MIDI effect or to a MIDI Instrument - the last device in a MIDI effects chain (although the audio output of the instrument may be further processed by any number of Audio effects devices).

By convention, Max for Live gets all its MIDI data from the Live application using the midiin object, and all of that data must all be passed downstream to other MIDI devices by means of the midiout object. Max for Live provides a means to redirect portions of an incoming MIDI data stream for processing while leaving the rest of the stream unchanged, as described below.

Also by convention, all Max for Live MIDI devices receive audio on MIDI channel 1. You can receive receive MIDI data in your Max for Live MIDI Effects device on a channel number other than 1 by routing the MIDI input as described here.

Max for Live provides several tutorials and example MIDI effects devices you can try, study, and modify:

  • One of the Max for Live example devices contained in the Max for Live Essentials Live pack is an example of a classic MIDI effects device - a Step Sequencer effect that contains four independent step sequencers whose editor looks and acts like Live's native MIDI editor.
  • The MIDI Effect Tools and Building Blocks demonstrate techniques for processing and generating MIDI.

You can also download copies of instruments from the original "Big Three" devices originally released with Max For Live 1.0 as individual Live packs. The The Max for Live 1.0 Step Sequencer is a good example of a MIDI effects device that you may find useful as a starting point.

Capturing a portion of the MIDI data stream in Max for Live

Max for Live requires that all MIDI data coming into a MIDI Effects device be passed downstream. There are situations in which you may want to use only a portion of the incoming MIDI data stream - to select only MIDI notes in a given range, or input from specific MIDI continuous controllers for use in your device. The Max midiselect object lets you specify portions of an incoming MIDI data stream to filter out for further processing in your device, and passes any other MIDI data out unchanged.

Redirecting a part of a MIDI data stream

  • In your unlocked patch, add a midiselect object and connect its inlet to the outlet of the midiin object in your MIDI Effect or MIDI Instrument template file.
  • Following the name of the midiselect object enter the attributes corresponding to the MIDI data you want to filter out of the data stream, followed by any arguments that specify additional data (MIDI channel numbers, MIDI controller numbers, etc.). Attributes names begin with an at-sign (@), and there is no space following it and the type of data you want to filter out.
    The data types are:
    ch: MIDI channel (only used when routing MIDI data from a non-channel 1 source, as described below)
    note: MIDI note data
    ctl: MIDI controller data
    bend:pitchbend data
    pgm: MIDI program change messages
    touch: Aftertouch data
    poly: Polyphonic aftertouch data
  • Connect the input of the midiout object in your MIDI Effect or MIDI Instrument template file to the right outlet of the midiselect object. Any data you do not specify when you instantiate the object or data you select by sending messages to the midiselect object will be passed downstream without being edited.