Forum

    • Register
    • Login
    • Search
    • Categories

    Crash Issue - Help!

    General Questions
    3
    8
    135
    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.
    • DanH
      DanH last edited by

      I've managed to whittle down a crash issue to the below lines of code. Before I spend some time making a snippet of it all, can anyone see anything obviously wrong with the code as it is?

      // INDIVIDUAL BYPASSES
      inline function onBypassButtonsControl(component, value)
      {
          var btnIdx = ONOFFARRAY.indexOf(component);   // Which button has been clicked
          
          SBARRAY[btnIdx].setValue(value);         // Set the corresponding module bypass
          SBARRAY[btnIdx].changed();   
          bypassArray[btnIdx] = value;                    // Store the individual states
      };
      for (b in ONOFFARRAY) b.setControlCallback(onBypassButtonsControl);
      
      
      inline function onSOLOControl(component, value)
      {
          for (i=0; i<ONOFFARRAY.length; i++)
          {
              if (value)                                      // If Master bypass ON
              {
                  SBARRAY[i].setValue(true);           // Set all to bypass
                  SBARRAY[i].changed();
                  //ONOFFARRAY[i].setValue(true);
              }
              else
              {
                  SBARRAY[i].setValue(bypassArray[i]); // Or restore their state from the array
                  SBARRAY[i].changed();
                  //ONOFFARRAY[i].setValue(bypassArray[i]);
              }
          }
      };
      Content.getComponent("SOLO").setControlCallback(onSOLOControl);
      

      Many thanks!

      d.healey 1 Reply Last reply Reply Quote 0
      • d.healey
        d.healey @DanH last edited by

        @danh said in Crash Issue - Help!:

        for (b in ONOFFARRAY) b.setControlCallback(onBypassButtonsControl);

        Put this on two lines (it won't fix the crash but it will be easier to read)

        var btnIdx = ONOFFARRAY.indexOf(component);

        Don't use var, use local - this could be causing the crash if you have another var somewhere with the same name (but I doubt this is the cause).

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

        Lindon DanH 2 Replies Last reply Reply Quote 0
        • Lindon
          Lindon @d.healey last edited by

          @DanH -this is the mute/solo mixer problem isnt it? David has a couple of videos on how to make this efficiently...

          HISE Development for hire.
          www.channelrobot.com

          DanH 1 Reply Last reply Reply Quote 0
          • DanH
            DanH @d.healey last edited by

            @d-healey thanks David, so far so good 🙂 Can't believe changing var to local might fix weeks of grief! Let's hope so!

            d.healey 1 Reply Last reply Reply Quote 0
            • DanH
              DanH last edited by

              This post is deleted!
              1 Reply Last reply Reply Quote 0
              • d.healey
                d.healey @DanH last edited by

                @danh said in Crash Issue - Help!:

                changing var to local

                Make sure you change all of your vars inside inline functions, not just the ones in the bit of code you posted.

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

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

                  @lindon thanks, will check it out 🙂

                  1 Reply Last reply Reply Quote 0
                  • DanH
                    DanH @d.healey last edited by

                    @d-healey yeah pretty certain I clocked that early on, managed to miss it here...

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

                    20
                    Online

                    1.1k
                    Users

                    6.7k
                    Topics

                    62.1k
                    Posts