diff options
author | Thomas White <taw@physics.org> | 2023-06-05 15:47:04 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2023-06-05 15:47:04 +0200 |
commit | 24502ae320086d927dd6a7eb523a2cb6d7e5e308 (patch) | |
tree | f6c5724517ec94883ed9ada976712e9eda052c6f /guile/starlet | |
parent | 5f0c6fca0e0638296fd57e2905a2781c271af46c (diff) |
Fixture library: <stairville-z120m-6ch>: Add white-weirdness attribute
Diffstat (limited to 'guile/starlet')
-rw-r--r-- | guile/starlet/attributes.scm | 1 | ||||
-rw-r--r-- | guile/starlet/fixture-library/stairville/z120m.scm | 16 |
2 files changed, 15 insertions, 2 deletions
diff --git a/guile/starlet/attributes.scm b/guile/starlet/attributes.scm index 6caae96..e139040 100644 --- a/guile/starlet/attributes.scm +++ b/guile/starlet/attributes.scm @@ -92,6 +92,7 @@ (define-attribute animation-wheel-speed "Animation wheel rotation speed and direction (+/- percentage of fastest, clockwise)") (define-attribute rotating-gobo "Rotating gobo selection (#f or gobo name)") (define-attribute rotating-gobo-speed "Gobo rotation speed (+/- percentage of maximum speed, clockwise)") +(define-attribute white-weirdness "Weirdness of white (percentage of maximum weirdness)") ;; Duplicate names for convenience... (define-public color colour) diff --git a/guile/starlet/fixture-library/stairville/z120m.scm b/guile/starlet/fixture-library/stairville/z120m.scm index e1f40af..00fb476 100644 --- a/guile/starlet/fixture-library/stairville/z120m.scm +++ b/guile/starlet/fixture-library/stairville/z120m.scm @@ -26,6 +26,16 @@ #:use-module (starlet colours) #:export (<stairville-z120m-6ch>)) + +(define (colour-as-rgbw-weirdness col weirdness) + (let ((rgb (colour-as-rgb col))) + (let ((w (* (- 1 weirdness) (apply min rgb)))) + (list (- (red rgb) w) + (- (green rgb) w) + (- (blue rgb) w) + w)))) + + (define-fixture <stairville-z120m-6ch> @@ -34,10 +44,12 @@ (attr-continuous intensity '(0 100) 0) (attr-colour colour white) (attr-continuous strobe-frequency '(1 25) 1) - (attr-list strobe '(off on random) 'off)) + (attr-list strobe '(off on random) 'off) + (attr-continuous white-weirdness '(0 100) 0)) (let ((intensity (get-attr intensity)) - (rgbw (colour-as-rgbw (get-attr colour)))) + (rgbw (colour-as-rgbw-weirdness (get-attr colour) + (/ (get-attr white-weirdness) 100)))) (set-chan8 1 (percent->dmxval8 intensity)) (set-chan8 3 (percent->dmxval8 (car rgbw))) (set-chan8 4 (percent->dmxval8 (cadr rgbw))) |