- MESSAGE_TYPES =
{
utility: 0x0,
system_common: 0x1,
channel_voice_32: 0x2,
data_64: 0x3,
channel_voice_64: 0x4,
data_128: 0x5,
flex_data: 0xD
}.freeze
- WORD_COUNTS =
{
utility: 1,
system_common: 1,
channel_voice_32: 1,
data_64: 2,
channel_voice_64: 2,
data_128: 4,
flex_data: 4
}.freeze
- STATUS_NIBBLES =
{
note_off: 0x8,
note_on: 0x9,
poly_pressure: 0xA,
control_change: 0xB,
program_change: 0xC,
channel_pressure: 0xD,
pitch_bend: 0xE
}.freeze
- STATUS_BY_NIBBLE =
STATUS_NIBBLES.invert.freeze
- SYSTEM_COMMON_STATUSES =
{
0xF1 => :time_code,
0xF2 => :song_position,
0xF3 => :song_select,
0xF6 => :tune_request,
0xF8 => :clock,
0xFA => :start,
0xFB => :continue,
0xFC => :stop,
0xFE => :active_sensing,
0xFF => :system_reset
}.freeze
- DATA_PACKET_FORMATS =
{
complete: 0x0,
start: 0x1,
continue: 0x2,
end: 0x3
}.freeze
- DATA_PACKET_FORMAT_BY_NIBBLE =
DATA_PACKET_FORMATS.invert.freeze
- CHANNEL_VOICE_32_STATUSES =
%i[
note_off note_on poly_pressure control_change program_change channel_pressure pitch_bend
].freeze
- CHANNEL_VOICE_64_STATUSES =
%i[
note_off note_on poly_pressure control_change program_change channel_pressure pitch_bend
].freeze
- MIDI1_CHANNEL_VOICE_TO_UMP =
{
Channel::NoteOff => {status: :note_off, data: :note, value: :velocity, scale: :scale_7_to_16},
Channel::NoteOn => {status: :note_on, data: :note, value: :velocity, scale: :scale_7_to_16},
Channel::PolyphonicPressure => {status: :poly_pressure, data: :note, value: :pressure, scale: :scale_7_to_16},
Channel::ControlChange => {status: :control_change, data: :cc, value: :value, scale: :scale_7_to_32},
Channel::ProgramChange => {status: :program_change, data: :program},
Channel::ChannelPressure => {status: :channel_pressure, value: :pressure, scale: :scale_7_to_32},
Channel::PitchBend => {status: :pitch_bend, value: :value, scale: :scale_14_to_32}
}.freeze
- UMP_CHANNEL_VOICE_TO_MIDI1 =
{
note_off: {class: Channel::NoteOff, fields: {note: :note, velocity: [:velocity, :scale_16_to_7]}},
note_on: {class: Channel::NoteOn, fields: {note: :note, velocity: [:velocity, :scale_16_to_7]}},
poly_pressure: {
class: Channel::PolyphonicPressure,
fields: {note: :note, pressure: [:velocity, :scale_16_to_7]}
},
control_change: {class: Channel::ControlChange, fields: {cc: :note, value: [:velocity, :scale_32_to_7]}},
program_change: {class: Channel::ProgramChange, fields: {program: :note}},
channel_pressure: {class: Channel::ChannelPressure, fields: {pressure: [:velocity, :scale_32_to_7]}},
pitch_bend: {class: Channel::PitchBend, fields: {value: [:velocity, :scale_32_to_14]}}
}.freeze