Hello,
I have an instrument, inside the inst layer I have several sample zones that I select with a menu in my GUI.
I tried to add another menu that let me change the 'Root Key" of the selected zone. The problem is that when I change zone the root key menu does not change. I have connect the Root Key menu with this value: @0:Layer 1/@type:Zone/@id:a0002
Why when I change zone the menu does not reflect the root key of the zone I have selected?
If you do it like this you are changing the rootkey of all zones in Layer 1 whether they are currently selected or not. The menu will show the parameter value of the first zone.
Not necessarily. You could use ui variables (string list) for the scope. But you need another macro page control for selecting the scope of the active zone. How is your zone selection menu done?
This is the code I’m using for the zone menu. Maybe is possible to add some code in order to have the Root Key menu updated and linked to the zone I select with the zone menu?
local layer = this.parent
local zones = layer:findZones()
local zoneNames = {}
for i = 1, #zones do
zoneNames[i] = zones[i].name
end
function setScope()
local layerName = layer.name
local zoneName = zones[activeZone].name
scope = "@0:"..layerName.."/@0:"..zoneName
end
defineParameter("activeZone", nil, 1, zoneNames, setScope)
defineParameter("scope", nil, "")
setScope()
function onNote(e)
playNote(e.note, e.velocity, -1, zones[activeZone])
end