Need Help With A Button



  • 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);
    


  • 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);
    

Log in to reply
 

12
Online

1.2k
Users

3.8k
Topics

33.6k
Posts