Few questions from a newbie
-
@d-healey Content.makeFrontInterface(1200, 800); //Get sampler const var smpKickin = Synth.getChildSynth("smpKickin"); const var smpSnare = Synth.getChildSynth("smpSnare"); //Purge button const var btnPurge = []; for (i = 0; i < 3; i++) { btnPurge[i] = Content.getComponent("btnPurge" + i); btnPurge[i].setControlCallback(purgeMicPosition); } inline function purgeMicPosition(component, value) { local idx = btnPurge.indexOf(component); local micName = smpKickin.asSampler().getMicPositionName(idx); smpKickin.asSampler().purgeMicPosition(micName, value); local idx = btnPurge.indexOf(component); } for (i = 3; i < 2; i++) { btnPurge[i] = Content.getComponent("btnPurge" + i); btnPurge[i].setControlCallback(purgeMicPosition); } inline function purgeMicPosition(component, value) { local idx = btnPurge.indexOf(component); local micName = smpSnare.asSampler().getMicPositionName(idx); smpSnare.asSampler().purgeMicPosition(micName, value); local idx = btnPurge.indexOf(component); }
-
@ScreamingWaves As always I would suggest starting simpler. A mic mixer is quite complicated and if you are trying to modify code to do something it wasn't designed to do, you really need to understand it well.
That said, here are some pointers to get you started. You can't have two functions or two variables with the same name in the same scope. Uniqueness is very important in programming.
For example you have two functions both called
purgeMicPosition
, and within them you have two variables calledidx
.Check out my scripting 101 video, it will give you a quick overview of some of these kinds of things. Also in the HISE documentation there is a link to a Javascript beginner's course which will help.