HISE Logo Forum
    • Categories
    • Register
    • Login

    Scripting dynamics = value inconsistency

    Scheduled Pinned Locked Moved Bug Reports
    20 Posts 6 Posters 639 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.
    • Dan KorneffD
      Dan Korneff
      last edited by

      Using the latest scriptnode.
      I'm trying to script the threshold control of the dynamics, but the value of my knob is inconsistent with the value on the dynamics module. Depending on how fast you turn the knob, it'll give you a different value when it's supposed to reach the 0dB point.
      Here's an example. Turn the knob and compare to the compressor module threshold.

      HiseSnippet 1024.3ocuV0saaTDEdl3L.dKthVw8rJhKbjJQqKskJUgparcPVkjZEGpnRHJi2cb7nL6Lq1c1RMUQhWivU7ZvUj2BdLnuAvY1em3rJMXI5d247cNy4al4b9lcRrxmkjnhQ31GsLhgveLY5RodwfETtDMdHBeSx9zDMK1M20tKinIIr.DF25aLNvs2Dk881GuKUPk9rZWHzyUbe12xC45ZuS5+TtPrGMfcDOzJ560eruRNPITo.eZQ7PQT+SnGyNfZBaCBB+AiB3ZU7TMUyRP3M2UErb5B0OKyi+47D9LAyXzCMEVnb26oDAFFa7hFrfKBlTtuSPvpLo9TnU9ovmR1mGvq7WeZ7IY.t0YXedf23pnWu2M87ZhdXK5sYN8tEYpeLORWiX31MHikvE0bJbEXSq7XQa7WXx.EDgTuSH8D1dwfQUFcefm2cbuum21OpiSGG3hHQ69JZr6vkRZH2Oom6W6l0ZrywL8n4yY95taUAtkIs5jdpTMyjPY8fTFnBiTRvn6VYnakWnNNbofKYtySk9ZtR5dzhXVxB3LwsqeYN2AVUQJa6NNuoiiawGeta2R2FaKnJdsSBS+DsNlOKUC6wx04QYQdpyoYbHiOlHMzMVIFPEhYPqW2JpX3ZEAUxCTZ1yjc214MNscN0wcUn4yaDqX4Er3FgMSCwWUhckogyXwkahx.g1hK12ciqWeme9kiUfJ4XIW+rHVgs8fS4ttD0CUsYscUuGs8ls0ZHrZWWtwGUz7XFAJBGBUmM.byhAfoBd.KFwAN9gjrqQT1YisDD56FOjpokKCrhPUhXwZt4rBOj8JPhJetpMYHK4DsJJK1hdOD14cVzWWWvep+xJie8G6GxCBDrIpDt4trNr6dNHpFMk+KYb82Ny78GONzVP8EmGRes8NIIc9bN3gPbC1EEpBJnrOeFS.5pWRm.TqTAoBp9hRXFc6B.Cmr0JL5ARfqKs00+Onq4cskcutz8VjIbs+hl46FMvW3h9+a9V7JQGRtNXMY2jr22+d9IgamyEGRolWwaAURfq7jslMRRgRFXehYbWI1sJ.neBhg1MDFuGxDLZh0j1K5aFYhynUCknFrgB81+rF9Pysrc0pgVkIetUIafOY+2AqIxTfrJS98yN6yNu.6x65BfKVH2e3uGYwh8gGVSiZnTWF.25hsFstdsFMzYdnJUykGuOEdmyHObPZ3T3en7YPioTxDvhSvaXtCxs8L1FJLkICxL9G3q.rmwFW.1qD78RMBo9wpW5mq0a5y+nLOv9Vl8GfsgeEErcqD4IDuc7PfDK+k99louu.lbaNm6tF47kqQN2aMx49qQNOXMx4qVibd3Uli4mgeRpVElqLCNlLJ6wVLtZpC2B8uYmCTDA

      Dan Korneff - Producer / Mixer / Audio Nerd

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

        Figured it out.. if I remove the if (value) statement, it works as expected

        inline function Threshold (component, value)
        {
        if (value)
        {
        Dynamics1.setAttribute(6, value);
        }
        };

        Knob1.setControlCallback(Threshold);

        Dan Korneff - Producer / Mixer / Audio Nerd

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

          Yes why do you had that if in the first place? Also, MAGIC NUMBER ALERT!!! ;)

          LindonL Dan KorneffD 2 Replies Last reply Reply Quote 1
          • LindonL
            Lindon @Christoph Hart
            last edited by

            @Christoph-Hart yeah;

            MAGIC NUMBER == BAD!

            • do we have a list somewhere of all the Global Constants, I ask because I recently needed to do something to the sample properties and I couldn't find anything so had to use a magic number....??

            HISE Development for hire.
            www.channelrobot.com

            1 Reply Last reply Reply Quote 1
            • Dan KorneffD
              Dan Korneff @Christoph Hart
              last edited by Dan Korneff

              @Christoph-Hart said in Scripting dynamics = value inconsistency:

              Yes why do you had that if in the first place?

              In my defense, it was 4am 🙃 🙃 😵

              Also, MAGIC NUMBER ALERT!!!
              I've been taking them from the module browser. Should I be calling them differently?

              Dan Korneff - Producer / Mixer / Audio Nerd

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

                @dustbro there really really should be a set of constants you use, its just finding where these are documented thats sometimes the problem...

                so

                Dynamics1.setAttribute(Dynamics1.Threshold,value)

                HISE Development for hire.
                www.channelrobot.com

                d.healeyD 1 Reply Last reply Reply Quote 1
                • d.healeyD
                  d.healey @Lindon
                  last edited by

                  @Lindon Most are documented in the module browser. Just right click the module name. You can also use the auto-complete in your script to bring up a list of constants.

                  c1fb1ded-5441-4d6c-9669-5c81a6321a49-image.png

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

                  LindonL Dan KorneffD 2 Replies Last reply Reply Quote 2
                  • ustkU
                    ustk
                    last edited by

                    I have the Module Browser permanently displayed, so it's quick to find what I need, but this might not be the best coding style. Will work on that... I promise...

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

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

                      Yes, module browser is useful for this, but the new documentation will contain a searchable reference for all modules including parameter IDs etc.

                      Meanwhile, I actually prefer the autocomplete window to give me the Parameter IDs.

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

                        @d-healey well on this very subject...

                        first I have no idea how to open this module browser - where is it?

                        and second can anyone tell me the correct association between the values returned by the autocomplete for

                        Degrade1.setAttribute(Degrade1.???????)

                        and the names on the Degrade knobs?

                        which say

                        Harmonics
                        Bit Crush
                        Gain
                        Sample rate
                        Post Filter

                        whilst autocomplete says:
                        Headroom
                        Quant
                        Rate
                        PostFilt
                        NonLin
                        DryWet

                        HISE Development for hire.
                        www.channelrobot.com

                        1 Reply Last reply Reply Quote 0
                        • Dan KorneffD
                          Dan Korneff @d.healey
                          last edited by

                          @d-healey said in Scripting dynamics = value inconsistency:

                          You can also use the auto-complete in your script to bring up a list of constants

                          The autocomplete doesn't work when you're iterating thru an array, that's why I started using the Magic Numbers. Much easier to type 🤡

                          Dan Korneff - Producer / Mixer / Audio Nerd

                          d.healeyD 1 Reply Last reply Reply Quote 0
                          • d.healeyD
                            d.healey @Dan Korneff
                            last edited by

                            @Lindon You need to add it to the interface. I have plans for a video on the subject but no-one was interested :(
                            da5ee494-0971-457c-b1e2-395e4b068e47-image.png

                            @dustbro

                            Whatchu talkin bout?

                            21fd8657-18bc-43f5-be7d-d2cbdf4b7dd5-image.png

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

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

                              @d-healey well this now gets sillier and sillier...

                              add a degrade fx to you project and it shows you a set of buttons with these names:

                              Harmonics
                              Bit Crush
                              Gain
                              Sample rate
                              Post Filter

                              Create a variable for the fx and press to get autocomplete and it shows you these attributes:

                              Headroom
                              Quant
                              Rate
                              PostFilt
                              NonLin
                              DryWet

                              Open a module browser and right lick on Degrade and it shows you this set of parameters;

                              1. Threshold
                              2. Output
                              3. Attack
                              4. Release
                              5. Knee

                              Unless I'm doing something completely daft(not outside the bounds of possibility) I think this is broken.

                              HISE Development for hire.
                              www.channelrobot.com

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

                                No, what he meant was that it will not be able to parse the iterator variable as array expression and detect it as object.

                                This is true, but it works for standard array syntax (actually pressing escape kind of "runs" a little script that is able to evaluate some basic expressions to receive the object, but it fails with every scoped variable like iterators or local variables).

                                autocomplete.gif

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

                                  I really need to remove these old modules, I haven't used them for years and they are completely broken.

                                  There are bit crush and sample reduction nodes available in scriptnode, which should work better and more consistently.

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

                                    @Lindon I just worked out the documentation is OFF by one press degrade to get the params for the limiter, press Chorus to get the params for the degrade FX...

                                    now can anyone (@Christoph-Hart ) tell me how those are mapped to the knobs in the FX?

                                    HISE Development for hire.
                                    www.channelrobot.com

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

                                      @Christoph-Hart but I'm under a tight deadline and I dont have the time to learn scriptnode now, so I'd like these to work,

                                      HISE Development for hire.
                                      www.channelrobot.com

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

                                        @Christoph-Hart @d-healey When I used the method in Christoph's video (with [i] ) the popup doesn't work.
                                        so if I type something like myList[i]. = no popup

                                        Dan Korneff - Producer / Mixer / Audio Nerd

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

                                          @Lindon said in Scripting dynamics = value inconsistency:

                                          now can anyone (@Christoph-Hart ) tell me how those are mapped to the knobs in the FX?

                                          You can add a knob with its callback, then you test the attributes from 0 to 5 while you look at what is moving in the module...

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

                                          1 Reply Last reply Reply Quote 0
                                          • ulrikU
                                            ulrik @Dan Korneff
                                            last edited by

                                            @dustbro I can confirm it does not work for me either on arrays with [i]

                                            Hise Develop branch
                                            MacOs 15.3.1, Xcode 16.2
                                            http://musikboden.se

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

                                            48

                                            Online

                                            1.7k

                                            Users

                                            11.7k

                                            Topics

                                            101.9k

                                            Posts