From fbb0acfc94a207b4a0075729baf08cfe8f8b71d3 Mon Sep 17 00:00:00 2001 From: Steve Lascos Date: Sun, 21 Jan 2018 02:44:46 -0500 Subject: [PATCH] Fixes to some midi code --- src/AudioEffectAnalogDelay.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/AudioEffectAnalogDelay.cpp b/src/AudioEffectAnalogDelay.cpp index 73d9b6a..dd216d6 100644 --- a/src/AudioEffectAnalogDelay.cpp +++ b/src/AudioEffectAnalogDelay.cpp @@ -171,16 +171,17 @@ void AudioEffectAnalogDelay::processMidi(int channel, int control, int value) if ((m_midiConfig[MIDI_DELAY][MIDI_CHANNEL] == channel) && (m_midiConfig[MIDI_DELAY][MIDI_CONTROL] == control)) { // Delay - Serial.println(String("AudioEffectAnalogDelay::delay: ") + val); - delay((size_t)(val * m_maxDelaySamples)); + m_maxDelaySamples = m_memory->getSlot()->size(); + Serial.println(String("AudioEffectAnalogDelay::delay: ") + val + String(" out of ") + m_maxDelaySamples); + delay((size_t)(val * (float)m_maxDelaySamples)); return; } if ((m_midiConfig[MIDI_ENABLE][MIDI_CHANNEL] == channel) && (m_midiConfig[MIDI_ENABLE][MIDI_CONTROL] == control)) { // Enable - if (val >= 65) { enable(); Serial.println(String("AudioEffectAnalogDelay::enable: ON") + value); } - else { disable(); Serial.println(String("AudioEffectAnalogDelay::enable: OFF") + value); } + if (value >= 65) { enable(); Serial.println(String("AudioEffectAnalogDelay::enable: ON")); } + else { disable(); Serial.println(String("AudioEffectAnalogDelay::enable: OFF")); } return; }