Much to my dismay I’m discovering just now that when layering samples via velocity (ie, 1-10 sample A, 11-20 sample B, etc) each one creates a seperate zone. This means that the LuaScript I was using to define the LFO destination is only being applied to Zone1.
To resolve this I have modified the first line of the script (full version below) from:
local zone = this.parent:getZone()
to
local zone = this.parent:getZone(“Zone 001”)
local zone = this.parent:getZone(“Zone 002”)
local zone = this.parent:getZone(“Zone 003”)
I confirm the names of the zones match:
However, this only works on the last zone mentioned. For example, if I remove the Zone003 row then Zone002 is being affected and if I remove that, Zone001 is being affected. Essentially instead of this being read as an OR statement I need it as an AND statement
The full LuaScript is below.
local zone = this.parent:getZone(“Zone 001”)
local zone = this.parent:getZone(“Zone 002”)
local zone = this.parent:getZone(“Zone 003”)local Destination = {
{name = “Off”, index = 0},
{name = “Pitch”, index = 1},
{name = “Cutoff”, index = 2},
{name = “Resonance”, index = 3},
{name = “Distortion”, index = 4},
{name = “Pan”, index = 12},
{name = “Formant”, index = 15},}
function getDestinationNames()
DestinationNames = {}
for i = 1, #Destination do
DestinationNames[i] = Destination[i].name
end
endgetDestinationNames()
function DestinationChanged()
zone:getModulationMatrixRow(3):setParameter(“Destination.Destination”, Destination[ModDestination].index)
enddefineParameter(“ModDestination”, nil, 4, DestinationNames, DestinationChanged)