I would like to control the octave of several groups separately, that is to say an octave control for groups 1, 2, 3 ($oct1) and a separate octave control for other groups 5, 6, 7 ($oct2 ) .
However, I can't separate these two controls into dedicated groups: I tried to differentiate the groups in 2 arrays ( %firstctrl, %secondctrl) but do not know how to use these arrays corresponding to the ID of the groups from on note part . 😟
For now, only the $oct1 slider only works fine, with this script :
on init
set_ui_height_px(483)
set_ui_width_px(1000)
make_perfview
message("")
declare $count
declare $new_note
declare %firstctrl[3] := (0, 1, 2)
declare %secondctrl[3] := (5, 6, 7)
declare %switch_red[6]
declare ui_switch $triangl1
%switch_red[0] := get_ui_id($triangl1)
move_control_px($triangl1, 365, 123)
declare ui_switch $saw1
%switch_red[1] := get_ui_id($saw1)
move_control_px($saw1, 428, 123)
$saw1 := 0
declare ui_switch $pulse1
%switch_red[2] := get_ui_id($pulse1)
move_control_px($pulse1, 490, 123)
$pulse1 := 0
declare ui_switch $triangl2
%switch_red[3] := get_ui_id($triangl2)
move_control_px($triangl2, 365, 254)
declare ui_switch $saw2
%switch_red[4] := get_ui_id($saw2)
move_control_px($saw2, 428, 254)
$saw2 := 0
declare ui_switch $pulse2
%switch_red[5] := get_ui_id($pulse2)
move_control_px($pulse2, 490, 254)
$pulse2 := 0
$count := 0
while($count < 6)
set_control_par_str(%switch_red[$count],$CONTROL_PAR_TEXT,"")
set_control_par(%switch_red[$count],$CONTROL_PAR_HEIGHT, 50)
inc($count)
end while
declare %octav_ui[3]
declare ui_slider $oct1 (0, 4)
%octav_ui[0] := get_ui_id($oct1)
move_control_px($oct1, 134, 106)
declare ui_slider $oct2 (0, 1000000)
%octav_ui[1] := get_ui_id($oct2)
move_control_px($oct2, 135, 234)
$count := 0
while($count < 2)
set_control_par(%octav_ui[$count],$CONTROL_PAR_MOUSE_BEHAVIOUR,-400)
inc($count)
end while
end on
on note
disallow_group($ALL_GROUPS)
allow_group(3) { Noise Group permanent }
if ($triangl1 = 1)
allow_group(0)
end if
if ($saw1 = 1)
allow_group(1)
end if
if ($pulse1 = 1)
allow_group(2)
end if
change_note($EVENT_ID, (12 * ($oct1 + 2)) + ($EVENT_NOTE mod 12))
if ($triangl2 = 1)
allow_group(5)
end if
if ($saw2 = 1)
allow_group(6)
end if
if ($pulse2 = 1)
allow_group(7)
end if
end on
Can you help me so that these octave controls can act on different groups and not all ?