Halion 6: Sample Selector in Macro Page - How to show loaded Layer?

Hello,

coding a historical organ with Halion i stumble with loading Sub-Presets into a Macro-Page.

I added Sample Selector template to the macro page, included the LUA-Script with

defineParameter("SelectedPath",nil,"",function()onSelectPath()end)
defineParameter("SelectedPreset",nil,"")


function removeOldLayer()
  if oldPreset then
    this.parent:removeLayer(oldPreset)
  end
end


function appendNewLayer(progressInfo)
  if progressInfo.root then
    oldPreset=this.parent:getLayer()
    this.parent:appendLayerAsync(progressInfo.root,removeOldLayer)
  end
end


function onSelectPath()
  loadPresetAsync(SelectedPath,appendNewLayer)
end

and edited the
Extension: vstpreset
leaving all other entries empty.

Result is, that i can switch to the

VST3 Presets/Steinberg Media Technologies/HALion Sonic SE/Layer

page and can see my Sub-Presets.

How to make them to playable layers?

The programm structure is quite simple
Lua-Script
Note-on
Note-off
another layer
another layer
Special-bus with 4 Effects
Program-Bus with 2 Effects

Many thanks for any help with this!
Pit

Hi Pit,
if you want to talk about HALion sound design, you are better set with the following forum:
Virtual instruments - Steinberg Forums.

This forum is about writing VST Plug-Ins.

Cheers,
Arne