Forum
    • Categories
    • Register
    • Login

    Knob values displayed as percentage

    Scheduled Pinned Locked Moved Scripting
    44 Posts 2 Posters 138 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 @Jeetender
      last edited by

      @Jeetender setAttributeNormalized Do you see this function in the API browser?

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

      J 1 Reply Last reply Reply Quote 0
      • J
        Jeetender @David Healey
        last edited by Jeetender

        @David-Healey it was written in my notes.. setAttribute was giving an error so i added setattributnormalized as in java, but now it works, the controller are working and the values are displaying.... but now as i set the attribut for the slider, it gives an error

        Line 85, column 21: Illegal type: string, expected: number {{SW50ZXJmYWNlfHwyMTAyfDg1fDIx}}

        const Knob3 = Content.getComponent("Gain");
        Knob3.setControlCallback(onGainControl);
        
        inline function onGainControl(component, value)
        {
        	var dbValue;
        		
        	if (value < 0.567)
        	{
        		dbValue = ((value + 1) / (0.567 + 1)) * 60 - 60;
        	}
        	else
        	{
        		dbValue = ((value - 0.567) / (1 - 0.567)) * 12;
        	}
        	
        	Panel3.set("text", Math.round(dbValue) + " dB");
        	Panel3.repaint();
        	
        	DspNet.setAttribute("DspNet.gain", value); // this is line 85
        }
        
        const Panel3 = Content.getComponent("GainPanel");
        Panel3.setPaintRoutine(function(g)
        {
        	var c = this.getLocalBounds(0);
        	
        	g.setColour(this.get("textColour"));
        	g.drawAlignedText(this.get("text"), c, "centred");
        });
        
        
        David HealeyD 1 Reply Last reply Reply Quote 0
        • David HealeyD
          David Healey @Jeetender
          last edited by

          @Jeetender said in Knob values displayed as percentage:

          "DspNet.gain"

          You've added quotation marks again

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

          J 1 Reply Last reply Reply Quote 0
          • J
            Jeetender @David Healey
            last edited by Jeetender

            @David-Healey 😖 you know what david, my screen time for today is beyond limits, i think i should take a break and continue tomarrow.. too much coding for today.. But thank you the plugin is done.

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

            13

            Online

            2.3k

            Users

            13.6k

            Topics

            118.3k

            Posts