HISE Logo Forum
    • Categories
    • Register
    • Login

    Need Help With A Button

    Scheduled Pinned Locked Moved Scripting
    2 Posts 1 Posters 125 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.
    • NatanN
      Natan
      last edited by Natan

      Hey Folks
      Hope All Is Well

      I Need Help With This "Button1" Which Adds -10 dB To Button2 And Button3 When It Gets On.
      And When Its Get Off, Button2 And Button3, Do Their Own Job

      I Know It's Pretty Simple, But Somehow, I Lost My Mind, And Can't Find The Correct Way To Code This:

      Content.makeFrontInterface(600, 100);
      
      const var SimpleGain = Synth.getEffect("Simple Gain");
      
      const var Button1 = Content.getComponent("Button1");
      const var Button2 = Content.getComponent("Button2");
      const var Button3 = Content.getComponent("Button3");
      
      
      
      inline function onButton1Control(component, value)
      {
      	//This Will Turn Both BUtton 2 n Button 3 Values to What
             // Their Value Is -10
             // So If Button 2 Is -5, By Turning Button 1 On, It Goes To -15, And 
            // When It Turns Off, Button2 Gets Back to It's -5 dB Value.
      };
      
      Content.getComponent("Button1").setControlCallback(onButton1Control);
      
      
      inline function onButton2Control(component, value)
      {
      	SimpleGain.setAttribute(0, -5);    
      };
      
      Content.getComponent("Button2").setControlCallback(onButton2Control);
      
      
      
      
      
      inline function onButton3Control(component, value)
      {
      	SimpleGain.setAttribute(0, -10);
      };
      
      Content.getComponent("Button3").setControlCallback(onButton3Control);
      
      1 Reply Last reply Reply Quote 0
      • NatanN
        Natan
        last edited by

        Okey I Found A Way To Do This :)

        Content.makeFrontInterface(600, 100);
        
        const var SimpleGain = Synth.getEffect("Simple Gain");
        
        const var Button1 = Content.getComponent("Button1");
        const var Button2 = Content.getComponent("Button2");
        const var Button3 = Content.getComponent("Button3");
        
        
        reg BTNONE;
        
        inline function onButton1Control(component, value)
        {
        	if (value)
            {
               BTNONE= -10; 
            }
            else
            {
               BTNONE= 0; 
            }
            
            Button2.changed();   
            Button3.changed();
        };
        
        Content.getComponent("Button1").setControlCallback(onButton1Control);
        
        
        
        
        
        inline function onButton2Control(component, value)
        {
        
        	SimpleGain.setAttribute(0, BTNONE -5);  
        };
        
        Content.getComponent("Button2").setControlCallback(onButton2Control);
        
        
        
        
        
        inline function onButton3Control(component, value)
        {
        	SimpleGain.setAttribute(0, BTNONE -10);  
        };
        
        Content.getComponent("Button3").setControlCallback(onButton3Control);
        
        1 Reply Last reply Reply Quote 0
        • First post
          Last post

        21

        Online

        1.8k

        Users

        12.0k

        Topics

        104.8k

        Posts