Forum
    • Categories
    • Register
    • Login

    Confused about set.Bypassed() and ChildSynth vs Sampler

    Scheduled Pinned Locked Moved General Questions
    3 Posts 3 Posters 19 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • observantsoundO
      observantsound
      last edited by

      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().

      David HealeyD ustkU 2 Replies Last reply Reply Quote 0
      • David HealeyD
        David Healey @observantsound
        last edited by David Healey

        @observantsound

        In the API browser, if the heading is Sampler, then it needs to be a sampler reference

        0cf45193-c287-40ec-b66d-370f594bd909-image.png

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

        33493610-9b8e-4409-8de8-cbf592a58d9d-image.png

        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()

        Free HISE Bootcamp Full Course for beginners.
        YouTube Channel - HISE tutorials
        My Patreon - More HISE tutorials

        1 Reply Last reply Reply Quote 1
        • ustkU
          ustk @observantsound
          last edited by ustk

          @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 job

          What I said might work, but do as @David-Healey said it's better implementation even if the reference are the same behind the scene 👍

          Hise made me an F5 dude, any other app just suffers...

          1 Reply Last reply Reply Quote 0
          • First post
            Last post

          17

          Online

          2.4k

          Users

          13.8k

          Topics

          120.3k

          Posts