aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2023-06-26 21:57:28 +0200
committerThomas White <taw@physics.org>2023-06-26 21:57:28 +0200
commit43fcadb4b9acf36ab96cd54f29b7de1cf933e2a2 (patch)
treedaa870c0a5927ac41bc4a48492e6cd3dcd9d20ed
parent70e530da986679854a3cf3158aa2d60611f134ac (diff)
osc-smart-potentiometer: Don't attempt to calculate gradients with empty fixture list
-rw-r--r--guile/starlet/open-sound-control/utils.scm11
1 files changed, 6 insertions, 5 deletions
diff --git a/guile/starlet/open-sound-control/utils.scm b/guile/starlet/open-sound-control/utils.scm
index 4e6a3db..d89665c 100644
--- a/guile/starlet/open-sound-control/utils.scm
+++ b/guile/starlet/open-sound-control/utils.scm
@@ -263,11 +263,12 @@
(let ((set-gradients
(lambda ()
- (set! initial-vals (current-values fixtures attr-name))
- (set! congruent-val (fader-congruent initial-vals attrs))
- (set! up-gradients (fader-up-gradients initial-vals attrs congruent-val))
- (set! dn-gradients (fader-down-gradients initial-vals attrs congruent-val))
- (osc-send addr (string-append potentiometer "/set-pickup") congruent-val))))
+ (unless (nil? fixtures)
+ (set! initial-vals (current-values fixtures attr-name))
+ (set! congruent-val (fader-congruent initial-vals attrs))
+ (set! up-gradients (fader-up-gradients initial-vals attrs congruent-val))
+ (set! dn-gradients (fader-down-gradients initial-vals attrs congruent-val))
+ (osc-send addr (string-append potentiometer "/set-pickup") congruent-val)))))
(add-and-run-hook!
selection-hook