Skip to content

MIDI Input

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

MIDI messages (per channel)

These inputs handle messages on any channel. To focus on a specific channel, add a _chN suffix. For example, [param midi_cc1_ch3] will send any changes to the value of continuous controller 1 received on channel 3.

  • [param midi_program]: sends any program change events. These values are in the range 0..127.
  • [param midi_bend]: sends any changes to the value of pitch bend. These values are in the range -1..1.
  • [param midi_press]: sends any changes to the channel pressure (non-polyphonic aftertouch). These values are in the range 0..1.
  • [param midi_ccN]: sends any changes to the value of continuous controller N. These values are in the range 0..1.
  • [param midi_velN]: sends any changes of velocity for the MIDI note N. These values are in the range 0..1.
  • [param midi_drumN]: sends any changes of velocity for the MIDI note N on channel 10 (i.e. drum velocities). These values are in the range 0..1.

Clock & transport

  • [param midi_clock]: outputs a pulse of value 1 after each MIDI clock (24ppqn) received, followed by zeroes. The duration of this pulse is equal to the current block size. To get a single-sample pulse, pass this through [change]=>[> 0].

  • WARNING: MAY CHANGE IN FUTURE [param midi_play]: sends a value of 1 if either MIDI start or MIDI continue messages were recieved, and a value of 0 if MIDI stop was received.

Raw MIDI bytes

Raw MIDI bytes are available in the patcher by creating a [in N midi] or [in N midithru] object, where N is an unused input channel. For example, if your Daisy hardware has stereo input, use N=3. If, like the Daisy Patch, you have quad audio input, use N=5.

The [oopsy.midi.parse] abstraction shows how to derive most of the common kinds of MIDI messages from this bytestream, and is likely all you need.

If you are curious: The byte stream output by [in 3 midi] is scaled by 1/256 (i.e. values are normalized in 0..1), which helps protect hardware from excessively large/loud numbers due to accidental patching. Therefore, to recover the MIDI bytes, multiply the signal with [* 256]. Also, since MIDI bytes are less frequent than audio sample frames, the empty frames between bytes are filled with negative numbers. That is, you can filter valid bytes only using [>= 0].

The difference between [in N midi] and [in N midithru] is that the latter will make any MIDI bytes received on the hardware input also be copied to the hardware output.

Clone this wiki locally