Firmware for HexBoard MIDI controller
Mono Synth mode: Don't switch notes when you release unheld note
| -rw-r--r-- | HexBoard.ino | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/HexBoard.ino b/HexBoard.ino index ee7a6b9..5ba3893 100644 --- a/HexBoard.ino +++ b/HexBoard.ino @@ -1812,6 +1812,7 @@ return n; } void replaceMonoSynthWith(byte x) { + if (arpeggiatingNow == x) return; h[arpeggiatingNow].synthCh = 0; arpeggiatingNow = x; if (arpeggiatingNow != UNUSED_NOTE) { @@ -1879,7 +1880,9 @@ void trySynthNoteOff(byte x) { if (playbackMode && (playbackMode != SYNTH_POLY)) { - replaceMonoSynthWith(findNextHeldNote()); + if (arpeggiatingNow == x) { + replaceMonoSynthWith(findNextHeldNote()); + } } if (playbackMode == SYNTH_POLY) { if (h[x].synthCh) { @@ -1909,10 +1912,7 @@ if (playbackMode == SYNTH_ARPEGGIO) { if (runTime - arpeggiateTime > arpeggiateLength) { arpeggiateTime = runTime; - byte x = findNextHeldNote(); - if (x != arpeggiatingNow) { - replaceMonoSynthWith(x); - } + replaceMonoSynthWith(findNextHeldNote()); } } } |