1. Please do not install macOS 10.15 Catalina yet, as Native Instruments software and hardware products are not supported under macOS 10.15 yet. For more info, please go HERE!
    Dismiss Notice

Solved While loops and ui table

Discussion in 'Scripting Workshop' started by CK_S, Sep 11, 2019.

  1. CK_S

    CK_S NI Product Owner

    Messages:
    65
    I had this script recently working as it expected but for one group only.Today i tried to make it affect a particular number of groups using while loops.
    The way i used works ok for me in other ui controls, but in this case i'ts not correct.

    For now it affects only the first group of the loop and for the other affects only the first step of the table

    First I tried to use a while loop and have all the commands inside but it didnt work neither.

    Code:
    on note
    
    { part_1 TABLE  }
    
    select($TBLMEN_part_1)
    case 0
    $UIWaitTime :=$DURATION_EIGHTH
    case 1
    $UIWaitTime :=$DURATION_SIXTEENTH
    case 2
    $UIWaitTime :=$DURATION_EIGHTH_TRIPLET
    case 3
    $UIWaitTime :=$DURATION_SIXTEENTH_TRIPLET
    end select
    
    
    
     $TABLE_STEPS_COUNT :=0
    
    select($DEST_MEN_1)
    case 0
    $CUR_GROUP :=1
    while( $CUR_GROUP<=50)
      set_engine_par($ENGINE_PAR_MOD_TARGET_INTENSITY,(%tablepart_1[0] * 10000),$CUR_GROUP,find_mod($CUR_GROUP,"CV_CUTOFF_part_1"),-1)
      while ($NOTE_HELD = 1)
      set_engine_par($ENGINE_PAR_MOD_TARGET_INTENSITY,(%tablepart_1[$TABLE_STEPS_COUNT] * 10000),$CUR_GROUP,find_mod($CUR_GROUP,"CV_CUTOFF_part_1"),-1)
    if ($UIWaitTime # 0)
        wait($UIWaitTime)
    end if
      inc($TABLE_STEPS_COUNT)
            if($TABLE_STEPS_COUNT >= $TABLE_STEPS)
                $TABLE_STEPS_COUNT := 0
            end if
    end while
    inc( $CUR_GROUP)
       end while
    
    case 1 ...etc.
    
    end select 
    end on
     
  2. CK_S

    CK_S NI Product Owner

    Messages:
    65
    Wrong structure - solved
     
    Last edited: Sep 13, 2019