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

Method OnMidiControl

Source/MidiController.cpp:399–425  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

397}
398
399void MidiController::OnMidiControl(MidiControl& control)
400{
401 if (!mEnabled || (mChannelFilter != ChannelFilter::kAny && control.mChannel != (int)mChannelFilter))
402 return;
403
404 int voiceIdx = -1;
405
406 if (mUseChannelAsVoice)
407 voiceIdx = control.mChannel - 1;
408
409 if (control.mControl == mModwheelCC)
410 {
411 //if (mModwheelCC == 74) //MPE
412 // mModulation.GetModWheel(voiceIdx)->SetValue((control.mValue-63) / 127.0f * 2);
413 //else
414 mModulation.GetModWheel(voiceIdx)->SetValue(control.mValue / 127.0f);
415 }
416
417 MidiReceived(kMidiMessage_Control, control.mControl, control.mValue / 127.0f, control.mValue, control.mChannel);
418
419 mQueuedMessageMutex.lock();
420 mQueuedControls.push_back(control);
421 mQueuedMessageMutex.unlock();
422
423 if (mPrintInput)
424 ofLog() << Name() << " control: " << control.mControl << ", " << control.mValue;
425}
426
427void MidiController::OnMidiPressure(MidiPressure& pressure)
428{

Callers 1

OnTransportAdvancedMethod · 0.45

Calls 3

ofLogClass · 0.85
SetValueMethod · 0.45
GetModWheelMethod · 0.45

Tested by

no test coverage detected