PARAM_MULTI_LINK
This element connects multiple source parameters to multiple target parameters: whenever one of the 'from' parameters changes, the 'to' parameters take the 'from' parameter value modified by the 'response_curve' and mux_function functions.
For simple scenarios (single to single param link) use PARAM_LINK or PARAM_CONNECTION.
Attributes brief detailed show all inherited
Examples
In comparison to PARAM_LINK this can quickly link a single source PARAM to multiple target params:
- <!-- create a param -->
- <PARAM id="color_intensity" min="0" max="1" default="0" />
- <!-- link single-to-many -->
- <PARAM_MULTI_LINK from="color_intensity" to="widgetA.background_color.r;widgetB.background_color.g;widgetC.background_color.b" />
- <!-- three squares -->
- <ROW spacing="10">
- <WIDGET id="widgetA" background_color="#000000" width="20" height="20" />
- <WIDGET id="widgetB" background_color="#000000" width="20" height="20" />
- <WIDGET id="widgetC" background_color="#000000" width="20" height="20" />
- </ROW>
- <!-- layout with slider -->
- <COLUMN width="150" v_margin="10">
- <TEXT value="color_intensity" />
- <LM_SLIDER_A param_id="color_intensity" />
- <PARAM_TEXT_CONTROL param_id="color_intensity" />
- </COLUMN>

The power of PARAM_MULTI_LINK comes in handy when you need to link several sources to a single (or multiple) targets. Here's a playground script to see how it works with various mux_functions enabled.
- <!-- create params -->
- <PARAM id="A" min="0" max="1" default="0" />
- <PARAM id="B" min="0" max="1" default="0" />
- <!-- link several-to-one trying various mux_functions -->
- <VARIABLE id="N" value="0" override="true" />
- <ROW>
- <COLUMN width="35" spacing="5">
- <TEXT value="$index$" font_size="12" />
- <WIDGET id="widget$N$" background_color="#5799F0" width="20" height="20" />
- <PARAM_TEXT param_id="widget$N$.opacity" font_size="12" />
- <PARAM_MULTI_LINK from="A;B" to="widget$N$.opacity" mux_function="$index$" />
- </COLUMN>
- <VARIABLE id="N" formula="$N$+1" override="true" />
- </REPEAT>
- <REPEAT index_list="-min;-max">
- <COLUMN width="35" spacing="5">
- <TEXT value="$index$" font_size="12" />
- <WIDGET id="widget$N$" background_color="#5799F0" width="20" height="20" />
- <PARAM_TEXT param_id="test$N$" font_size="12" />
- <PARAM_MULTI_LINK from="A;B" to="test$N$" mux_function="$index$" />
- <PARAM id="test$N$" min="-1" max="1" />
- <PARAM_LINK from="test$N$" to="widget$N$.opacity" formula="x+1" />
- </COLUMN>
- <VARIABLE id="N" formula="$N$+1" override="true" />
- </REPEAT>
- </ROW>
- <!-- layout with sliders -->
- <ROW v_margin="10">
- <REPEAT index_list="A;B">
- <COLUMN width="35">
- <TEXT value="$index$" />
- <LM_SLIDER_A param_id="$index$" />
- <PARAM_TEXT_CONTROL param_id="$index$" />
- </COLUMN>
- </REPEAT>
- </ROW>

When you have several input sources, you may get confused on how "<" and ">" mux_functions work: they compare parameters in order, so < gives 1 if A < B < C < D in the example below.

See more examples in PARAM_LINK and Params 101.
Comments
Please, authorize to view and post comments.