Script option other than looping for performance improvement?

Hi DodgingRain,

Does each of the layers in Halion Sonic has its own macro page and the same script?

I’m just wondering if using “this.program” is necessary. Maybe it is if you want to control all the layers from a single script module.

But I would try “findZones(true)” instead of “findChildren”. This way you don’t need to loop through all objects including layers, busses, effects, midi modules… You only loop through zones. It would also save you a few “ifs”. You don’t need to check if it is zone.

Also I don’t think the line with “hasParameter” is necessary. Every zone has modulation matrix row parameter “Destination.Depth”.

You can simplify the function to “findZones”, “getModulationMatrixRow”, “setParameter”.
Depending on how many zones you have it might still not be as efficient as you’d like but worth a try.

\


Another option could be using a ui script. Create parameters with the range you want.

defineParameter("destDepth1",nil,0,0,100)
defineParameter("destDepth2",nil,0,0,100)

Connect the ui script parameters to Destination.Depth parameters of the first and second modulation matrix row.

@type:Zone/@id:100a0002
@type:Zone/@id:104a0002


You won’t be able to automate them though.