Confused about set.Bypassed() and ChildSynth vs Sampler
-
In my current project I've saved my sampler modules as Child Synth references
samplers_Start[i] = Synth.getChildSynth("Names")For a Round Robin change I wanted to make I realised I needed the samplers as get.Sampler() references so I can do .setActiveGroup()
But then I realised that my Sampler bypassing function wasn't working anymore:
It works again if I change it back to Synth.getChildSynth() instead, but I don't understand why this is this way....// REFERENCES const s_Child = Synth.getChildSynth("Sampler1"); const s_Synth = Synth.getSampler("Sampler1"); // --- Using setBypassed s_Child.setBypassed(1); // Works //s_Synth.setBypassed(1); // Doesnt work // Set Active Group //s_Child.enableRoundRobin(0); // Doesnt work //s_Child.setActiveGroup(1); // Doesnt work s_Synth.enableRoundRobin(0); // Works s_Synth.setActiveGroup(1); // Works for(i = 0; i < 20; i++) { Console.print(s_Child.getAttributeId(i)); // Works Console.print(s_Synth.getAttributeId(i)); // Works }I think I have some general confusion in this area and I sometimes don't know whether to look for a API method or a documentation Property, or when to do .getAttributes().
-
In the API browser, if the heading is Sampler, then it needs to be a sampler reference

If the heading is ChildSynth then it needs to be a child synth reference

What I do is I get all the references as child synths and then in places where I need to call a Sampler function I use
.asSampler().mySamplerFunction() -
@observantsound
You can use both references at the same time. Just use the one that works for the bypass, and the other for your sampler jobWhat I said might work, but do as @David-Healey said it's better implementation even if the reference are the same behind the scene
