From 2f6cae8e64ca57a2515d27274b85d5f5986aaebc Mon Sep 17 00:00:00 2001 From: Thomas White Date: Thu, 3 Jun 2021 15:39:30 +0200 Subject: Update demo.scm to show off patch-many --- examples/demo.scm | 41 +++++++++++++++++------------------------ 1 file changed, 17 insertions(+), 24 deletions(-) diff --git a/examples/demo.scm b/examples/demo.scm index 1c3ba68..4550bea 100644 --- a/examples/demo.scm +++ b/examples/demo.scm @@ -46,21 +46,22 @@ (start-midi-control "/dev/snd/midiC0D0" #:channel 14) -;; Fixtures are normal GOOPS objects, fixture types are GOOPS classes -(patch-fixture! foh1 8) -(patch-fixture! foh2 7) -(patch-fixture! foh3 6) -(patch-fixture! foh4 5) -(patch-fixture! foh5 4) -(patch-fixture! foh6 3) -(patch-fixture! foh7 2) -(patch-fixture! foh8 1) +;; Fixtures are normal GOOPS objects, fixture types are GOOPS classes (patch-fixture! red1 9) (patch-fixture! red2 13) (patch-fixture! red3 20) (patch-fixture! red4 24) +(patch-fixture! led 1 #:universe 4) + + +;; Multiple fixtures can be defined at once +;; Example: Eight dimmers on channels 1-8 of universe 0 +(patch-many! foh (iota 8 1)) + + +;; Define many more fixtures (patch-fixture! ltruss1 1 #:universe 1) (patch-fixture! ltruss2 39 #:universe 1) (patch-fixture! ltruss3 77 #:universe 1) @@ -82,10 +83,9 @@ (patch-fixture! floor5 236) (patch-fixture! floor6 270) -(patch-fixture! led 1 #:universe 4) ;; Set a parameter -(at foh1 'intensity 80) +(at foh 'intensity 80) (at floor4 'intensity 100) (at floor4 'colour (make-colour-rgb 0 100 0)) @@ -96,9 +96,11 @@ ;; Functions can be assigned to parameters (let ((clock (make-clock))) - (at foh1 'intensity (lambda () - (* 50 - (+ 1 (sin (* 2 (elapsed-time clock)))))))) + (at (list-ref foh 0) + 'intensity + (lambda () + (* 50 + (+ 1 (sin (* 2 (elapsed-time clock)))))))) ;; Effects library @@ -139,15 +141,6 @@ red3 red4)) -(define foh (list foh1 - foh2 - foh3 - foh4 - foh5 - foh6 - foh7 - foh8)) - (at red 100) (at rtruss 100) (at rtruss 'zoom 80) @@ -289,7 +282,7 @@ #:ready-note 68) (select-on-button 33 rtruss #:ready-note 69) -(select-on-button 34 foh3 +(select-on-button 34 foh #:ready-note 70) (select-on-button 35 floor #:ready-note 71) -- cgit v1.2.3