Question about bus

Is it possible to have a button for each sublayer inside the “All” layer that if activated bypasses the “All-Bus” and goes straight to the “Pianism-Bus”?

Screen Shot 2023-08-02 at 12.20.42 PM
Thanks in advance for any help!

Assuming each sublayer has its own bus you could do something like this:

programBus = this.parent.parent:getBus()
print(programBus.name)

layers = this.parent:findLayers()

for i, layer in ipairs(layers) do
	defineParameter("BypassAllBus"..i, nil, false, function() bypassChanged(i) end)
end

function bypassChanged(i)
	local bus = layers[i]:getBus()
	if _G["BypassAllBus"..i] then
		bus:setOutputBus(programBus)
	else
		bus:setOutputBus(nil)
	end
end

bypass-bus

1 Like