HISE Logo Forum
    • Categories
    • Register
    • Login

    How to use a mute device

    Scheduled Pinned Locked Moved General Questions
    6 Posts 3 Posters 178 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.
    • GUJIANG
      GUJIAN
      last edited by

      Now the code can be switched, Panel0,Panel1,Panel2
      But I don't know how to enable MidiMate1, MidiMate2, and MidiMate3 in Sampler1, Sampler2, and Sampler3

      namespace SamplerQH
      {	
      	const var NUM_BUTTONS = 3;
      	const var buttons = [];
      	const var panels = [];
      	
      	for (i = 0; i < NUM_BUTTONS; i++)
      	{
      	    buttons[i] = Content.getComponent("Button" + (i));
      	    panels[i] = Content.getComponent("Panel" + (i));
      	    buttons[i].setControlCallback(onButtonControl);
      	}
      	
      	inline function onButtonControl(component, value)
      	{
      		local idx = buttons.indexOf(component);
      			
      		for (i = 0; i < panels.length; i++)
      	    {
      	        panels[i].showControl(idx == i);
      	        buttons[i].setValue(i == idx && value);
      	    }
      		
      	}
      	
      
      	onButtonControl(buttons[0], true);
      			
      	
      }
      

      11.png

      LindonL 1 Reply Last reply Reply Quote 0
      • LindonL
        Lindon @GUJIAN
        last edited by

        @GUJIAN
        place a reference to your MIDIMuter processors in an array, in the button call back - call .setBypassed(value) on them

        HISE Development for hire.
        www.channelrobot.com

        GUJIANG 2 Replies Last reply Reply Quote 0
        • GUJIANG
          GUJIAN @Lindon
          last edited by

          This post is deleted!
          1 Reply Last reply Reply Quote 0
          • GUJIANG
            GUJIAN @Lindon
            last edited by

            @Lindon I'm a beginner and don't quite understand what the teacher said. Can you help me load the code and let me take a look? Thank you

            1 Reply Last reply Reply Quote 0
            • A
              Allen
              last edited by

              You could try something simple first like one button mute one device.

              the only thing you need to do is reference the device and then call .setBypassed(1-value) in the button callback.

              Then you could reference everything in an array or just simply write the same thing for each device separately.

              GUJIANG 1 Reply Last reply Reply Quote 1
              • GUJIANG
                GUJIAN @Allen
                last edited by

                @Allen said in How to use a mute device:

                1-value

                I can finally achieve it, thank you teacher

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

                21

                Online

                1.7k

                Users

                11.9k

                Topics

                103.7k

                Posts