Skip to main content

Module encode

Module encode 

Source
Expand description

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

Functions§

encode_midi1_channel_voice
Encode a MIDI 1.0 channel-voice message into a 32-bit UMP (Message Type 0x2) on group. Returns AudioError::UnsupportedFormat for non channel-voice messages (system real-time/common are not MT 0x2).
encode_midi2_channel_voice
Encode a MIDI 2.0 channel-voice message into a 64-bit UMP (Message Type 0x4) on group.
translate_midi1_to_midi2
Translate a MIDI 1.0 channel-voice message to the MIDI 2.0 channel-voice model, applying default resolution up-scaling (7-bit→16-bit velocity, 7-bit→32-bit controllers/pressure, 14-bit→32-bit pitch bend).