about summary refs log tree commit diff
diff options
context:
space:
mode:
authorZach DeCook <zachdecook@librem.one>2023-07-07 12:46:33 -0400
committerZach DeCook <zachdecook@librem.one>2023-07-07 12:46:33 -0400
commit8df171389fc889f17bd8c29574795c6131cdc60c (patch)
tree5567829ed4713d93c9d7072fed7698eb8915e7f7
parent9f63868e7f101406cab05bb03120c6f4e71556a0 (diff)
downloadHexBoard-8df171389fc889f17bd8c29574795c6131cdc60c.tar.gz
Scale lock: Fix for released notes in buzzer mode
-rw-r--r--HexBoard_V1.1.ino3
1 files changed, 2 insertions, 1 deletions
diff --git a/HexBoard_V1.1.ino b/HexBoard_V1.1.ino
index 24533a1..7ed5ca2 100644
--- a/HexBoard_V1.1.ino
+++ b/HexBoard_V1.1.ino
@@ -900,7 +900,8 @@ void sequencerPlayNextNote() {
 byte getHeldNote() {
   for (int i = 0; i < elementCount; i++) {
     if (activeButtons[i]) {
-      if (currentLayout[i] < 128) {
+      byte note = (currentLayout[i] - key + transpose) % 12;
+      if (currentLayout[i] < 128 && isNotePlayable(note)) {
         return (currentLayout[i] + transpose) % 128;
       }
     }