diff options
-rw-r--r-- | guile/starlet/base.scm | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/guile/starlet/base.scm b/guile/starlet/base.scm index 0681da8..d3cc94d 100644 --- a/guile/starlet/base.scm +++ b/guile/starlet/base.scm @@ -379,14 +379,14 @@ ;; Helper function to set 8-bit DMX value (define (set-chan relative-channel-number value) - (set-dmx (get-fixture-universe fix) - (+ (get-fixture-addr fix) - (- relative-channel-number 1)) - value)) + (set-dmx (get-fixture-universe fix) + (+ (get-fixture-addr fix) + (- relative-channel-number 1)) + value)) ;; Helper function to set 16-bit DMX value (define (set-chan-16bit relative-channel-number value max-value) - (let ((val16 (* value (/ 65535 max-value)))) + (let ((val16 (* (min value max-value) (/ 65535 max-value)))) (set-chan relative-channel-number (msb val16)) (set-chan (+ relative-channel-number 1) (lsb val16)))) |