HISE Logo Forum
    • Categories
    • Register
    • Login

    Problem with Mic Mixer...

    Scheduled Pinned Locked Moved General Questions
    11 Posts 3 Posters 336 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.
    • C
      crubbish
      last edited by

      Hi,

      I've been following and learning loads of the amazing human Dave Healeys Videos.

      Ive sort of combined what he did over both of his mic mixer videos and its all working great except the first solo button. which does not work.

      When I print to console the local index of the onbtnSoloControl I get the correct numbers for buttons 1 2 3 and 4 but for button 0 i get a -1 or a 0. I think this is the issue but im not sure how to fix it.

      Here is my script...

      Content.makeFrontInterface(600, 600);
      
       // Get sampler
       const var Sampler1 = Synth.getChildSynth("Sampler1");
       
       const NUM_CHANNELS = 5;
       //Purge Buttons
       const var btnPurge = [];
       
       for  (i = 0; i < NUM_CHANNELS; i++)
      {
      	btnPurge[i] = Content.getComponent("btnPurge"+i);
      	btnPurge[i].setControlCallback(purgeMicPosition);
      }
      
      inline function purgeMicPosition(component, value)
      {	
      	local idx = btnPurge.indexOf(component);
      	local micName = Sampler1.asSampler().getMicPositionName(idx);
      	Sampler1.asSampler().purgeMicPosition(micName, value);
      	
      } 
      
      // Mute Solo Volume
      
      Synth.deferCallbacks(true);
      
      const soloState = [];
      
      //Gather compoonents and fx
      const gainFX=[];
      const knbGain=[];
      const btnMute=[];
      const btnSolo=[];
      
      for (i = 0; i < NUM_CHANNELS; i++)
      {
      	gainFX.push(Synth.getEffect("Simple Gain"+i));
      	
      	knbGain.push(Content.getComponent("knbGain"+i));
      	knbGain[i].setControlCallback(onknbGainControl);
      	
      	btnMute.push(Content.getComponent("btnMute"+i));
      	btnMute[i].setControlCallback(onbtnMuteControl);
      	
      	btnSolo.push(Content.getComponent("btnSolo"+i));
      	btnSolo[i].setControlCallback(onbtnSoloControl);
      	
      }
      //kbnGain
      inline function onknbGainControl(component, value)
      {
      	local index = knbGain.indexOf(component);
      	if((!btnMute[index].getValue() && !soloState.contains(1)) || btnSolo[index].getValue())
      	{
      		gainFX[index].setAttribute(gainFX[index].Gain, value);
      		
      	}
      }
      
      //btnMute
      inline function onbtnMuteControl(component, value)
      {
      	soloMuteProcess();
      }
      
      //btnSolo
      inline function onbtnSoloControl(component, value)
      {
      	local index = btnSolo.indexOf(component, value);
      	soloState[index] = value;
      	Console.print(index);
      	soloMuteProcess();
      }
      
      // Functions
      inline function soloMuteProcess()
      {
      	for (i=0; i < NUM_CHANNELS; i++)
      	{
      		if (( !soloState.contains(1) || btnSolo[i].getValue()) && (!btnMute[i].getValue() || btnSolo[i].getValue()))
      		{
      			gainFX[i].setAttribute(gainFX[i].Gain, knbGain[i].getValue());
      		}
      		else 
      		{
      			gainFX[i].setAttribute(gainFX[i].Gain, -100);
      		}
      	}
      } 
      
      
      

      Here are my button names

      2e39cd8d-9045-4df2-8b98-89771b9aa54f-image.png

      Here are the settings for the button not functioning properly.

      9219087a-6835-43c7-a970-c1470e644539-image.png

      Really appreciate any and all help :)

      Thanks

      Christoph HartC LindonL 2 Replies Last reply Reply Quote 0
      • Christoph HartC
        Christoph Hart @crubbish
        last edited by

        the amazing human Dave Healey

        @d-healey that should be your tagline from now on...

        1 Reply Last reply Reply Quote 3
        • LindonL
          Lindon @crubbish
          last edited by

          @crubbish post a snippet demonstrating the problem...

          HISE Development for hire.
          www.channelrobot.com

          C 1 Reply Last reply Reply Quote 0
          • C
            crubbish @Lindon
            last edited by crubbish

            @Lindon

            So this is the console print from moving up the buttons gradually pressing each twice. As you can see the other 4 buttons work fine but button 0 should return two 0's instead i get -1 and 0.

            3f4f9aff-80d0-4f0c-a268-5dc108bb5664-image.png

            The buttons using some of the amazing human Dave Healeys clever If statements turn down a gain FX on any channel not soloed.

            As you can see below with button 1 pressed all channels are at -100dB with just channel 1 at 0dB

            f4260d6d-7918-41fe-9a86-37728a741b4e-image.png

            but with button 0 pressed there is nothing turned down.

            e4a3c0e7-e3b8-451b-bb05-118b09b7632f-image.png

            All of the above is based on my super beginner understanding from watching youtube!

            thanks

            Jack

            LindonL C 2 Replies Last reply Reply Quote 0
            • LindonL
              Lindon @crubbish
              last edited by Lindon

              @crubbish post a snippet demonstrating the problem...

              do you know how to do that?

              Export Menu> Export as HISE snippet

              ..then paste it here between the code tags.

              HISE Development for hire.
              www.channelrobot.com

              1 Reply Last reply Reply Quote 0
              • C
                crubbish @crubbish
                last edited by

                @Lindon

                Ive exported it...

                Dumb question and please don't give up on me ... how do i post it ? in the manual it just says in triple fences?

                THANKS AGAIN!!

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

                  @crubbish

                  so in the editor..
                  ebf23cb7-39e7-4e1f-b7c4-baa383a66ff1-image.png

                  select the code tags, and you will get the image above...

                  just paste your snippet over the "code_text"

                  HISE Development for hire.
                  www.channelrobot.com

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

                    hang on.....

                    HISE Development for hire.
                    www.channelrobot.com

                    C 1 Reply Last reply Reply Quote 0
                    • C
                      crubbish @Lindon
                      last edited by

                      @Lindon

                      HiseSnippet 2506.3oc6bssaabiFdjkmznosooEcA5dwBvFrnPFIwQmrSJxlrxmqwF4HX43sEEAoimgxhviFJLCUhc2ZftuA6s4t9Hr6k8N+njGg8MH6O4vQhy3Yj0gnVGux.Nvj+7m+G3G+HmgbRcOpE12m5okI2dmzAqk4izabhKq0ZsLItZautVlqou2d6WTa0S5X56is0xjI6VbYYxMul3m+6ecUSGSWKb+pzz1mRrvOgzlv5Wa8p+Mhiyll138HsUZckpaaQcWi5P6B9QV8BZcLsNx7P7Nl7lMmN3DaXSXTuFLSF1WKy7qRsOoQK5qbCZ+9DexANXdghZMfNJn5MoN1bOlWq1ZsHN10CiWeMsL506G8YCh9OWuFwlzq99YgaJDf5qgZ9HybQcurQbuhptWAE2KAWJihKMefK8o5Mr7HcX8kv8mOTeaWF1qoIj1Uckf1pMG955qQgV3xV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WWxvkHIVNovDIw9SAC2eldClG1rMjgkeEdhAbC8vOOu2Ee+rcFpueVC8lvOEJ70KC9I1gZZG8hpcV0U61rI1KZs+6pBKtRaZW2HlTF.6h6fMY0BtiGgdY0c2cKOZ2Nw0pXUwoAsmmo0QPFQMTepKFfuL0pVyi562DhJQe4qlED2U.a0Z1ECj29QqCfxpfX9t0elOlOkgXEh262ZgUJrmoXZyb5AkKFqboXkKGqbkXkWJV4kiU998KGjPqY1gCP9DwGWM5tnZccXjy+8zbsgaEHn2.lEriRKWkbXOKETyEbbUW6R2WC8ucmU56lOX6bg9Xv9W1.1mgCEpIbQzllvfbXsQYDpQcocZQcIVQA6.38vCwdp9dhAzJLFLWqeMed0cwNXSekYq+4pOg3hM8hNGdjxEEG4Od8DGu9B8.2Ewowtbuh8.OW6rC04Z+NwGG+yxdpmhtgbMNDXQO1kvwvORWPAi3KbdE9THG+Wf+3+tuF+GabD2wkUXJCpQ92hufmLYwt7UVEWyDGXuANQtk98tCqUJVQSarTrTwwTwkFKEuldkBkev3o4tTZ6eygcZCB1kYPvNsAA6xLHXm1ffcYFDrSaPvtLmC101zxi9Bqfu1LN365hZfQDWw+0zjSuFuLp22HmtdgEKvuG1jWXYwYmuKfBRVmRigNkGCcpLF5rzXnyxigN2eLz4ACTG99RWoKi1NX0Znh5aDLIJyF8lDkU6+AfGr5yC
                      

                      This ok ?

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

                        @crubbish yep thats how you do it...

                        here's your problem:

                        your code:

                        //btnSolo
                        inline function onbtnSoloControl(component, value)
                        {
                        	local index = btnSolo.indexOf(component, value);
                        	soloState[index] = value;
                        	Console.print(index);
                        	soloMuteProcess();
                        }
                        

                        the problem line:

                        local index = btnSolo.indexOf(component, value);
                        

                        Can you see the problem? Maybe not 'cause its sorta curly edge casey...

                        the documentation says:

                        Array.indexOf(var elementToLookFor, int startOffset, int typeStrictness)

                        --start offset is optional, as is typestrictness, so in the end we need:

                        Array.indexOf(var elementToLookFor)

                        -- so it wants one and only one attribute, you gave it two.....and the second is startOffset , and you used the button value(1) at this point.....so it didnt complain... BUT:

                        you told it to look in the Array from offset position 1(the second element) for the first button, and no surprise it couldnt find it...so Console.print = -1(not found)

                        Personally I've never used the offset or the strictness parameters....so in nearly every case in your development you want to say:

                        //btnSolo
                        inline function onbtnSoloControl(component, value)
                        {
                        	local index = btnSolo.indexOf(component);
                        	soloState[index] = value;
                        	Console.print(index);
                        	soloMuteProcess();
                        }
                        

                        make this change and your code works fine.

                        HISE Development for hire.
                        www.channelrobot.com

                        C 1 Reply Last reply Reply Quote 1
                        • C
                          crubbish @Lindon
                          last edited by

                          @Lindon

                          Thanks a bunch for your help!

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

                          47

                          Online

                          1.7k

                          Users

                          11.7k

                          Topics

                          101.8k

                          Posts