Hi Matthew.
The above code isn't quite likely to work (there are too many parameters for params.setValue)
params.setValue accepts OID, index, value as its 3 arguments.
The example also assumes that you've created a new slider parameter to drive the changes. If you want to make all of the sliders stay in sync, another option is to attach a change script to each of them and force them to be the same.
For example, this script works on the first group of channels 1-4 on a UDC:
`
var newValue = this.getValue();
if (params.getValue(0x550A, 0) != newValue)
{
params.setValue(0x550A, 0, newValue);
}
if (params.getValue(0x550B, 0) != newValue)
{
params.setValue(0x550B, 0, newValue);
}
if (params.getValue(0x550C, 0) != newValue)
{
params.setValue(0x550C, 0, newValue);
}
if (params.getValue(0x550D, 0) != newValue)
{
params.setValue(0x550D, 0, newValue);
}
`
One thing you'll notice with the above is that things can bounce around a little bit as the changes come in. A way around this is to give time for the parameter changes to complete before trying to get everything in sync. Here is another version of the script that will sync things up 200 milliseconds after the change happens.
` var changedParam = this;
function syncValues()
{
var newValue = changedParam.getValue();
if (params.getValue(0x550A, 0) != newValue)
{
params.setValue(0x550A, 0, newValue);
}
if (params.getValue(0x550B, 0) != newValue)
{
params.setValue(0x550B, 0, newValue);
}
if (params.getValue(0x550C, 0) != newValue)
{
params.setValue(0x550C, 0, newValue);
}
if (params.getValue(0x550D, 0) != newValue)
{
params.setValue(0x550D, 0, newValue);
}
}
ogscript.asyncExec(syncValues, 200);`
Of course, all of these assume that you've got all of your parameters coming from the same device and that you've set your panel to talk to that specific device. If you need to keep parameters from different devices in sync, this is possible too but the code looks slightly different.
Hope this helps.
James
#DashBoard