1. IMPORTANT:
    We launched a new online community and this space is now closed. This community will be available as a read-only resources until further notice.
    JOIN US HERE

Using "while" with custom knobs

Discussion in 'Scripting Workshop' started by E Keith B, Dec 29, 2021.

  1. E Keith B

    E Keith B New Member

    Messages:
    16
    Is there a way to use "while" to combine this part of my script below? I'm trying to shorten the script. Kontakt, I see, works better when it has less to read. I realized that when I use to write code or Macromedia Flash, which became Adobe Animate. Both work on the same premise.
    Code:
       set_control_par($knobTIM, $CONTROL_PAR_POS_Y,16)
       set_control_par($knobND, $CONTROL_PAR_POS_Y,16)
       set_control_par($knobVEL, $CONTROL_PAR_POS_Y,16)
       set_control_par($knobTUN, $CONTROL_PAR_POS_Y,16)
       set_control_par($knobVOL, $CONTROL_PAR_POS_Y,16)
       set_control_par($knobPAN, $CONTROL_PAR_POS_Y,16)
    
    Any help would be appreciated. Thanks in advance.
     
  2. EvilDragon

    EvilDragon Well-Known Member

    Messages:
    19,938
    First, you need to use UI IDs rather than names of UI controls like that. You can consolidate your UI IDs in a single array then just loop through that array with IDs and then write just one line to set the Y pos to the same value for the parameters you want.
     
  3. E Keith B

    E Keith B New Member

    Messages:
    16
    Gonna try that and get back to you with a working code. Thank EvilDragon.