diff options
author | Vitaly Novichkov <admin@wohlnet.ru> | 2018-06-23 09:01:35 +0300 |
---|---|---|
committer | Vitaly Novichkov <admin@wohlnet.ru> | 2018-06-23 09:01:35 +0300 |
commit | efbbd382b84b73d706a16fb54c51bf48df7b22cf (patch) | |
tree | a74b62392daac515a7e5f9a8845d1f3977b8f146 /src/adlmidi_midiplay.cpp | |
parent | 128c07275d7e48675113f67e2cb945b53109cb7b (diff) | |
download | libADLMIDI-efbbd382b84b73d706a16fb54c51bf48df7b22cf.tar.gz libADLMIDI-efbbd382b84b73d706a16fb54c51bf48df7b22cf.tar.bz2 libADLMIDI-efbbd382b84b73d706a16fb54c51bf48df7b22cf.zip |
Added support for CC67-SoftPedal
Diffstat (limited to 'src/adlmidi_midiplay.cpp')
-rw-r--r-- | src/adlmidi_midiplay.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/adlmidi_midiplay.cpp b/src/adlmidi_midiplay.cpp index d4bb4ff..a044859 100644 --- a/src/adlmidi_midiplay.cpp +++ b/src/adlmidi_midiplay.cpp @@ -464,6 +464,9 @@ bool MIDIplay::realTime_NoteOn(uint8_t channel, uint8_t note, uint8_t velocity) //if(hooks.onDebugMessage) // hooks.onDebugMessage(hooks.onDebugMessage_userData, "i1=%d:%d, i2=%d:%d", i[0],adlchannel[0], i[1],adlchannel[1]); + if(midiChan.softPedal) // Apply Soft Pedal level reducing + velocity = static_cast<uint8_t>(std::floor(static_cast<float>(velocity) * 0.8f)); + // Allocate active note for MIDI channel std::pair<MIDIchannel::activenoteiterator, bool> ir = midiChan.activenotes_insert(note); @@ -598,6 +601,10 @@ void MIDIplay::realTime_Controller(uint8_t channel, uint8_t type, uint8_t value) KillSustainingNotes(channel, -1, AdlChannel::LocationData::Sustain_Sostenuto); break; + case 67: // Enable/disable soft-pedal + Ch[channel].softPedal = (value >= 64); + break; + case 11: // Change expression (another volume factor) Ch[channel].expression = value; NoteUpdate_All(channel, Upd_Volume); |