HISE Logo Forum
    • Categories
    • Register
    • Login

    found identifier when expecting ' ; ' headache

    Scheduled Pinned Locked Moved General Questions
    9 Posts 4 Posters 423 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.
    • SteveRiggsS
      SteveRiggs
      last edited by SteveRiggs

      Hi guys,

      Can anyone see the problem here please? I just used the same code about 10 minutes ago and I've only changed the names this time around to the new things that I need to control, but the 2nd time it isn't working and i get this message in the console:

      Screen Shot 2019-09-22 at 03.19.25.png

      Line 90 thats it's referring to is the line:

      LF EQ.setBypassed(0);

      const var LF EQ = Synth.getEffect("LF EQ");
      const var LMF EQ = Synth.getEffect("LMF EQ");
      const var HMF EQ = Synth.getEffect("HMF EQ");
      const var HF EQ = Synth.getEffect("HF EQ");
      const var EqBypass = Content.getComponent("EqBypass");
      
      inline function onEqBypassControl(component, value)
      {
      if (value ==1)
          {
          LF EQ.setBypassed(0);
          LMF EQ.setBypassed(0);
          HMF EQ.setBypassed(0);
          HF EQ.setBypassed(0);
          }
      else
          {
          LF EQ.setBypassed(1);
          LMF EQ.setBypassed(1);
          HMF EQ.setBypassed(1);
          HF EQ.setBypassed(1);
          }
      };
      
      Content.getComponent("EqBypass").setControlCallback(onEqBypassControl);
      

      www.anarchyaudioworx.com

      www.facebook.com/groups/audioworx/

      1 Reply Last reply Reply Quote 0
      • Dan KorneffD
        Dan Korneff
        last edited by

        @SteveRiggs said in found identifier when expecting ' ; ' headache:

        if (value ==1)

        try

        if (EqBypass.getValue() == 1)
        

        Dan Korneff - Producer / Mixer / Audio Nerd

        SteveRiggsS 1 Reply Last reply Reply Quote 1
        • SteveRiggsS
          SteveRiggs @Dan Korneff
          last edited by

          @dustbro Damn. Still the same error message ☹

          www.anarchyaudioworx.com

          www.facebook.com/groups/audioworx/

          Dan KorneffD 1 Reply Last reply Reply Quote 0
          • Dan KorneffD
            Dan Korneff @SteveRiggs
            last edited by

            @SteveRiggs ahhh it might be your naming scheme

            LF EQ
            

            try creating a name without spaces

            Dan Korneff - Producer / Mixer / Audio Nerd

            SteveRiggsS 2 Replies Last reply Reply Quote 1
            • SteveRiggsS
              SteveRiggs @Dan Korneff
              last edited by

              @dustbro Ah, that could be it, ok 2 seconds I'll try it.... Thanks...

              www.anarchyaudioworx.com

              www.facebook.com/groups/audioworx/

              1 Reply Last reply Reply Quote 0
              • SteveRiggsS
                SteveRiggs @Dan Korneff
                last edited by

                @dustbro Thats got it!!! Spot on mate. Thank you. It's always the little things that keep getting me!

                Note to self, no more spaces!! 🤣

                www.anarchyaudioworx.com

                www.facebook.com/groups/audioworx/

                1 Reply Last reply Reply Quote 0
                • ustkU
                  ustk
                  last edited by ustk

                  @SteveRiggs Just a wee tip

                  inline function onEqBypassControl(component, value)
                  {
                  if (value ==1)
                      {
                      LF EQ.setBypassed(0);
                      LMF EQ.setBypassed(0);
                      HMF EQ.setBypassed(0);
                      HF EQ.setBypassed(0);
                      }
                  else
                      {
                      LF EQ.setBypassed(1);
                      LMF EQ.setBypassed(1);
                      HMF EQ.setBypassed(1);
                      HF EQ.setBypassed(1);
                      }
                  };
                  

                  Can be simplified in:

                  inline function onEqBypassControl(component, value)
                  {
                      LF EQ.setBypassed(! Value);
                      LMF EQ.setBypassed(! Value);
                      HMF EQ.setBypassed(! Value);
                      HF EQ.setBypassed(! Value);
                  };
                  

                  And if you put your EQs in an array you can gain two more lines ☺ :

                  inline function onEqBypassControl(component, value)
                  {
                      for (i = 0; i < myEqArray.length; i++){
                          myEqArray[i].setBypassed(! Value);
                      ]
                  };
                  

                  Can't help pressing F5 in the forum...

                  SteveRiggsS 1 Reply Last reply Reply Quote 2
                  • SteveRiggsS
                    SteveRiggs @ustk
                    last edited by

                    @ustk Awesome! Thanks man. Thats going to save me a lot of lines in this one now 😀

                    www.anarchyaudioworx.com

                    www.facebook.com/groups/audioworx/

                    1 Reply Last reply Reply Quote 0
                    • Christoph HartC
                      Christoph Hart
                      last edited by

                      And if you use the for in loop you gain a few more characters:

                      for(eq in eqs)
                          eq.setBypassed(value);
                      
                      1 Reply Last reply Reply Quote 2
                      • First post
                        Last post

                      49

                      Online

                      1.7k

                      Users

                      11.7k

                      Topics

                      101.9k

                      Posts