diff options
author | Vitaly Novichkov <admin@wohlnet.ru> | 2018-05-31 03:36:40 +0300 |
---|---|---|
committer | Vitaly Novichkov <admin@wohlnet.ru> | 2018-05-31 03:36:40 +0300 |
commit | 17127e55c549ea59bb43bb6da7d06f11fd84db53 (patch) | |
tree | 353e15187ffcf67cb24696be8d0a4eab43667a46 /src/adlmidi_private.hpp | |
parent | 91d6cdb84996710e993ccdf85203ac65c3238457 (diff) | |
download | libADLMIDI-17127e55c549ea59bb43bb6da7d06f11fd84db53.tar.gz libADLMIDI-17127e55c549ea59bb43bb6da7d06f11fd84db53.tar.bz2 libADLMIDI-17127e55c549ea59bb43bb6da7d06f11fd84db53.zip |
Implement correct support for after-touch feature
Diffstat (limited to 'src/adlmidi_private.hpp')
-rw-r--r-- | src/adlmidi_private.hpp | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/src/adlmidi_private.hpp b/src/adlmidi_private.hpp index b20a2b4..0e3affe 100644 --- a/src/adlmidi_private.hpp +++ b/src/adlmidi_private.hpp @@ -505,7 +505,13 @@ public: uint8_t bank_lsb, bank_msb; uint8_t patch; uint8_t volume, expression; - uint8_t panning, vibrato, sustain; + uint8_t panning, vibrato, aftertouch, sustain; + //! Per note Aftertouch values + uint8_t noteAftertouch[128]; + //! Zero-filled array. Is used to compare with note aftertouch range + uint8_t noteAftertouch_Zero[128]; + //! Is note aftertouch has any non-zero value + bool noteAfterTouchInUse; char ____padding[6]; double bend, bendsense; int bendsense_lsb, bendsense_msb; @@ -521,7 +527,8 @@ public: bool active; // Current pressure uint8_t vol; - char ____padding[1]; + // Note vibrato (a part of Note Aftertouch feature) + uint8_t vibrato; // Tone selected on noteon: int16_t tone; char ____padding2[4]; @@ -617,7 +624,7 @@ public: for(++ptr; ptr && !ptr->active;) ptr = (ptr->note == 127) ? 0 : (ptr + 1); return *this; - }; + } activenoteiterator operator++(int) { activenoteiterator pos = *this; @@ -708,6 +715,10 @@ public: expression = 127; sustain = 0; vibrato = 0; + aftertouch = 0; + std::memset(noteAftertouch, 0, 128); + std::memset(noteAftertouch_Zero, 0, 128); + noteAfterTouchInUse = false; vibspeed = 2 * 3.141592653 * 5.0; vibdepth = 0.5 / 127; vibdelay = 0; @@ -715,6 +726,10 @@ public: portamento = 0; brightness = 127; } + bool hasVibrato() + { + return (vibrato > 0) || (aftertouch > 0) || noteAfterTouchInUse; + } void updateBendSensitivity() { int cent = bendsense_msb * 100 + bendsense_lsb; |