Forum
    • Categories
    • Register
    • Login

    Button to activate LFO Modulation 1 and Modulation 2

    Scheduled Pinned Locked Moved Scripting
    14 Posts 2 Posters 516 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.
    • David HealeyD
      David Healey @treynterrio
      last edited by

      @treynterrio What have you tried so far?

      Free HISE Bootcamp Full Course for beginners.
      YouTube Channel - Public HISE tutorials
      My Patreon - HISE tutorials

      T 1 Reply Last reply Reply Quote 0
      • T
        treynterrio @David Healey
        last edited by

        @d-healey ```
        code_text

        const var Knob13 = Content.getComponent("Knob13");
        
        const var LFOMOD1 = Synth.getModulator("LFO MOD 1");
        const var LFOMOD2 = Synth.getModulator("LFO MOD 2");
        inline function onKnob13Control(component, value)
        {
            LFOMOD1.setAttribute(LFOMOD1.SmoothingTime, value);
            LFOMOD2.setAttribute(LFOMOD2.SmoothingTime, value);
        };
        
        Knob13.setControlCallback(onKnob13Control);
        
        inline function onLFOONOFFControl(component, value)
        {
            if(value == 1)
            {
                LFOMOD1.setAttribute(LFOMOD1.("LFO MOD 1"), 0);
                LFOMOD2.setAttribute(LFOMOD2.("LFO MOD 2"), 0);
            }
        };
        
        Content.getComponent("LFOONOFF").setControlCallback(onLFOONOFFControl);
        David HealeyD 1 Reply Last reply Reply Quote 0
        • David HealeyD
          David Healey @treynterrio
          last edited by

          @treynterrio said in Button to activate LFO Modulation 1 and Modulation 2:

          LFOMOD1.("LFO MOD 1")

          Where did you get this from?

          Free HISE Bootcamp Full Course for beginners.
          YouTube Channel - Public HISE tutorials
          My Patreon - HISE tutorials

          T 1 Reply Last reply Reply Quote 0
          • T
            treynterrio @David Healey
            last edited by

            @d-healey I don't have what comes after the LFOMOD1 I know that I've to type something after the .

            David HealeyD 1 Reply Last reply Reply Quote 0
            • David HealeyD
              David Healey @treynterrio
              last edited by

              @treynterrio

              setAttribute allows you to set a property of a module, in this case an LFO.

              The function requires two parameters. The first is the ID of the property you want to set. To find a list of the property IDs that are available you can type the name of your module variable, in your case that's LFOMOD1 followed by a . and then look in the auto-complete popup to see the property IDs.

              The second parameter is the value. For a button that's either going to be 1 or 0. In your case you've put 0 for both which would just mean off. What you want to put there is value so you are passing in the button's value.

              However all of this is just for education because you don't need to use setAttribute. Take a look in the API browser and you'll see a better function for this purpose.

              2d87e212-bee2-4d91-bf7c-aa04fd809bfb-image.png

              Free HISE Bootcamp Full Course for beginners.
              YouTube Channel - Public HISE tutorials
              My Patreon - HISE tutorials

              T 1 Reply Last reply Reply Quote 0
              • T
                treynterrio @David Healey
                last edited by treynterrio

                @d-healey I have this now Compiled OK but nothing changes when I click the button ```
                code_text

                const var LFOONOFF = Content.getComponent("LFOONOFF");
                inline function onLFOONOFFControl(component, value)
                {
                    if(value == 1)
                    {
                        LFOMOD1.setBypassed(LFOMOD1,0);
                        LFOMOD1.setBypassed(LFOMOD2,0);
                    }
                };
                David HealeyD 1 Reply Last reply Reply Quote 0
                • David HealeyD
                  David Healey @treynterrio
                  last edited by

                  @treynterrio look at the API, it tells you how to use the function.

                  Free HISE Bootcamp Full Course for beginners.
                  YouTube Channel - Public HISE tutorials
                  My Patreon - HISE tutorials

                  T 1 Reply Last reply Reply Quote 0
                  • T
                    treynterrio @David Healey
                    last edited by

                    @d-healey ```
                    code_text

                    const var LFOMOD = Content.getComponent("LFOMOD");
                    inline function onLFOMODControl(component, value)
                    {
                        {
                            LFOMOD1.setBypassed(bool, shouldBeBypassed);
                            LFOMOD2.setBypassed(bool, shouldBeBypassed);
                        }
                    };
                    David HealeyD 1 Reply Last reply Reply Quote 0
                    • David HealeyD
                      David Healey @treynterrio
                      last edited by

                      @treynterrio i think you should watch my scripting 101 video

                      Free HISE Bootcamp Full Course for beginners.
                      YouTube Channel - Public HISE tutorials
                      My Patreon - HISE tutorials

                      T 1 Reply Last reply Reply Quote 0
                      • T
                        treynterrio @David Healey
                        last edited by

                        @d-healey I don't understand what bool is when I google it, it says true or false but when I paste something like this nothing happens everything I try says Compiled OK

                        David HealeyD 1 Reply Last reply Reply Quote 0
                        • David HealeyD
                          David Healey @treynterrio
                          last edited by

                          @treynterrio bool is the type value, it needs to be either 0 or 1 (true or false).

                          Free HISE Bootcamp Full Course for beginners.
                          YouTube Channel - Public HISE tutorials
                          My Patreon - HISE tutorials

                          T 1 Reply Last reply Reply Quote 0
                          • T
                            treynterrio @David Healey
                            last edited by

                            @d-healey I tried 0 and 1 as well but I get error after error now

                            David HealeyD 1 Reply Last reply Reply Quote 0
                            • David HealeyD
                              David Healey @treynterrio
                              last edited by

                              @treynterrio You don't want to use a fixed value because then it will always be on or always be off. You want to use your button's value.

                              Start with the basics

                              https://youtu.be/8JO4m-OloqA

                              Free HISE Bootcamp Full Course for beginners.
                              YouTube Channel - Public HISE tutorials
                              My Patreon - HISE tutorials

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

                              38

                              Online

                              2.1k

                              Users

                              13.0k

                              Topics

                              112.8k

                              Posts