{***************************************************************** Group Sequencer (up to 16 groups and 512 long) Written by Andrew Keresztes 5/21/08 V0.1 CLick on the Start Seq/Clr button and then click on the buttons that represent your groups in the order you want the groups to be cycled. When you are done, Click on End Sequnce. If you ever want to start over, just click on the Start Seq/Clr button again. ********************************************************************} function ASSIGN_BUTTON_TO_SEQ (NUM) %Sequence[$a] := (NUM-1) add_text_line ($Display,!Group_Name [NUM-1]) message (%Sequence [$a]) wait (250000) inc ($a) end function on init declare ui_button $Button_1 declare ui_button $Button_2 declare ui_button $Button_3 declare ui_button $Button_4 declare ui_button $Button_5 declare ui_button $Button_6 declare ui_button $Button_7 declare ui_button $Button_8 declare ui_button $Button_9 declare ui_button $Button_10 declare ui_button $Button_11 declare ui_button $Button_12 declare ui_button $Button_13 declare ui_button $Button_14 declare ui_button $Button_15 declare ui_button $Button_16 declare $i declare $a declare $b declare !Group_Name [512] declare %Sequence [512] declare $Seq_Length declare $Play_group while ($i < $NUM_GROUPS) !Group_Name [$i] := $i+1 & " " & group_name ($i) inc ($i) end while declare ui_button $Start_Seq set_text ($Start_Seq, "Start Seq/Clr") declare ui_button $End_Seq declare ui_label $Display (2,6) declare ui_label $Perf_Display (2,1) declare ui_value_edit $Key_Sw (0,128,1) set_text( $Button_1, !Group_Name [0]) set_text( $Button_2, !Group_Name [1]) set_text( $Button_3, !Group_Name [2]) set_text( $Button_4, !Group_Name [3]) set_text( $Button_5, !Group_Name [4]) set_text( $Button_6, !Group_Name [5]) set_text( $Button_7, !Group_Name [6]) set_text( $Button_8, !Group_Name [7]) set_text( $Button_9, !Group_Name [8]) set_text( $Button_10, !Group_Name [9]) set_text( $Button_11, !Group_Name [10]) set_text( $Button_12, !Group_Name [11]) set_text( $Button_13, !Group_Name [12]) set_text( $Button_14, !Group_Name [13]) set_text( $Button_15, !Group_Name [14]) set_text( $Button_16, !Group_Name [15]) make_persistent (%Sequence) make_persistent ($Key_Sw) move_control ($Button_1,1,1) move_control ($Button_2,2,1) move_control ($Button_3,3,1) move_control ($Button_4,4,1) move_control ($Button_5,1,2) move_control ($Button_6,2,2) move_control ($Button_7,3,2) move_control ($Button_8,4,2) move_control ($Button_9,1,3) move_control ($Button_10,2,3) move_control ($Button_11,3,3) move_control ($Button_12,4,3) move_control ($Button_13,1,4) move_control ($Button_14,2,4) move_control ($Button_15,3,4) move_control ($Button_16,4,4) move_control ($Start_Seq,1,6) move_control ($End_Seq,2,6) move_control ($Perf_Display, 1,5) move_control ($Key_Sw, 3,6) end on on note if ($EVENT_NOTE = $Key_Sw) disallow_group ($ALL_GROUPS) $b := 0 exit end if disallow_group(ALL_GROUPS) $Play_group := %Sequence [$b mod $Seq_Length] allow_group ($Play_group) set_text ($Perf_Display, !Group_Name [$Play_group]) inc($b) end on on ui_control ($Start_Seq) set_text ($Display,"") $Start_Seq := 1 $End_Seq := 0 $a:= 0 end on on ui_control ($End_Seq) $Start_Seq := 0 wait (500000) $End_Seq := 0 $Seq_Length := $a $b:= 0 end on on ui_control ($Button_1) ASSIGN_BUTTON_TO_SEQ (1) $Button_1 := 0 end on on ui_control ($Button_2) ASSIGN_BUTTON_TO_SEQ (2) $Button_2 := 0 end on on ui_control ($Button_3) ASSIGN_BUTTON_TO_SEQ (3) $Button_3 := 0 end on on ui_control ($Button_4) ASSIGN_BUTTON_TO_SEQ (4) $Button_4 := 0 end on on ui_control ($Button_5) ASSIGN_BUTTON_TO_SEQ (5) $Button_5 := 0 end on on ui_control ($Button_6) ASSIGN_BUTTON_TO_SEQ (6) $Button_6 := 0 end on on ui_control ($Button_7) ASSIGN_BUTTON_TO_SEQ (7) $Button_7 := 0 end on on ui_control ($Button_8) ASSIGN_BUTTON_TO_SEQ (8) $Button_8 := 0 end on on ui_control ($Button_9) ASSIGN_BUTTON_TO_SEQ (9) $Button_9 := 0 end on on ui_control ($Button_10) ASSIGN_BUTTON_TO_SEQ (10) $Button_10 := 0 end on on ui_control ($Button_11) ASSIGN_BUTTON_TO_SEQ (11) $Button_11 := 0 end on on ui_control ($Button_12) ASSIGN_BUTTON_TO_SEQ (12) $Button_12 := 0 end on on ui_control ($Button_13) ASSIGN_BUTTON_TO_SEQ (13) $Button_13 := 0 end on on ui_control ($Button_14) ASSIGN_BUTTON_TO_SEQ (14) $Button_14 := 0 end on on ui_control ($Button_15) ASSIGN_BUTTON_TO_SEQ (15) $Button_15 := 0 end on on ui_control ($Button_16) ASSIGN_BUTTON_TO_SEQ (16) $Button_16 := 0 end on