MayaFlux 0.2.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ fire_midi_callbacks()

void MayaFlux::Nodes::Input::MIDINode::fire_midi_callbacks ( const Core::InputValue::MIDIMessage midi)
private

Definition at line 100 of file MIDINode.cpp.

101{
102 uint8_t msg_type = midi.type();
103
104 switch (msg_type) {
105 case 0x90:
106 for (const auto& cb : m_note_callbacks) {
107 bool is_on = midi.data2 > 0; // velocity 0 = note off
108 cb(midi.data1, midi.data2, is_on);
109 }
110 break;
111
112 case 0x80:
113 for (const auto& cb : m_note_callbacks) {
114 cb(midi.data1, 0, false);
115 }
116 break;
117
118 case 0xB0:
119 for (const auto& cb : m_cc_callbacks) {
120 cb(midi.data1, midi.data2);
121 }
122 break;
123
124 case 0xE0:
125 for (const auto& cb : m_pitch_bend_callbacks) {
126 int16_t bend = ((midi.data2 << 7) | midi.data1) - 8192;
127 cb(bend);
128 }
129 break;
130
131 default:
132 break;
133 }
134}
std::vector< PitchBendCallback > m_pitch_bend_callbacks
Definition MIDINode.hpp:188
std::vector< CC_Callback > m_cc_callbacks
Definition MIDINode.hpp:187
std::vector< NoteCallback > m_note_callbacks
Definition MIDINode.hpp:186

References MayaFlux::Core::InputValue::MIDIMessage::data1, MayaFlux::Core::InputValue::MIDIMessage::data2, m_cc_callbacks, m_note_callbacks, m_pitch_bend_callbacks, and MayaFlux::Core::InputValue::MIDIMessage::type().

Referenced by notify_tick().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: