Skip to content

MIDI output

Graham Wakefield edited this page Mar 31, 2021 · 10 revisions

MIDI control output (per channel)

  • [history midi_ccN_out]: set the continuous controller N. The input range is 0..1, which is mapped to the full 0..127 range of a MIDI continuous controller.
  • [history midi_press_out]: set the channel pressure. The input range is 0..1.
  • [history midi_bend_out]: set the channel pitch bend. The input range is -1..1, which is mapped to the full range of a MIDI pitch bend.
  • [history midi_program_out]: send a program change the continuous controller N. The input range is 0..127.

All of the above objects default to using channel 1. To use a different channel, append a _chN prefix. For example, [history midi_cc1_ch3_out] will send CC 1 on MIDI channel 3.

CC, pressure, and bend will transmit at a throttled rate to keep within MIDI baud spec. Program changes will transmit whenever the value changes.

MIDI note output

Note output requires multiple objects, at minimum for a pitch and velocity. In Oopsy this is handled polyphonically by use of midi_noteN prefixes, where N is an integer voice number. [history midi_note1_pitch_out] and [history midi_note1_vel_out] are the absolute minimum for a monophonic app. A duophonic app would also need [history midi_note2_pitch_out] and [history midi_note2_vel_out].

  • [history midi_noteN_pitch_out]: set the pitch of voice N using a MIDI pitch value 0..127 If the pitch changes while the note was playing, a note-off message is sent first.
  • [history midi_noteN_vel_out]: set the velocity (loudness) of voice N from 0..1. A velocity of 0 means note off, any other value greater than zero means note on.
  • [history midi_noteN_chan_out]: set the channel of voice N, from 1..16. If this object is not created, voices default to channel 1.
  • [history midi_noteN_press_out]: set the polyphonic pressure (AKA aftertouch) of voice N from 0..1.

Note events will transmit whenever pitch, velocity and/or channel changes. Poly pressure of active notes will transmit at a throttled rate to keep within MIDI baud spec.

MIDI drum-like triggering

For drum-like triggering where there is a fixed set of pitches, there are simpler single-object interfaces to set velocity only:

  • [history midi_vel36_out]: set the velocity of MIDI note 36. The input range is 0..1. A value of 0 means note off. By default this sends on channel 1. Use [history midi_vel36_ch2_out] to send on MIDI channel 2, etc.
  • [history midi_drum36_out]: set the velocity of MIDI note 36. The input range is 0..1. A value of 0 means note off. By default this sends on channel 10.

MIDI clock and other globals

All the messages below expect gate inputs which should be 0 or 1, and the rising-edge transition from 0 to 1 is what sends the message.

  • [history midi_clock_out] is for sending 24ppqn midi clock gates. Consider driving this with a [phasor]=>[> 0.5] for example.
  • [history midi_stop_out], [history midi_continue_out] and [history midi_start_out] is for MIDI transport control (start means rewind & play, whereas continue is meant to continue playing from the last position stopped).
  • [history midi_sense_out] is for active sensing, if you ever need it. It stops some MIDI hardware from going to sleep.
  • [history midi_reset_out] sends a MIDI reset message, if you ever need it.

Be careful that you are sending a gate and not a single-sample impulse (which might be missed); you can use [oopsy.gate.min] to ensure that a short impulse is extended to a gate that won't be missed.

MIDI Thru

If you want any MIDI received on the hardware input to be forwarded ot the hardware output, create an [in N midithru] object. (This object will also give you the raw MIDI input scaled by 1/256, just like [in N midi]). Here, N means any integer that is not being used for audio input, e.g. 5 on a Daisy Patch, or 3 on most other targets.