I have several layers in a Halion program and each layer contains several samples. In the Macro Page I have a knob and I want to assign the Decay Offset parameter (DCADecOffset) of all the samples from those layers to that single knob on the Macro Page. Is it possible? Do I need some script for this?
You can do it by changing scope to
So for decay offset of all zones:
You can also target all zones within a layer:
@0:Layer 1/@type:Zone/@id:c9 (just an example)
Great, it works! Thank you so much misohoza!
And now I encountered the same problem as with the pitch-modulation issue I described in my other thread : in a Halion program containing a main layer with two sub-layers (A and B), I would like to have 3 knobs in my Macro Page, Knob 1 to control the Decay Offset for layer A, Knob 2 to control the Decay Offset for layer B, and Knob 3 to modify the Decay Offset of both layer A and layer B, but in a relative way, meaning that it will increase or decrease the Decay Offset of those two layers starting from the values set by the Knob 1 and Knob 2.
Is it possible somehow?
It should be possible. Take the Layer decay + offset and use that to set the parameter of zones.
You need to decide how you want to handle it if the layer decay is already at max.
Screenshot of program tree might help.
I’m sorry, but I don’t quite understand this. What you mean by “Layer decay + offset”?
I could make a screenshot but it’s a super basic program tree in this case, just a main layer with two sub-layers (Layer A and Layer B) and each sub-layer contains two samples. That’s it. I made it just to test this scenario.
Try something like this:
local zonesA = this.parent:getLayer(1):findZones() local zonesB = this.parent:getLayer(2):findZones() function setDecayOffset(zones, decay) for i, zone in ipairs(zones) do zone:setParameter("DCADecOffset", decay + Offset) end end defineParameter("DecayA", nil, 0, -100, 100, function() setDecayOffset(zonesA, DecayA) end) defineParameter("DecayB", nil, 0, -100, 100, function() setDecayOffset(zonesB, DecayB) end) defineParameter("Offset", nil, 0, -100, 100, function() offsetChanged() end) function offsetChanged() setDecayOffset(zonesA, DecayA) setDecayOffset(zonesB, DecayB) end
I just tried it and it somehow works but not quite as expected. For example, when the DecayA (or B) knob is set to +100 then the Offset knob has no effect whatsoever on the length of the decay. It can be rotated all the way from -100 to +100 and the decay length remains the same. I was expecting that when the DecayA knob is set to +100 and the Offset knob to -100 to get the same decay as when both these knobs are set to 0.
Yes, that’s what it should do. When you check in parameter list, DCADecOffset parameter of zones in first layer should be at 0.
Decay Offset.vstpreset (8.8 KB)
Yes, it works now! I rechecked the DCADecOffset parameter as you said and it wasn’t set at 0 so that was the issue.
Thank you very much for that vstpreset you made for me and for all the help! Highly appreciated!