JUCE
|
Functions to assist conversion of UMP messages to/from other formats, especially older 'bytestream' formatted MidiMessages. More...
Static Public Member Functions | |
template<typename PacketCallbackFunction > | |
static void | toMidi1 (const MidiMessage &m, PacketCallbackFunction &&callback) |
Converts from a MIDI 1 bytestream to MIDI 1 on Universal MIDI Packets. More... | |
static void | toMidi1 (const MidiMessage &m, Packets &packets) |
Converts a MidiMessage to one or more messages in UMP format, using the MIDI 1.0 Protocol. More... | |
static uint8_t | scaleTo8 (uint8_t word7Bit) |
Widens a 7-bit MIDI 1.0 value to a 8-bit MIDI 2.0 value. More... | |
static uint16_t | scaleTo16 (uint8_t word7Bit) |
Widens a 7-bit MIDI 1.0 value to a 16-bit MIDI 2.0 value. More... | |
static uint16_t | scaleTo16 (uint16_t word14Bit) |
Widens a 14-bit MIDI 1.0 value to a 16-bit MIDI 2.0 value. More... | |
static uint32_t | scaleTo32 (uint8_t word7Bit) |
Widens a 7-bit MIDI 1.0 value to a 32-bit MIDI 2.0 value. More... | |
static uint32_t | scaleTo32 (uint16_t word14Bit) |
Widens a 14-bit MIDI 1.0 value to a 32-bit MIDI 2.0 value. More... | |
static uint8_t | scaleTo7 (uint8_t word8Bit) |
Narrows a 16-bit MIDI 2.0 value to a 7-bit MIDI 1.0 value. More... | |
static uint8_t | scaleTo7 (uint16_t word16Bit) |
Narrows a 16-bit MIDI 2.0 value to a 7-bit MIDI 1.0 value. More... | |
static uint8_t | scaleTo7 (uint32_t word32Bit) |
Narrows a 32-bit MIDI 2.0 value to a 7-bit MIDI 1.0 value. More... | |
static uint16_t | scaleTo14 (uint16_t word16Bit) |
Narrows a 32-bit MIDI 2.0 value to a 14-bit MIDI 1.0 value. More... | |
static uint16_t | scaleTo14 (uint32_t word32Bit) |
Narrows a 32-bit MIDI 2.0 value to a 14-bit MIDI 1.0 value. More... | |
template<typename Callback > | |
static void | midi2ToMidi1DefaultTranslation (const View &v, Callback &&callback) |
Converts UMP messages which may include MIDI 2.0 channel voice messages into equivalent MIDI 1.0 messages (still in UMP format). More... | |
Functions to assist conversion of UMP messages to/from other formats, especially older 'bytestream' formatted MidiMessages.
|
static |
Converts from a MIDI 1 bytestream to MIDI 1 on Universal MIDI Packets.
callback
is a function which accepts a single View argument.
References universal_midi_packets::Utils::bytesToWord(), gl::data, gl::func, universal_midi_packets::SysEx7::getNumPacketsRequiredForDataSize(), gl::m, universal_midi_packets::Factory::makeSysExContinue(), universal_midi_packets::Factory::makeSysExEnd(), universal_midi_packets::Factory::makeSysExIn1Packet(), universal_midi_packets::Factory::makeSysExStart(), gl::mask, and gl::size.
Referenced by universal_midi_packets::ToUMP1Converter::convert(), universal_midi_packets::ToUMP2Converter::convert(), universal_midi_packets::BytestreamToUMPDispatcher::dispatch(), and toMidi1().
|
static |
Converts a MidiMessage to one or more messages in UMP format, using the MIDI 1.0 Protocol.
packets
is an out-param to allow the caller to control allocation/deallocation. Returning a new Packets object would require every call to toMidi1 to allocate. With this version, no allocations will occur, provided that packets
has adequate reserved space.
References universal_midi_packets::Packets::add(), gl::m, and toMidi1().
|
static |
Widens a 7-bit MIDI 1.0 value to a 8-bit MIDI 2.0 value.
References gl::mask.
|
static |
Widens a 7-bit MIDI 1.0 value to a 16-bit MIDI 2.0 value.
References gl::mask.
|
static |
Widens a 14-bit MIDI 1.0 value to a 16-bit MIDI 2.0 value.
References gl::mask.
|
static |
Widens a 7-bit MIDI 1.0 value to a 32-bit MIDI 2.0 value.
References gl::mask.
|
static |
Widens a 14-bit MIDI 1.0 value to a 32-bit MIDI 2.0 value.
References gl::mask.
|
static |
Narrows a 16-bit MIDI 2.0 value to a 7-bit MIDI 1.0 value.
Referenced by midi2ToMidi1DefaultTranslation().
|
static |
Narrows a 16-bit MIDI 2.0 value to a 7-bit MIDI 1.0 value.
|
static |
Narrows a 32-bit MIDI 2.0 value to a 7-bit MIDI 1.0 value.
|
static |
Narrows a 32-bit MIDI 2.0 value to a 14-bit MIDI 1.0 value.
Referenced by midi2ToMidi1DefaultTranslation().
|
static |
Narrows a 32-bit MIDI 2.0 value to a 14-bit MIDI 1.0 value.
|
static |
Converts UMP messages which may include MIDI 2.0 channel voice messages into equivalent MIDI 1.0 messages (still in UMP format).
callback
is a function that accepts a single View argument and will be called with each converted packet.
Note that not all MIDI 2.0 messages have MIDI 1.0 equivalents, so such messages will be ignored.
References universal_midi_packets::Utils::bytesToWord(), gl::data, universal_midi_packets::Utils::getChannel(), universal_midi_packets::Utils::getGroup(), universal_midi_packets::Utils::getMessageType(), universal_midi_packets::Utils::getStatus(), scaleTo14(), scaleTo7(), and gl::v.
Referenced by universal_midi_packets::ToUMP1Converter::convert().