How to use a mute device
-
Now the code can be switched, Panel0,Panel1,Panel2
But I don't know how to enable MidiMate1, MidiMate2, and MidiMate3 in Sampler1, Sampler2, and Sampler3namespace SamplerQH { const var NUM_BUTTONS = 3; const var buttons = []; const var panels = []; for (i = 0; i < NUM_BUTTONS; i++) { buttons[i] = Content.getComponent("Button" + (i)); panels[i] = Content.getComponent("Panel" + (i)); buttons[i].setControlCallback(onButtonControl); } inline function onButtonControl(component, value) { local idx = buttons.indexOf(component); for (i = 0; i < panels.length; i++) { panels[i].showControl(idx == i); buttons[i].setValue(i == idx && value); } } onButtonControl(buttons[0], true); }
-
@GUJIAN
place a reference to your MIDIMuter processors in an array, in the button call back - call .setBypassed(value) on them -
This post is deleted! -
@Lindon I'm a beginner and don't quite understand what the teacher said. Can you help me load the code and let me take a look? Thank you
-
You could try something simple first like one button mute one device.
the only thing you need to do is reference the device and then call .setBypassed(1-value) in the button callback.
Then you could reference everything in an array or just simply write the same thing for each device separately.
-