Skip to main content

Module decode

Module decode 

Source
Expand description

Decode Universal MIDI Packets back into messages, and translate MIDI 2.0 channel-voice → MIDI 1.0 channel-voice (with default resolution down-scaling).

Enums§

UmpDecoded
The decoded content of a UMP, spanning the message types this lane models.

Functions§

decode
Decode any modelled UMP, dispatching on Message Type.
decode_midi1_channel_voice
Decode a MIDI 1.0 channel-voice UMP (MT 0x2) into a MidiMessage. Errors AudioError::UnsupportedFormat if the packet is not MT 0x2.
decode_midi2_channel_voice
Decode a MIDI 2.0 channel-voice UMP (MT 0x4) into a Midi2ChannelVoice. Errors AudioError::UnsupportedFormat if the packet is not MT 0x4, or AudioError::MalformedAudio if it does not carry two words.
translate_midi2_to_midi1
Translate a MIDI 2.0 channel-voice message down to the MIDI 1.0 model, applying default resolution down-scaling. Per the MIDI 2.0 default translation, a MIDI 2.0 Note On whose velocity scales down to 0 is clamped to velocity 1 so it is not misread as a MIDI 1.0 implicit note-off.