aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--examples/demo.scm2
-rw-r--r--guile/guile-midi/control.scm8
2 files changed, 9 insertions, 1 deletions
diff --git a/examples/demo.scm b/examples/demo.scm
index 1ff0832..457718d 100644
--- a/examples/demo.scm
+++ b/examples/demo.scm
@@ -10,7 +10,7 @@
(start-ola-output)
(start-midi-control "/dev/snd/midiC1D0")
-
+(all-notes-off! 14)
;; Light up some LEDs on the MIDI controller
(define led1
diff --git a/guile/guile-midi/control.scm b/guile/guile-midi/control.scm
index e3ff848..548eead 100644
--- a/guile/guile-midi/control.scm
+++ b/guile/guile-midi/control.scm
@@ -9,6 +9,7 @@
get-controller-value
make-midi-led
set-midi-led!
+ all-notes-off!
register-midi-note-callback!))
@@ -114,6 +115,13 @@
0)))
+(define (all-notes-off! channel)
+ (let again ((l 0))
+ (enqueue-midi-bytes! (+ #b10000000 channel) l 0)
+ (unless (= l 127)
+ (again (+ l 1)))))
+
+
(define (handle-cc-change! channel cc-number value)
(for-each (lambda (a)
(atomic-box-set! (get-value-box a) value))