Help with Root Key

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?

Thanks in advance for any help!

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.

Thanks for the replay, so I think the only way is with a script?

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?

Hello, thanks for the help.

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

I see you already have a scope parameter. So you are almost there. Are you using it for sample display?

If you want to use Group control for the scope you probably want it to end with “/”.
For example: @0:Layer 1/@0:Zone 1/

You can do that in UI script using the scope you already have:

defineParameter("scope", nil, "", function() scope1 = scope.."/" end)
defineParameter("scope1", nil, "")

Rootkey Scope.vstpreset (8.8 KB)

Sorry I don’t understand the .vstpreset you have attached, the script inside is exactly the same of the one I posted…

I don’t understand how you connected the root key menu…

Look at the ui script.

Ok I have replicated what you did in your example but in my instrument is still not working, probably because I have 4 Layers…

You can also try without ui script by modifying the script you had.
Rootkey Scope 2.vstpreset (12.8 KB)

1 Like

Thanks a lot this seems to work perfectly! :+1:

Sorry for the “off-topic” question, is there any news regarding the release of Halion 7?

1 Like