HISE Logo Forum
    • Categories
    • Register
    • Login

    Possible to get a button that is already connected to a ProcessorID to also show/hide another knob?

    Scheduled Pinned Locked Moved Scripting
    19 Posts 3 Posters 202 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.
    • ChazroxC
      Chazrox @jeffd
      last edited by Chazrox

      @jeffd

      Check this out. Might help. I got this from @d-healey (I may have added a couple things to tailor to my code but I cant remember. Logic is still the same). I think you're trying to do the same thing I was trying to do. Read this code and you should get whats happening. You dont need to hide diffrent knobs. Just change the 'modes' and values via script.

      
         const var Delay1 = Synth.getEffect("Delay1");
         const var btnDelaySync = Content.getComponent("btnDelaySync");
         
         const var Knob62 = Content.getComponent("Knob62");
      
         const var Knob79 = Content.getComponent("Knob79");
         
         inline function onKnob62Control(component, value)
         {
         	setDelayTime(value);
         	//Console.print(value);
         };
         
         Content.getComponent("Knob62").setControlCallback(onKnob62Control);
         
         
         inline function onKnob79Control(component, value)
         {
         	setDelayTime(value);
         	//Console.print(value);
         
         };
         
         Content.getComponent("Knob79").setControlCallback(onKnob79Control);
         
         const var ScriptPane8 = Content.getComponent("ScriptPanel8");
         
         
         
         //! Buttons1
         inline function onbtnDelaySyncControl(component, value)
         {
         	local ScriptPanel8 = Content.getComponent("ScriptPanel8");
         	local LblPan756 = Content.getComponent("LblPan756");
         	local LblPan47 = Content.getComponent("LblPan47");
         	
      
         	if (value)
         	{
         		changeMode(value);
         		ScriptPanel8.showControl(true);
         		ScriptPanel8.changed();
         		LblPan756.showControl(true);
         		LblPan47.showControl(false);
         		
         		
         	}
         	else
         	{
         		changeMode(value);
         		ScriptPanel8.showControl(false);
         		ScriptPanel8.changed();
         		LblPan756.showControl(false);
         		LblPan47.showControl(true);
         		
         	}
         };
         
         Content.getComponent("btnDelaySync").setControlCallback(onbtnDelaySyncControl);
         
         //! Functions
         inline function changeMode(mode: number)
         {
         	Delay1.setAttribute(Delay1.TempoSync, mode);
         
         	if (mode)
         	{
         			Knob62.set("mode", "TempoSync");
         			Knob79.set("mode", "TempoSync");			
         	}
         	else
         	{
         		Knob62.set("mode", "Time");
         		Knob79.set("mode", "Time");			
         	}
      
         		
         		Knob62.changed();
         		Knob79.changed();
         	}
         
         inline function setDelayTime(value: number)
         {
         	Delay1.setAttribute(Delay1.DelayTimeLeft, value);
         	Delay1.setAttribute(Delay1.DelayTimeRight, value);
         }	
      
      
      1 Reply Last reply Reply Quote 0
      • ChazroxC
        Chazrox
        last edited by

        Here's what it does.

        You can see that the knob values change from miliseconds to beat divisions when I turn 'sync' on and off. What I did with this one was just hide/show the colored panel under the knobs for some visual cue that it has changed. I also show that the knobs are in fact the same knobs whether in sync off/on mode.

        Hope this helps.

        Forum - Delay Sync Times Change Example.gif

        (I also just realized my button says "SYN" lol **SYNC)

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

          @jeffd As @Chazrox Once you connect via processor/parameter ID you are using HISE's internal control callback so you can't use a custom one. It's one or the other.

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

          J 1 Reply Last reply Reply Quote 1
          • J
            jeffd @d.healey
            last edited by jeffd

            @d-healey ok thats what i was thinking.

            how do i find the parameter id for a hardcoded master effect for scripting?
            this is part of the problem i am having.

            or i should add, how do i find the different parameter ids for a particular hardcoded master effect.
            i can get the script definition, but each parameter id is a knob i created in script node.
            are they just identified as in an Array and numbered 0 to however many ?

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

              @jeffd It should be the same name you gave it in the network. It might also show up in the console when you right-click on the module header and select Dump Parameter IDs and Values.

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

              J 1 Reply Last reply Reply Quote 0
              • J
                jeffd @d.healey
                last edited by

                @d-healey

                ok..i see the parameter dump
                my delay paramter that is free in miliseconds is listed as parameter 0..so i tried this:

                const var KnobDelayTime1 = Content.getComponent("KnobDelayTime1");
                    
                    inline function onknobDelayTime1Control(component, value)
                    {
                    	HardcodedMasterFX3.setAttribute(0, value);    	
                    };
                    
                    Content.getComponent("KnobDelayTime1").setControlCallback(onKnobDelayTime1Control);
                

                but this doesnt work
                what am i missing?

                or do i need to use the string name?
                [0]: "TimeFree"

                ChazroxC d.healeyD 2 Replies Last reply Reply Quote 0
                • ChazroxC
                  Chazrox @jeffd
                  last edited by Chazrox

                  @jeffd typo. Everything should be "KnobDelayTime1".

                  inline function on👽 knobDelayTime1Control(component, value)

                  J 1 Reply Last reply Reply Quote 0
                  • J
                    jeffd @Chazrox
                    last edited by

                    @Chazrox ah!!!

                    thanks!! working now..
                    ill keep going

                    ChazroxC 1 Reply Last reply Reply Quote 0
                    • ChazroxC
                      Chazrox @jeffd
                      last edited by

                      @jeffd Yessuh!

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

                        @jeffd said in Possible to get a button that is already connected to a ProcessorID to also show/hide another knob?:

                        or do i need to use the string name?
                        [0]: "TimeFree"

                        Always use the name, avoid the magic numbers.

                        So it would be HardcodedMaterFX3.TimeFree

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

                        J 1 Reply Last reply Reply Quote 1
                        • J
                          jeffd @d.healey
                          last edited by jeffd

                          @d-healey

                          this doesnt work?

                          HardcodedMasterFX3.TimeFree.setAttribute(value);
                          
                          d.healeyD 1 Reply Last reply Reply Quote 0
                          • d.healeyD
                            d.healey @jeffd
                            last edited by

                            @jeffd

                            HardcodedMasterFX3.setAttribute(HardcodedMasterFX3.TimeFree, value);

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

                            J 1 Reply Last reply Reply Quote 0
                            • J
                              jeffd @d.healey
                              last edited by jeffd

                              @d-healey hmmm
                              not working at all now.

                              this works for my knob that is time synced

                              Content.getComponent("KnobDelayTime").setControlCallback(onKnobDelayTimeControl);
                                  
                               	inline function onKnobDelayTimeControl(component, value)
                               	{
                               	    HardcodedMasterFX3.setAttribute(1, value);
                               	    //Console.print(value);
                               	};
                               	    
                               	Content.getComponent("KnobDelayTime").setControlCallback(onKnobDelayTimeControl);
                               
                              

                              but now the free knob is not responding at all

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

                                @jeffd

                                HardcodedMasterFX3.setAttribute(1, value);

                                What is 1?

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

                                J 1 Reply Last reply Reply Quote 0
                                • J
                                  jeffd @d.healey
                                  last edited by

                                  @d-healey the parameter id for my hardcoded master effect

                                  0 is the timefree delay, and 1 is the timesync delay.

                                  i got everything to work this way
                                  but i couldnt get it to work using the string name

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

                                    @jeffd So if you replace 1 with the attribute constant, then it doesn't work?

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

                                    J 1 Reply Last reply Reply Quote 0
                                    • J
                                      jeffd @d.healey
                                      last edited by

                                      @d-healey i couldnt get it to.

                                      This is how ive gotten it to work
                                      probably a much better way to code this but maybe this can help someone:

                                       // delay temposync
                                       
                                       	const var HardcodedMasterFX3 = Synth.getEffect("HardcodedMasterFX3");
                                          const var KnobDelayTime = Content.getComponent("KnobDelayTime");
                                          
                                          const var btnDelaysynch = Content.getComponent("btnDelaysynch");
                                          
                                          const var KnobDelayTime1 = Content.getComponent("KnobDelayTime1");
                                          
                                          
                                          inline function onKnobDelayTime1Control(component, value)
                                          {
                                          	HardcodedMasterFX3.setAttribute(0, value);
                                          };
                                          
                                          Content.getComponent("KnobDelayTime1").setControlCallback(onKnobDelayTime1Control);
                                          
                                          
                                       	inline function onKnobDelayTimeControl(component, value)
                                       	{
                                       	    HardcodedMasterFX3.setAttribute(1, value);
                                       	    
                                       	};
                                       	    
                                       	Content.getComponent("KnobDelayTime").setControlCallback(onKnobDelayTimeControl);
                                       
                                       
                                       	inline function onbtnDelaysynchControl(component, value)
                                       	{
                                       	    HardcodedMasterFX3.setAttribute(2, value);
                                       	    
                                       	    if (value)
                                       	    {
                                      	 	    KnobDelayTime1.showControl(false);
                                      	 	    KnobDelayTime.showControl(true);
                                       	    }
                                       	    
                                       	    else
                                       	    {
                                      	 	    KnobDelayTime1.showControl(true);
                                      	 	    KnobDelayTime.showControl(false);
                                      	 	     	    
                                       	    } 	    
                                      	};
                                       
                                       	Content.getComponent("btnDelaysynch").setControlCallback(onbtnDelaysynchControl);
                                       
                                      
                                      1 Reply Last reply Reply Quote 0
                                      • First post
                                        Last post

                                      9

                                      Online

                                      1.7k

                                      Users

                                      11.8k

                                      Topics

                                      102.3k

                                      Posts