MCPcopy Create free account
hub / github.com/BespokeSynth/BespokeSynth / OnMidiNote

Method OnMidiNote

Source/MidiController.cpp:378–397  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

376}
377
378void MidiController::OnMidiNote(MidiNote& note)
379{
380 if (!mEnabled || (mChannelFilter != ChannelFilter::kAny && note.mChannel != (int)mChannelFilter))
381 return;
382
383 if (mUseChannelAsVoice && note.mVelocity > 0)
384 {
385 int voiceIdx = note.mChannel - 1;
386 mModulation.GetPitchBend(voiceIdx)->SetValue(0);
387 }
388
389 MidiReceived(kMidiMessage_Note, note.mPitch, note.mVelocity / 127.0f, note.mVelocity, note.mChannel);
390
391 mQueuedMessageMutex.lock();
392 mQueuedNotes.push_back(note);
393 mQueuedMessageMutex.unlock();
394
395 if (mPrintInput)
396 ofLog() << Name() << " note: " << note.mPitch << ", " << note.mVelocity;
397}
398
399void MidiController::OnMidiControl(MidiControl& control)
400{

Callers 1

OnTransportAdvancedMethod · 0.45

Calls 3

ofLogClass · 0.85
SetValueMethod · 0.45
GetPitchBendMethod · 0.45

Tested by

no test coverage detected