MADRIX Forum • One layer controlling a second layer
Page 1 of 1

One layer controlling a second layer

Posted: Tue Feb 17, 2015 9:25 am
by cinetron
Hello, I am using 2 layers each with an MAS scipt. When the top layer script is finished I would like it to instruct the bottom layer script to restart. Basically I have a moving pattern on top of a field of lights. I want to top layer to move a certain amount and then tell the bottom layer to pick a new random color. I'm unsure the best way to do this as it seems the layers run independently. Thanks

Re: One layer controlling a second layer

Posted: Tue Feb 17, 2015 1:28 pm
by Guertler
Hello cinetron,
.
At the moment there is no official way to communicate between several MAS scripts in MADRIX.
.
But you can consider the following trick which can help you to get the requested result.
You can missues a channel of the MADRIX "DMX Fader Tool". With the help of the fader you can set values with the script of the first layer and get the values with the script of the second layer. Therefor you have to ensure that the desired fader of the "DMX Fader Tool" is enabled and set to a channel which is not used in MADRIX. But the universe should be assigned to an used DMX universe in MADRIX. To set the value of a desired fader with the MADRIX script you have to use the following function:
"void SetDmxFaderValue(int fader, int value)".
To get the value of a desired fader you have to use the following function:
"int GetDmxFaderValue(int fader)"
.
Please keep in mind: This is just a way where you can get the requested result. But it is not a pretty one.

Re: One layer controlling a second layer

Posted: Tue Feb 17, 2015 6:01 pm
by cinetron
Thanks for the quick reply. Will this work without a DMX device plugged in? It would be nice if Madrix supported OSC for such occasions. Just curious if the same trick can be used with MIDI ?. Also am I correct in thinking there is no way to have 2 layers in a single script? I want to be able to fade my top pattern into an underlying color. The top color and bottom color are different and change on a regular basis.
Thanks

Re: One layer controlling a second layer

Posted: Wed Feb 18, 2015 9:42 am
by Wissmann
Just a question,
why it is not possible to achieve what you have in mind with just one script?
With other words why did you use two scripts instead one script which do the job of this two scripts?