Hello,
I have ten buttons that each allows specific groups and disallow others. This works ok, but I'm having an issue with all the other buttons not being deselected when selecting one of them.
I researched the old forum and found this: https://www.native-instruments.com/forum/threads/button-menu-selects-groups.354375/#post-1773979
Unfortunately, it's not working properly for me. Here's the code I have (all the buttons and their IDs have been previously declared):
on init
declare const $NUM_BUTTONS := 10
declare $i
declare $old_btn
declare $sel_btn
declare %ID[$NUM_BUTTONS]
while ($i < $NUM_BUTTONS)
%ID[$i] := get_ui_id($LongSulTasto) + $i
inc($i)
end while
make_persistent($sel_btn)
end on
function ButtonCB()
set_control_par(%ID[$old_btn], $CONTROL_PAR_VALUE, 0)
set_control_par(%ID[$sel_btn], $CONTROL_PAR_VALUE, 1)
$old_btn := $sel_btn
end function
on ui_control ($LongSulTasto)
$sel_btn := 0
call ButtonCB()
end on
on ui_control ($LongTremolo)
$sel_btn := 1
call ButtonCB()
end on
on ui_control ($Staccato)
$sel_btn := 2
call ButtonCB()
end on
on ui_control ($GlissDown)
$sel_btn := 3
call ButtonCB()
end on
on ui_control ($GlissHarm)
$sel_btn := 4
call ButtonCB()
end on
on ui_control ($TremHarm)
$sel_btn := 5
call ButtonCB()
end on
on ui_control ($CircularBow)
$sel_btn := 6
call ButtonCB()
end on
on ui_control ($Crunches)
$sel_btn := 7
call ButtonCB()
end on
on ui_control ($ColLegno)
$sel_btn := 8
call ButtonCB()
end on
on ui_control ($BodyTaps)
$sel_btn := 9
call ButtonCB()
end on
on persistence_changed
call ButtonCB()
end on
Any help would be greatly appreciated. Thanks!