One layer controlling a second layer

Write here what nice effects or shows you have done with MADRIX or ask other users.

Moderator: MADRIX Team

Locked
cinetron
Posts: 8
Joined: Wed Oct 01, 2014 6:40 pm

One layer controlling a second layer

Post 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
Guertler
Support
Support
Posts: 882
Joined: Tue Feb 04, 2014 10:47 am

Re: One layer controlling a second layer

Post 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.
cinetron
Posts: 8
Joined: Wed Oct 01, 2014 6:40 pm

Re: One layer controlling a second layer

Post 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
User avatar
Wissmann
Developer
Developer
Posts: 770
Joined: Fri Feb 23, 2007 3:36 pm
Location: Germany
Contact:

Re: One layer controlling a second layer

Post 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?
LEDs are nothing without control ;-)
Locked