aboutsummaryrefslogtreecommitdiff
path: root/guile/starlet/midi-control/base.scm
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2021-09-11 12:15:14 +0200
committerThomas White <taw@physics.org>2021-09-11 12:19:41 +0200
commit3c4c9a2c89defe50ad40c544e383f50eb0aa040e (patch)
tree71ecb33c51c7b253c5c6d31b40fff662436d1d02 /guile/starlet/midi-control/base.scm
parentd79c75b3db76e242e0299d5d324191e3133de235 (diff)
Re-assert MIDI control map on parameter change
This makes the MIDI controller stay in sync with the programmer state values. It's kind of a coarse solution, though. It would be better to: 1. Only re-assert the map if the changed parameter currently appears on the MIDI control surface 2. Only re-assert the part of the map related to the parameter Almost as a side-effect, this enables switching between multiple control maps. Just call 'set-midi-control-map!' on the controller with the new map.
Diffstat (limited to 'guile/starlet/midi-control/base.scm')
-rw-r--r--guile/starlet/midi-control/base.scm11
1 files changed, 9 insertions, 2 deletions
diff --git a/guile/starlet/midi-control/base.scm b/guile/starlet/midi-control/base.scm
index 08310ae..9363e81 100644
--- a/guile/starlet/midi-control/base.scm
+++ b/guile/starlet/midi-control/base.scm
@@ -33,7 +33,9 @@
send-note-off
register-midi-note-callback!
register-midi-cc-callback!
- remove-midi-callback!))
+ remove-midi-callback!
+ get-parameter-controller
+ set-parameter-controller!))
(define-class <midi-control-surface> (<object>)
@@ -52,7 +54,12 @@
(send-queue
#:init-form (make-atomic-box '())
- #:getter get-send-queue))
+ #:getter get-send-queue)
+
+ (parameter-controller
+ #:init-value #f
+ #:getter get-parameter-controller
+ #:setter set-parameter-controller!))
(define-class <midi-callback> (<object>)