Fixes to some midi code

master
Steve Lascos 7 years ago
parent 61d45bff5f
commit fbb0acfc94
  1. 9
      src/AudioEffectAnalogDelay.cpp

@ -171,16 +171,17 @@ void AudioEffectAnalogDelay::processMidi(int channel, int control, int value)
if ((m_midiConfig[MIDI_DELAY][MIDI_CHANNEL] == channel) && if ((m_midiConfig[MIDI_DELAY][MIDI_CHANNEL] == channel) &&
(m_midiConfig[MIDI_DELAY][MIDI_CONTROL] == control)) { (m_midiConfig[MIDI_DELAY][MIDI_CONTROL] == control)) {
// Delay // Delay
Serial.println(String("AudioEffectAnalogDelay::delay: ") + val); m_maxDelaySamples = m_memory->getSlot()->size();
delay((size_t)(val * m_maxDelaySamples)); Serial.println(String("AudioEffectAnalogDelay::delay: ") + val + String(" out of ") + m_maxDelaySamples);
delay((size_t)(val * (float)m_maxDelaySamples));
return; return;
} }
if ((m_midiConfig[MIDI_ENABLE][MIDI_CHANNEL] == channel) && if ((m_midiConfig[MIDI_ENABLE][MIDI_CHANNEL] == channel) &&
(m_midiConfig[MIDI_ENABLE][MIDI_CONTROL] == control)) { (m_midiConfig[MIDI_ENABLE][MIDI_CONTROL] == control)) {
// Enable // Enable
if (val >= 65) { enable(); Serial.println(String("AudioEffectAnalogDelay::enable: ON") + value); } if (value >= 65) { enable(); Serial.println(String("AudioEffectAnalogDelay::enable: ON")); }
else { disable(); Serial.println(String("AudioEffectAnalogDelay::enable: OFF") + value); } else { disable(); Serial.println(String("AudioEffectAnalogDelay::enable: OFF")); }
return; return;
} }

Loading…
Cancel
Save