Sampler (if enabled)
-
Is there any function like this?
if (samplers[y].isEnabled() && samplers[y].isNoteNumberMapped(i)) {
Cant find it in the documentation, to check if a sampler is enabled or not.,
-
@ThinkTank you can use
Sampler1.isBypassed();
-
@ulrik said in Sampler (if enabled):
Sampler1.isBypassed();
Thanks, too bad i only use enable/disable for my samplers :/
-
@ulrik Can you apply multiple parameterid in the Interface designer? - or should it be done in scripting?
-
@ThinkTank Need to do it through scripting.
-
There really should just be a:
Sampler1.isEnabled
funtion...And a function for enable and disable Samplers in scripting.
-
@ThinkTank said in Sampler (if enabled):
There really should just be a:
Sampler1.isEnabled
funtion...And a function for enable and disable Samplers in scripting.
const var Sampler1 = Synth.getChildSynth("Sampler1"); Sampler1.setBypassed(true);
-
Does everyone use bypass and not enable/disable for samplers?
Isn't that a CPU drain or does it not matter at all? -
@Lindon said in Sampler (if enabled):
Sampler1.isEnabled
const var Sampler1 = Synth.getChildSynth("Sampler1"); Console.print(Sampler1.isBypassed());
-
@ThinkTank said in Sampler (if enabled):
Does everyone use bypass and not enable/disable for samplers?
Isn't that a CPU drain or does it not matter at all?It's exactly the same.
isBypassed = !isEnabled
-
Great. Now i feel even more stupid.
Then why is there a enable/disable parameterID at all? -
@ThinkTank If you're connecting it up via a button using parameter/processor ID you'll want to be able to differentiate between them. So you can choose if button on = enabled or bypassed.
-
I cant do something like this?
// KEYBOARD COLORING namespace Keyboard { const var KeyboardPreload = Content.getComponent("KeyboardPreload"); const samplerIds = Synth.getIdList('Sampler'); const samplers = []; const KEY_COLOUR_OPACITY = 0.28; const KEY_COLOURS = [ Colours.withAlpha(Colours.darkcyan, KEY_COLOUR_OPACITY), // Sampler 1 Colours.withAlpha(Colours.darkcyan, KEY_COLOUR_OPACITY), // Sampler 2 Colours.withAlpha(Colours.darkcyan, KEY_COLOUR_OPACITY) // Sampler 3 ]; for (id in samplerIds) { samplers.push(Synth.getSampler(id)); } KeyboardPreload.setLoadingCallback(function(isPreloading) { if (!isPreloading) setKeyColours(); }); inline function setKeyColours() { for (i = 0; i < 128; i++) { Engine.setKeyColour(i, Colours.withAlpha(Colours.black, 0.2)); } for (i = 0; i < 128; i++) { for (y = 0; y < samplers.length; y++) { local s = samplers[y]; if (s.isNoteNumberMapped(i) && !s.isBypassed()) { Engine.setKeyColour(i, Keyboard.KEY_COLOURS[y]); break; // Exit the loop once a non-bypassed sampler is found } } } } }
I just want to color the keys with Samplers which are NOT bypassed. Its a headache!
-
@ThinkTank Sampler doesn't have an
isBypassed
function. You need to get the reference as achildSynth
-
@d-healey Thanks!