HISE Logo Forum
    • Categories
    • Register
    • Login

    Hardcoded FX get properties of attribute

    Scheduled Pinned Locked Moved Scripting
    9 Posts 3 Posters 398 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.
    • d.healeyD
      d.healey
      last edited by

      Is it possible to get the properties of one of the hardcoded FX knobs? I'm interested in getting the min/max/step size specifically.

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

      Christoph HartC 1 Reply Last reply Reply Quote 0
      • Christoph HartC
        Christoph Hart @d.healey
        last edited by

        @d-healey Yes, I could return a JSON object for each parameter that you could then just pass on to the sliders with our old friend setPropertiesFromJSON().

        d.healeyD 1 Reply Last reply Reply Quote 2
        • d.healeyD
          d.healey @Christoph Hart
          last edited by

          @Christoph-Hart Sounds like a very good idea to me.

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

          Christoph HartC 1 Reply Last reply Reply Quote 0
          • Christoph HartC
            Christoph Hart @d.healey
            last edited by Christoph Hart

            @d-healey Alright, I've pushed this.

            const var HardcodedMasterFX1 = Synth.getSlotFX("HardcodedMasterFX1");
            const var obj = HardcodedMasterFX1.getParameterProperties();
            

            It returns an array with these properties:

            [
              {
                "text": "Oversampling",
                "min": 0.0,
                "max": 4.0,
                "stepSize": 1.0,
                "middlePosition": 2.0,
                "defaultValue": 0.0
              },
              {
                "text": "Frequency",
                "min": 20.0,
                "max": 20000.0,
                "stepSize": 0.1000000014901161,
                "middlePosition": 1000.000048402122,
                "defaultValue": 7804.89990234375
              }
            ]
            

            and setting up a slider is now as easy as

            const var Knob1 = Content.getComponent("Knob1");
            
            inline function onButton1Control(component, value)
            {
            	Content.setPropertiesFromJSON("Knob1", obj[value]);
            	Knob1.setValue(obj[value].defaultValue);
            };
            
            Content.getComponent("Button1").setControlCallback(onButton1Control);
            
            d.healeyD ? 3 Replies Last reply Reply Quote 2
            • d.healeyD
              d.healey @Christoph Hart
              last edited by

              @Christoph-Hart Oh that's excellent, thank you!

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

              1 Reply Last reply Reply Quote 0
              • d.healeyD
                d.healey @Christoph Hart
                last edited by

                @Christoph-Hart I don't know if you saw this yet but I'm trying to get the name of the currently loaded effect.

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

                Christoph HartC 1 Reply Last reply Reply Quote 0
                • Christoph HartC
                  Christoph Hart @d.healey
                  last edited by

                  @d-healey Done.

                  d.healeyD 1 Reply Last reply Reply Quote 2
                  • d.healeyD
                    d.healey @Christoph Hart
                    last edited by

                    @Christoph-Hart You're on fire!

                    alt text

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

                    1 Reply Last reply Reply Quote 0
                    • ?
                      A Former User @Christoph Hart
                      last edited by A Former User

                      I have an object that stores the parameter properties for some slot effects like below:

                      const fxSlotParamList = {	
                      
                      "Saturator" : [
                      				{
                      				    "text": "Saturation",
                      				    "min": 0.0,
                      				    "max": 1.0,
                      				    "stepSize": 0.01,
                      				    "middlePosition": 0.5,
                      				    "defaultValue": 0.22
                      				},
                      				
                      				{
                      				    "text": "Wet",
                      				    "min": 0.0,
                      				    "max": 1.0,
                      				    "stepSize": 0.01,
                      				    "middlePosition": 0.5,
                      				    "defaultValue": 0.9
                      				},
                      				
                      				{
                      				    "text": "Post Gain",
                      				    "min": -24.0,
                      				    "max": 0.0,
                      				    "stepSize": 0.01,
                      				    "middlePosition": -10.0,
                      				    "defaultValue": -1.0
                      				}
                      			],
                      		
                      		
                      				
                      "SimpleReverb" : [
                      				{
                      				    "text": "Room",
                      				    "min": 0.0,
                      				    "max": 1.0,
                      				    "stepSize": 0.01,
                      				    "middlePosition": 0.5,
                      				    "defaultValue": 0.0
                      				},
                      				
                      				{
                      				    "text": "Damping",
                      				    "min": 0.0,
                      				    "max": 1.0,
                      				    "stepSize": 0.01,
                      				    "middlePosition": 0.5,
                      				    "defaultValue": 1.0
                      				},
                      				
                      				{
                      				    "text": "Wet",
                      				    "min": 0.0,
                      				    "max": 1.0,
                      				    "stepSize": 0.01,
                      				    "middlePosition": 0.5,
                      				    "defaultValue": 1.0
                      				}
                      			],				
                      				
                      				
                      };
                      

                      I have an idx value that captures the index of the dedicated slot in the array and when we combine these for setting the knob properties from JSON, let's say WetAmount parameter of the Saturator:

                      Content.setPropertiesFromJSON("arrayed_FXSlot_Slider" + [idx], fxSlotParamList.Saturator[1]);
                      

                      Slider properties aren't updated, am I doing a syntax error, couldn't figure it out.

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

                      46

                      Online

                      1.7k

                      Users

                      11.7k

                      Topics

                      102.1k

                      Posts