Filter AHDSR

Reylon
Reylon Member Posts: 23 Member
edited April 2022 in Scripting Workshop

Hey guys,

Hope you are doing well.


In the "Group Insert FX" I am using a filter which controls the modulator for the AHDSR.

However I have 6 different groups and I would like to affect them all using a loop of course.

The code I am using doesn't do nothing when the loop is included. By removing the loop the script works fine for targeted group only...

on ui_control ($FilterAttack)
    $group_counter:=1
    while($group_counter < $ALL_GROUPS)
    set_engine_par($ENGINE_PAR_ATTACK, $FilterAttack,$group_counter,1,-1)
    set_control_par_str(get_ui_id($FilterAttack_label),$CONTROL_PAR_TEXT, get_engine_par_disp($ENGINE_PAR_ATTACK,$group_counter,1,-1)& " Ms")
    inc($group_counter)
    end while
end on

Comments

  • Reylon
    Reylon Member Posts: 23 Member

    Duh... $ALL_GROUP = $NUM_GROUPS

    finally working!


  • medusa
    medusa Member Posts: 81 Helper

    Groups are counted from 0 btw, so your while loop is skipping the first group.

  • EvilDragon
    EvilDragon Moderator Posts: 1,017 mod

    Also, it is customary to use $i, $j, $k... as loop counters. It's short and to the point.

  • Reylon
    Reylon Member Posts: 23 Member
    edited April 2022

    Thanks for the reply guys. Medusa Im intentionally skipping the first group for sound system.☺️

Back To Top