Browse Source

very right playback: sent off msg on release

BuildTools 10 years ago
parent
commit
e75c6a22ef
1 changed files with 10 additions and 0 deletions
  1. 10 0
      PlaybackScreen.cpp

+ 10 - 0
PlaybackScreen.cpp

@@ -85,6 +85,16 @@ void PlaybackScreen::keyPressed(unsigned char x, unsigned char y)
 
 void PlaybackScreen::keyReleased(unsigned char x, unsigned char y)
 {
+    if(x == 8) { // very right
+        if(y < sequencer.messages.size()) {
+            std::shared_ptr<midi::NoteOnMessage> msgOn_ptr
+                = std::dynamic_pointer_cast<midi::NoteOnMessage>(sequencer.messages[y]);
+            if(msgOn_ptr) {
+                sequencer.midiOut.sendMessage(msgOn_ptr->toOffMessage(0));
+            }
+        }
+    }
+
     refreshAll();
 }