| 397 | } |
| 398 | |
| 399 | void 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 | |
| 427 | void MidiController::OnMidiPressure(MidiPressure& pressure) |
| 428 | { |
no test coverage detected