Switching between samples in a Zone

Good to hear it’s working.

I was going to post a variation of the 2nd code that should fix the LayerMidiMute problem of the first script. In case there were still some layers left with the LayerMidiMute turned on by mistake.

layers = this.parent:findLayers()

function getLayerNames()
  layerNames = {}
  for i, layer in ipairs(layers) do
    layer:setParameter("LayerMidiMute", false) --fix the LayerMidiMute from previous script
    layerNames[i] = layer.name
  end
end

getLayerNames()

defineParameter("LayerSelect", nil, 1, layerNames)


function onNote(event)
  playNote(event.note, event.velocity, -1, layers[LayerSelect])
end

But if it’s working then don’t bother.

Good luck with your instrument.