diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/adlmidi_midiplay.cpp | 7 | ||||
-rw-r--r-- | src/adlmidi_private.hpp | 2 |
2 files changed, 9 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); diff --git a/src/adlmidi_private.hpp b/src/adlmidi_private.hpp index 1d68bae..840ba21 100644 --- a/src/adlmidi_private.hpp +++ b/src/adlmidi_private.hpp @@ -352,6 +352,7 @@ public: uint8_t panning, vibrato, aftertouch; uint16_t portamento; bool sustain; + bool softPedal; bool portamentoEnable; int8_t portamentoSource; // note number or -1 double portamentoRate; @@ -566,6 +567,7 @@ public: volume = 100; expression = 127; sustain = false; + softPedal = false; vibrato = 0; aftertouch = 0; std::memset(noteAftertouch, 0, 128); |