| 376 | } |
| 377 | |
| 378 | void 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 | |
| 399 | void MidiController::OnMidiControl(MidiControl& control) |
| 400 | { |
no test coverage detected