MCPcopy Create free account
hub / github.com/DISTRHO/DPF / sendNote

Method sendNote

distrho/src/DistrhoUILV2.cpp:434–454  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

432
433 #if DISTRHO_PLUGIN_WANT_MIDI_INPUT
434 void sendNote(const uint8_t channel, const uint8_t note, const uint8_t velocity)
435 {
436 DISTRHO_SAFE_ASSERT_RETURN(fWriteFunction != nullptr,);
437
438 if (channel > 0xF)
439 return;
440
441 const uint32_t eventInPortIndex = DISTRHO_PLUGIN_NUM_INPUTS + DISTRHO_PLUGIN_NUM_OUTPUTS;
442
443 LV2_Atom_MidiEvent atomMidiEvent;
444 atomMidiEvent.atom.size = 3;
445 atomMidiEvent.atom.type = fURIDs.midiEvent;
446
447 atomMidiEvent.data[0] = channel + (velocity != 0 ? 0x90 : 0x80);
448 atomMidiEvent.data[1] = note;
449 atomMidiEvent.data[2] = velocity;
450
451 // send to DSP side
452 fWriteFunction(fController, eventInPortIndex, lv2_atom_total_size(&atomMidiEvent.atom),
453 fURIDs.atomEventTransfer, &atomMidiEvent);
454 }
455
456 static void sendNoteCallback(void* const ptr, const uint8_t channel, const uint8_t note, const uint8_t velocity)
457 {

Callers 1

sendNoteCallbackMethod · 0.45

Calls 1

lv2_atom_total_sizeFunction · 0.85

Tested by

no test coverage detected