HISE Logo Forum
    • Categories
    • Register
    • Login

    Help creating a simple keyswitch between two samplers

    Scheduled Pinned Locked Moved General Questions
    4 Posts 3 Posters 31 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.
    • lijas90L
      lijas90
      last edited by

      Hi friends, I want to create a simple keyswitch that switches between two samplers. I’ve watched a tutorial by David but I can’t get it to work. I think it’s easy. Can someone help me? Thanks!

      //keyswitches
      
      const var sampler1 = Synth.getChildSynth("sampler1");
      const var sampler2 = Synth.getChildSynth("sampler2");
      
      const var sampler1 = [36];
      const var sampler2 = [35];
      
      function onNoteOn()
      {   
          local n = Message.getNoteNumber();
                                                                                                                                                                                                                                                                                                                                                                           	        
          if(sampler1.contains(n)){
             sampler1.setBypassed(false);
             sampler2.setBypassed(true);
          } 
          else if(sampler2.contains(n)){
             sampler1.setBypassed(true);
             sampler2.setBypassed(false);
          }
      }      	                  
      
      
      P d.healeyD 2 Replies Last reply Reply Quote 0
      • P
        pokemonguy @lijas90
        last edited by

        @lijas90 his video for 2 groups, I solved this by an old Dan snippet to do with midi muters recently that works amazing.

        Search the phrase
        Here is an example of how to do it. For some reason, which I'm hoping Christoph can explain, it only works when the script is deferred.

        1 Reply Last reply Reply Quote 1
        • d.healeyD
          d.healey @lijas90
          last edited by

          @lijas90 use midi muters instead of bypassing the samplers. I put a video about this on Patreon recently I think

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

          lijas90L 1 Reply Last reply Reply Quote 1
          • lijas90L
            lijas90 @d.healey
            last edited by

            @d-healey Thanks you!

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

            33

            Online

            2.0k

            Users

            12.8k

            Topics

            110.7k

            Posts