HISE Logo Forum
    • Categories
    • Register
    • Login

    Range (min/max) of an attribute of an effect

    Scheduled Pinned Locked Moved Unsolved Scripting
    12 Posts 3 Posters 46 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.
    • Oli UllmannO
      Oli Ullmann
      last edited by

      Hey everyone,

      is it possible to obtain the range, i.e., the minimum, maximum and middle point values of an attribute of a loaded effect?

      Many thanks,
      Oli

      1 Reply Last reply Reply Quote 0
      • Oli UllmannO
        Oli Ullmann
        last edited by Oli Ullmann

        To clarify what I mean:
        I connect UI sliders to the parameters of my effect using .set("processorId",...) and .set("parameterId",...). It works great!

        However, this means that the min/max/middle point values are not automatically correct. How can I ensure that the values match?

        This happens when loading the effect and not just when loading a preset, which is why I don't think I can use updateConnectedComponentsFromModuleState.

        d.healeyD 1 Reply Last reply Reply Quote 0
        • d.healeyD
          d.healey @Oli Ullmann
          last edited by

          @Oli-Ullmann You're referring to scriptnode effects?

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

          Oli UllmannO 1 Reply Last reply Reply Quote 0
          • Oli UllmannO
            Oli Ullmann @d.healey
            last edited by

            @d-healey
            No, I have an effect slot where I load effects via script and then connect the sliders in my UI via script.

            And I have a hardcoded effect that I use to do the same thing. So I load precompiled effects via script and then connect the parameters of the effects via script.

            Are you familiar with the “Enable Connection Learn” feature? It does exactly what I need. I can't access it via script, only with the mouse via the Interface Designer.

            d.healeyD 1 Reply Last reply Reply Quote 0
            • d.healeyD
              d.healey @Oli Ullmann
              last edited by

              @Oli-Ullmann said in Range (min/max) of an attribute of an effect:

              I have an effect slot

              Perfect - you can use SlotFX.getParameterProperties()

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

              Oli UllmannO 1 Reply Last reply Reply Quote 0
              • Oli UllmannO
                Oli Ullmann @d.healey
                last edited by

                @d-healey
                Hey David,

                That sounds great! :-) However, the parameter is undefined for me. Or am I doing something wrong?

                Here's a snippet:

                HiseSnippet 1101.3oc2Vs0aaaCElxIpnQ6BZw1a6Eg7jxPVfctWLLrz3KsFaN0nNKHCECALTGEyEJRMR5rHLzel6+w9GrcnjrsbS5VfQ2dX9Aabt98QdtPOTqXfwnzDufSyy.h2G6OJWZG2dLkKI86P79BeiPY6c6HAOFzCoZZJXA8ofwRNNOiZLPLwyakW3BvasUIEe9iu8XpfJYvbUDxYJNC9ddJ2NW6vi9NtPziFCmxSq48tG0mojsUB0Djbq32jjQYWSuBNg5bqgO4kTyXh2W5uGzDZs29IOaWFc6C1NYmcX6r8y1OlEmbPyVGt+trDXmD1gDuG0MlaU5QVpELDuUOVEmOZr5Wkk.bF2vuT.NgVjQHxkp6oDwtinSKo8XtHd3zaMCAyxv42gqTdG949C3w7Y5meW9jBCgyin9EnWiEo2JKPuV0oWyZz6dnjWMJsZIkdp+HllmYmawwmOxuuDqkITrNUmJk9RZbVC+1JzCocqT50POMJLKhn8a1byP7qM95f.rVYrgtNkvuIrnCZqq.6HWmy4Qq6zu9ht0VkdoB8cZ9QuQUYJIJTFPgGtnlIrkw4jzpUh1Tg3RrgHBS3TyUlliCjj.LqAQw4iChAp3IBrEzXibtsPliVmagTy5aFtdAWST5HHjKmllMBVat+z339n2QfyStTvkPXxDIyxUxv6xoH1zy1lg2PESfMB9sxz4PtaA.QU37lBGB+pvV+Dl70vLXTBXqLMGuYrZ2M+ziyroQrrlAZKGLQarAF0aQVETiOmnrvqjQEnF71fv20TRx8Zqh8BPeulcSr5+t.ijSRuDz0OyNGwtxEa08e+s50mDYk8J0bTI6K41WkAx227IopAyMVTwJzUawPwSpFJJpTGqtkvicyDyJdjBZWeoF4G52gZoSSFl2427ntNvM3FtxIt076.lqsprBeqp93NnGHz2NC1i94ixmyge7nhtTh2u6Gzdh9Fn6uDLhmlIfWC2.5KqDbaiCPJdiRLwUSB5.BZdP6wJ8DSvvwTCz67fQfL18C0NQSw5QPIoPUCUh7YBcSyr43ucxkzTNyD7bIUja.z+wzLWhdIUGyT3ZxvATC1OFVWmKWYiURNC05V.N.vxfTkBAmn3F3EZjrCQ5AZRJEO39deVwSC2YKFt+zM.6nZ8kptCakA7ntvlL21JogayqWE+fso8gRwm5OjaYiueN13d3H1f8uAGqde5S7K23Lmfq5267+CdLpB+G6W9vPAzOpnoeQvW4ACdqGN39SmKqFaJP+SKP+hoppyhSlj1iKvlY2BJOWMoWuS6JoHxeXYI40JbFUd0.pUycs+Hxiv+1CCvBjTBhBBzvsKqTt4TB4leKD9S7SkwVNYuJislZ7+MXjRYZ0ErxM4tR7iKzf2sxh+X3Z9Cbxgsd2k2DRJt54BFawTcm.2dYCbmkMvcW1.2aYCb+kMvCV1.O7eNP2KCOehUkVtgjPFLrawisdd0l5H+01mppv
                
                d.healeyD 1 Reply Last reply Reply Quote 0
                • d.healeyD
                  d.healey @Oli Ullmann
                  last edited by

                  @Oli-Ullmann I'm not sure, looks like a bug to me.

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

                  Oli UllmannO 1 Reply Last reply Reply Quote 0
                  • Oli UllmannO
                    Oli Ullmann @d.healey
                    last edited by

                    @d-healey
                    Oh no! I can still solve it using a gigantic switch statement, but that's not really good practice.
                    Thanks anyway, David! :-)

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

                      @Oli-Ullmann said in Range (min/max) of an attribute of an effect:

                      @d-healey
                      Oh no! I can still solve it using a gigantic switch statement, but that's not really good practice.
                      Thanks anyway, David! :-)

                      well essentially I use a json object that defines (for each FX) the UI widgets being used, and what their values are like this:

                      {
                      	EffectName:"CHORUS",
                      	EffectHardCodedName:"ChorusFX",
                      	NumControls: 6,
                      	ControlText: ["Rate","Feedback","Depth","LFO","FX Gain","Mix"],
                      	ControlTargetNumber: [1,3,2,5,4,0],
                      	ControlMinimums: [0.1,-100,0,0,-100,0],
                      	ControlMaximums: [1,50,1,.3,6,1],
                      	ControlMultipliers: [40,0.01,1,1,1,1],
                      	ControlModes: ["NormalizedPercentage", "Linear","NormalizedPercentage","NormalizedPercentage","Decibels","NormalizedPercentage"],
                      	ControlStepSize:[0.01,1,0.01,0.01,1,0.01],
                      	ControlSuffix:[" %"," %"," %"," %"," dB"," %"],
                      	ControlMiddlePosition:[.5,0,.5,.15,-12,.5],
                      	ControlDefaultValue:[.08,35,.1,.17,0,.5],
                      	ControlsRow1:3,
                      	ControlsRow2:3
                      },
                      

                      and when the effect is chosen, and loaded into the slot/hardcoded FX I just run thru this setting up the widgets... it does everything from showing/hiding(NumControls) to assigning to the hardcoded FX param(ControlTargetNumber) and where they appear on the FX panel (Row1 and Row2)

                      pretty simple really...

                      HISE Development for hire.
                      www.channelrobot.com

                      Oli UllmannO 1 Reply Last reply Reply Quote 0
                      • Oli UllmannO
                        Oli Ullmann @Lindon
                        last edited by

                        @Lindon
                        Yes, that's right, it's pretty simple, and I'm now doing something similar for the HISE internal effects (not for the hardcoded effects, because the function works there).

                        But with SlotFX.getParameterProperties(), there's much less code to write. And that's better for maintenance and if you want to add new effects in updates.

                        d.healeyD 1 Reply Last reply Reply Quote 0
                        • d.healeyD
                          d.healey @Oli Ullmann
                          last edited by

                          @Oli-Ullmann I think it would be even nicer if this was available for effects, whether or not they are using a slot.

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

                          Oli UllmannO 1 Reply Last reply Reply Quote 0
                          • Oli UllmannO
                            Oli Ullmann @d.healey
                            last edited by Oli Ullmann

                            @d-healey
                            That's right. Because with SlotFX.getCurrentEffect(), you always get the effect loaded in the slot. So you could also implement it in the effect class and still have access to the functionality from a slot.

                            So I believe... :-)

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

                            31

                            Online

                            2.0k

                            Users

                            12.7k

                            Topics

                            110.2k

                            Posts