Multisample/Zone selector or dropdown?

Hi guys,

is it possible to include a multisample or zone selector within a preset or layer? I want to design a simple instrument that enables the user to combine two multisamples, that he selects from a given bunch.

Thanks,
Marco

Hi Marco.

I was trying to do something similar.
I still don’t know how to make the sample selector to work (macro page template from Studio Strings).

But I managed to create a menu that lets me load a layer preset within a program.

Thanks, I’ll check that. Maybe it gives an idea…

Today I managed to create dropdowns for existing layers that contains multisamples (or other zones). Thought I share it with you. Find the code below.

My program contains TWO main layers which contains SUB layers, which finally represent multisamples. The script searches for the TWO main layers and then adds their SUB layers into corresponding dropdowns. When the user selects an instrument from the layers, all others get muted.


function muteLayers(layers)
	if layers[1] then
	    for i, layer in ipairs(layers) do
		   layer:setParameter("LayerMute", true)
	    end
		layers[1]:setParameter("LayerMute", false)
	end
end


function onLayerSelectChanged(parameter, layers)
   if layers[1] then
       for i, layer in ipairs(layers) do
		   layer:setParameter("LayerMute", true)
       end
   end
   
   s = this:getParameter(parameter)
   layers[s]:setParameter("LayerMute", false)
end


-- Find all layers
mainLayers = getElement():findLayers(false)
syntheticLayers = mainLayers[1]:findLayers(false)
traditionalLayers = mainLayers[2]:findLayers(false)
muteLayers(syntheticLayers)
muteLayers(traditionalLayers)

-- Prepare option arrays
synthLayersArray = {}
for i, layer in ipairs(syntheticLayers) do
	synthLayersArray[i] = layer.name
end
defineParameter("syntheticOptions", nil, 1, synthLayersArray, function() onLayerSelectChanged("syntheticOptions", syntheticLayers) end)

tradiLayersArray = {}
for i, layer in ipairs(traditionalLayers) do
	tradiLayersArray[i] = layer.name
end
defineParameter("traditionalOptions", nil, 1, tradiLayersArray, function() onLayerSelectChanged("traditionalOptions", traditionalLayers) end)