Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A test run of transform-colors #12

Closed
dandaka opened this issue Dec 6, 2015 · 2 comments · Fixed by #15
Closed

A test run of transform-colors #12

dandaka opened this issue Dec 6, 2015 · 2 comments · Fixed by #15
Labels

Comments

@dandaka
Copy link
Contributor

dandaka commented Dec 6, 2015

I follow this guideline
https://github.com/brunchboy/afterglow/blob/master/doc/effects.adoc#layering-effects

I want to use transform-colors function to change colors in current show.

lights.my-show=> (color-fx/transform-colors (show/all-fixtures) :priority 1000)
(color-fx/transform-colors (show/all-fixtures) :priority 1000)
#afterglow.effects.Effect{:name "Transform Colors", :active-fn #object[afterglow.effects$always_active 0x3ba17151 "afterglow.effects$always_active@3ba17151"], :gen-fn #object[afterglow.effects.color$transform_colors$fn__16361 0x2d035551 "afterglow.effects.color$transform_colors$fn__16361@2d035551"], :end-fn #object[afterglow.effects$end_immediately 0x6d6ae297 "afterglow.effects$end_immediately@6d6ae297"]}

Nothing changes in the show. I have a guess, that this function can be used only with cue. Is that correct?

I guess this from following example:

(ct/set-cue! (:cue-grid *show*) 2 7
             (cues/cue :transform-colors (fn [_] (color-fx/transform-colors
                                                  (show/all-fixtures)))
                       :priority 1000))

Is there any way to test transform-colors without creating a cue?

@brunchboy
Copy link
Member

transform-colors creates an effect (which you can see by the type of what it returns in your example above), so to do something this effect needs to be added to the running show, using show/add-effect!. Cues automatically create and add the effects they are configured with when they are activated, and end the effects when they are deactivated. In other words, cues are a way to conveniently create and control effects using MIDI controllers or the web UI. But you can manually create and add the effect from the REPL as well; that is the only step you were missing above. Try calling show/add-effect! with the results of calling transform-colors.

@brunchboy
Copy link
Member

(And then, when you want to end that effect, call show/end-effect! using the same keyword you assigned the effect when you added it with add-effect!.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants