HISE Logo Forum
    • Categories
    • Register
    • Login

    Few questions from a newbie

    Scheduled Pinned Locked Moved Unsolved Newbie League
    drums samplerprogrammingroutingdesignervirtual drums
    22 Posts 4 Posters 1.1k 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.
    • S
      ScreamingWaves @d.healey
      last edited by

      @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);
      	
      }
      
      d.healeyD 1 Reply Last reply Reply Quote 0
      • d.healeyD
        d.healey @ScreamingWaves
        last edited by

        @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 called idx.

        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.

        Libre Wave - Freedom respecting instruments and effects
        My Patreon - HISE tutorials
        YouTube Channel - Public HISE tutorials

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

        25

        Online

        2.0k

        Users

        12.6k

        Topics

        109.5k

        Posts