Professional Documents
Culture Documents
declare $NoteNr_Pattern
declare $note_helper
declare ui_label $offset_label (2,1)
set_text($offset_label,"Pattern Settings:")
move_control($offset_label,0,0)
set_control_help($steps,"Steps: Sets the number of steps of the selected
pattern, i.e. the pattern length. You can quickly create polyrhythmic passages
by having patterns with different pattern lengths.")
set_control_help($Edit_Menu,"Edit Menu: Commands for copying and pasting
patterns.")
set_control_help($Swing,"Swing: Offsets every other step by the specifie
d amount in percent in order to create a swing feel. Positive values delay every
other step, negative values push every other step forward.")
set_control_help(%PitchDisplay,"Note Grid: Adjusts the note offset per s
tep of the selected track. The range is -12 to +12 semitones. Cmd-Ctrl click to
reset a step to 0 (no transposition of the step).")
set_control_help(%VelDisplay,"Velocity Grid: Adjusts the velocity per st
ep of the selected track. Cmd/Ctrl click to delete a step.")
set_control_help($t1,"Pattern Selector Button: Selects the first pattern
.")
set_control_help($t2,"Pattern Selector Button: Selects the second patter
n.")
set_control_help($t3,"Pattern Selector Button: Selects the third pattern
.")
set_control_help($t4,"Pattern Selector Button: Selects the fourth patter
n.")
set_control_help($t5,"Pattern Selector Button: Selects the fifth pattern
.")
set_control_help($t6,"Pattern Selector Button: Selects the sixth pattern
.")
set_control_help($Solo_button,"Solo Track: Solos the currently displayed
pattern.")
set_control_help($Duration,"Duration: Sets the duration of the played MI
DI notes in percentage of a step length.")
set_control_help($Offset_label,"")
set_control_help($Mode,"Mode: <On> enables the poly step, <Hold> will la
tch all played keys and <Off> disables the poly step.")
set_control_help($root_knob,"Root: Specify the note which serves as the
root note for the Note Grid (to the left of this knob). If set to <Note>, this w
ill be the the incoming MIDI note, which can be transposed with <+- 1 Oct> <+-2
Oct> and <+-3 Oct>. You can also specify a fixed note as the root note.")
set_control_help($Rate_Knob,"Rate: Sets the duration of one step.")
_read_persistent_var($root_knob)
select ($root_knob)
case 5
set_knob_label($Root_knob,"- 3 Oct")
case 6
set_knob_label($Root_knob,"- 2 Oct")
case 7
set_knob_label($Root_knob,"- 1 Oct")
case 8
set_knob_label($Root_knob,"Note")
case 9
set_knob_label($Root_knob,"+ 1 Oct")
case 10
set_knob_label($Root_knob,"+ 2 Oct")
case 11
set_knob_label($Root_knob,"+ 3 Oct")
case 12 to 115
set_knob_label($Root_knob,!note_class[($Root_knob-1) mod
12]&((($Root_knob-1)/12)-2))
end select
declare %helper2_arr[$PRESET_LENGTH]
declare %helper_arr[$PRESET_LENGTH]
declare %default_preset[$PRESET_LENGTH] := (...
0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,...
0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,...
0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,...
0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,...
0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,...
0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,...
...
0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,...
0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,...
0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,...
0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,...
0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,...
0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,...
...
16,16,16,16,16, 16,...
1,330000,...
8,8,8,8,8, 8,...
0,0,0,0,0, 0,...
0,0,0,0,0, 0,...
0,0,0,0,0, 0,...
127,127,127,127,127, 127,...
75,0,0)
$swing := 0
$duration := 75
$a := 0
while($a < $PRESET_LENGTH)
%preset_0_arr[$a] := %default_preset[$a]
%preset_1_arr[$a] := %default_preset[$a]
%preset_2_arr[$a] := %default_preset[$a]
%preset_3_arr[$a] := %default_preset[$a]
%preset_4_arr[$a] := %default_preset[$a]
%preset_5_arr[$a] := %default_preset[$a]
%preset_6_arr[$a] := %default_preset[$a]
%preset_7_arr[$a] := %default_preset[$a]
%preset_8_arr[$a] := %default_preset[$a]
%preset_9_arr[$a] := %default_preset[$a]
%preset_10_arr[$a] := %default_preset[$a]
%preset_11_arr[$a] := %default_preset[$a]
%cur_preset[$a] := %default_preset[$a]
%helper_arr[$a] := %default_preset[$a]
%helper2_arr[$a] := %default_preset[$a]
inc($a)
end while
_read_persistent_var(%cur_preset)
$cur_track := %cur_preset[232]
$a := 0
while($a < 16)
%pitchdisplay[$a] := %cur_preset[$cur_track*16 + $a]
%veldisplay[$a] := %cur_preset[96 + $cur_track*16 + $a]
inc($a)
end while
$steps := %cur_preset[192+$cur_track]
$root_knob := %cur_preset[200+$cur_track]
$octave := %cur_preset[206+$cur_track]
$semitone := %cur_preset[212+$cur_track]
set_table_steps_shown(%veldisplay,$steps)
set_table_steps_shown(%pitchdisplay,$steps)
select ($root_knob)
case 5
set_knob_label($Root_knob,"-3 Oct")
case 6
set_knob_label($Root_knob,"-2 Oct")
case 7
set_knob_label($Root_knob,"-1 Oct")
case 8
set_knob_label($Root_knob,"Note")
case 9
set_knob_label($Root_knob,"+1 Oct")
case 10
set_knob_label($Root_knob,"+2 Oct")
case 11
set_knob_label($Root_knob,"+3 Oct")
case 12 to 115
set_knob_label($Root_knob,!note_class[($Root_knob) mod 1
2]&((($Root_knob)/12)-2))
end select
_read_persistent_var($Rate_knob)
$sync_knob := ($Rate_knob * 18) /1000001
set_knob_defval ($Rate_knob,(5 *1000001) / 17)
set_knob_label ($Rate_knob,!tempo_names[$sync_knob])
set_knob_unit($Rate_knob,$KNOB_UNIT_NONE)
set_control_par_str(get_ui_id($t1),$CONTROL_PAR_TEXT,"Pattern 1")
set_control_par_str(get_ui_id($t2),$CONTROL_PAR_TEXT,"Pattern 2")
set_control_par_str(get_ui_id($t3),$CONTROL_PAR_TEXT,"Pattern 3")
set_control_par_str(get_ui_id($t4),$CONTROL_PAR_TEXT,"Pattern 4")
set_control_par_str(get_ui_id($t5),$CONTROL_PAR_TEXT,"Pattern 5")
set_control_par_str(get_ui_id($t6),$CONTROL_PAR_TEXT,"Pattern 6")
set_control_par(get_ui_id($t1),$CONTROL_PAR_TEXT_ALIGNMENT,1)
set_control_par(get_ui_id($t2),$CONTROL_PAR_TEXT_ALIGNMENT,1)
set_control_par(get_ui_id($t3),$CONTROL_PAR_TEXT_ALIGNMENT,1)
set_control_par(get_ui_id($t4),$CONTROL_PAR_TEXT_ALIGNMENT,1)
set_control_par(get_ui_id($t5),$CONTROL_PAR_TEXT_ALIGNMENT,1)
set_control_par(get_ui_id($t6),$CONTROL_PAR_TEXT_ALIGNMENT,1)
$t1 := 0
$t2 := 0
$t3 := 0
$t4 := 0
$t5 := 0
$t6 := 0
select($cur_track)
case 0
$t1 := 1
case 1
$t2 := 1
case 2
$t3 := 1
case 3
$t4 := 1
case 4
$t5 := 1
case 5
$t6 := 1
end select
declare $note
declare $dur
declare $cur_id
declare $last_note
declare $swing_cursor
declare %KEY_DOWN_OWN[128]
$a := 0
while($a < $steps)
if ($a mod 4 = 0)
%grid_table[$a] := 2
else
%grid_table[$a] := 0
end if
inc($a)
end while
set_table_steps_shown(%grid_table,$steps)
declare $cur_note
declare $start_id
declare $last_mode := 1
make_persistent($last_mode)
declare %cur_notes[6]
declare $max
declare $max_note
set_control_help (%grid_table,"Grid Display: This display is only for vi
sual reference, it cannot be edited.")
end on
on note
%pressed[$EVENT_NOTE] := $EVENT_ID
%KEY_DOWN_OWN[$EVENT_NOTE] := $EVENT_ID
if ($mode = 0)
exit
end if
ignore_event($EVENT_ID)
if ($mode = 2 and $EVENT_NOTE = $last_note)
$last_note := -1
note_off($cur_id)
$cur_id := 0
$a := 0
while($a < $steps)
if ($a mod 4 = 0)
%grid_table[$a] := 2
else
%grid_table[$a] := 0
end if
inc($a)
end while
set_table_steps_shown(%grid_table,$steps)
exit
end if
$last_note := $EVENT_NOTE
$cur_note := $EVENT_NOTE
if ($cur_id = 0)
$cur_id := $EVENT_ID
$start_id := $EVENT_ID
$swing_cursor := 0
$a := 0
while($a < 6)
%cursor[$a] := 0
inc($a)
end while
while($cur_id # 0 and $start_id = $EVENT_ID)
select ($Sync_knob)
case 0
$step_length := $DURATIO
N_SIXTEENTH/8
case 1
$step_length := $DURATIO
N_SIXTEENTH/4
case 2
$step_length := $DURATIO
N_SIXTEENTH/2
case 3
$step_length := $DURATIO
N_QUARTER/6
case 4
$step_length := ($DURATI
ON_SIXTEENTH/4)*3
case 5
$step_length := $DURATIO
N_SIXTEENTH
case 6
$step_length := $DURATIO
N_QUARTER/3
case 7
$step_length := ($DURATI
ON_SIXTEENTH/2)*3
case 8
$step_length := $DURATIO
N_EIGHTH
case 9
$step_length := ($DURATI
ON_QUARTER*2)/3
case 10
$step_length := $DURATIO
N_SIXTEENTH*3
case 11
$step_length := $DURATIO
N_QUARTER
case 12
$step_length := ($DURATI
ON_QUARTER*4)/3
case 13
$step_length := $DURATIO
N_EIGHTH*3
case 14
$step_length := $DURATIO
N_QUARTER*2
case 15
$step_length := $DURATIO
N_QUARTER*3
case 16
$step_length := $DURATIO
N_QUARTER*4
case 17
$step_length := $DURATIO
N_BAR
end select
if ($swing_cursor mod 2 = 0)
$step_length := $step_length + ($step_length*$Sw
ing)/100
else
$step_length := $step_length + ($step_length*(-$
Swing))/100
end if
inc($swing_cursor)
$dur := ($step_length*$Duration)/100
if ($step_length < 5000)
$step_length := 5000
end if
$aa := 0
while($aa < 6)
%cur_notes[$aa] := $cur_note
if (%cur_preset[96 + ($aa*16)+%cursor[$aa]] > 0)
select (%cur_preset[200+$aa])
case 5
$note := %cur_notes[$aa]
- 36
case 6
$note := %cur_notes[$aa]
- 24
case 7
$note := %cur_notes[$aa]
- 12
case 8
$note := %cur_notes[$aa]
case 9
$note := %cur_notes[$aa]
+ 12
case 10
$note := %cur_notes[$aa]
+ 24
case 11
$note := %cur_notes[$aa]
+ 36
case 12 to 115
$note := %cur_preset[200
+$aa]
end select
$note := $note + %cur_preset[212+$aa] +
%cur_preset[206+$aa]*12 + %cur_preset[($aa*16)+%cursor[$aa]]
if ($note < 0 )
$note := 0
end if
if ($note > 127)
$note := 127
end if
if ($solo_button = 0 or $aa = $cur_track
)
play_note($note,%cur_preset[96 +
($aa*16)+%cursor[$aa]],0,$dur)
end if
end if
inc(%cursor[$aa])
if (%cursor[$aa] >= %cur_preset[192+$aa])
%cursor[$aa] := 0
end if
inc($aa)
end while
$a := 0
while($a < $steps)
if (%cursor[$cur_track] = $a)
%grid_table[$a] := 1
else
if ($a mod 4 = 0)
%grid_table[$a] := 2
else
%grid_table[$a] := 0
end if
end if
inc($a)
end while
wait($step_length)
end while
else
$cur_id := $EVENT_ID
end if
end on
on release
if (%pressed[$EVENT_NOTE] = $EVENT_ID)
%pressed[$EVENT_NOTE] := 0
end if
if ($mode = 0)
exit
end if
if (%KEY_DOWN_OWN[$EVENT_NOTE] = $EVENT_ID)
if ($mode = 2 and $last_note > -1)
ignore_event($EVENT_ID)
exit
end if
%KEY_DOWN_OWN[$EVENT_NOTE] := 0
if ($EVENT_ID = $cur_id)
$a := 0
$max := 0
$max_note := 0
while($a < 128)
if (%KEY_DOWN_OWN[$a] > $max)
$max := %KEY_DOWN_OWN[$a]
$max_note := $a
end if
inc($a)
end while
if ($max = 0)
$cur_id := 0
$a := 0
while($a < $steps)
if ($a mod 4 = 0)
%grid_table[$a] := 2
else
%grid_table[$a] := 0
end if
inc($a)
end while
set_table_steps_shown(%grid_table,$steps)
else
$cur_id := $max
$cur_note := $max_note
end if
end if
end if
end on
{***}
on ui_control (%pitchdisplay)
$a := 0
while($a < 16)
%cur_preset[($cur_track*16) + $a] := %pitchdisplay[$a]
inc($a)
end while
end on
on ui_control (%veldisplay)
$a := 0
while($a < 16)
%cur_preset[96+($cur_track*16) + $a] := %veldisplay[$a]
inc($a)
end while
end on
on ui_control ($steps)
%cur_preset[192+$cur_track] := $steps
set_table_steps_shown(%veldisplay, $steps)
set_table_steps_shown(%pitchdisplay, $steps)
$a := 0
while($a < $steps)
if ($a mod 4 = 0)
%grid_table[$a] := 2
else
%grid_table[$a] := 0
end if
inc($a)
end while
set_table_steps_shown(%grid_table,$steps)
end on
on ui_control ($rate_knob)
$sync_knob := ($Rate_knob * 18) /1000001
set_knob_label ($Rate_knob,!tempo_names[$sync_knob])
end on
on ui_control ($root_knob)
select ($root_knob)
case 5
set_knob_label($Root_knob,"-3 Oct")
case 6
set_knob_label($Root_knob,"-2 Oct")
case 7
set_knob_label($Root_knob,"-1 Oct")
case 8
set_knob_label($Root_knob,"Note")
case 9
set_knob_label($Root_knob,"+1 Oct")
case 10
set_knob_label($Root_knob,"+2 Oct")
case 11
set_knob_label($Root_knob,"+3 Oct")
case 12 to 115
set_knob_label($Root_knob,!note_class[($Root_knob) mod 1
2]&((($Root_knob)/12)-2))
end select
%cur_preset[200+$cur_track] := $root_knob
end on
on ui_control ($octave)
%cur_preset[206+$cur_track] := $octave
end on
on ui_control ($semitone)
%cur_preset[212+$cur_track] := $semitone
end on
on ui_control ($t1)
$cur_track := 0
$t1 := 1
$t2 := 0
$t3 := 0
$t4 := 0
$t5 := 0
$t6 := 0
%cur_preset[232] := $cur_track
$steps := %cur_preset[192+$cur_track]
$octave := %cur_preset[206+$cur_track]
$semitone := %cur_preset[212+$cur_track]
$root_knob := %cur_preset[200+$cur_track]
$a := 0
while($a < 16)
%pitchdisplay[$a] := %cur_preset[$cur_track*16 + $a]
%veldisplay[$a] := %cur_preset[96 + $cur_track*16 + $a]
inc($a)
end while
set_table_steps_shown(%veldisplay,$steps)
set_table_steps_shown(%pitchdisplay,$steps)
$a := 0
while($a < $steps)
if ($a mod 4 = 0)
%grid_table[$a] := 2
else
%grid_table[$a] := 0
end if
inc($a)
end while
set_table_steps_shown(%grid_table,$steps)
select ($root_knob)
case 5
set_knob_label($Root_knob,"-3 Oct")
case 6
set_knob_label($Root_knob,"-2 Oct")
case 7
set_knob_label($Root_knob,"-1 Oct")
case 8
set_knob_label($Root_knob,"Note")
case 9
set_knob_label($Root_knob,"+1 Oct")
case 10
set_knob_label($Root_knob,"+2 Oct")
case 11
set_knob_label($Root_knob,"+3 Oct")
case 12 to 115
set_knob_label($Root_knob,!note_class[($Root_knob) mod 1
2]&((($Root_knob)/12)-2))
end select
end on
on ui_control ($t2)
$cur_track := 1
$t1 := 0
$t2 := 1
$t3 := 0
$t4 := 0
$t5 := 0
$t6 := 0
%cur_preset[232] := $cur_track
$steps := %cur_preset[192+$cur_track]
$octave := %cur_preset[206+$cur_track]
$semitone := %cur_preset[212+$cur_track]
$root_knob := %cur_preset[200+$cur_track]
$a := 0
while($a < 16)
%pitchdisplay[$a] := %cur_preset[$cur_track*16 + $a]
%veldisplay[$a] := %cur_preset[96 + $cur_track*16 + $a]
inc($a)
end while
set_table_steps_shown(%veldisplay,$steps)
set_table_steps_shown(%pitchdisplay,$steps)
$a := 0
while($a < $steps)
if ($a mod 4 = 0)
%grid_table[$a] := 2
else
%grid_table[$a] := 0
end if
inc($a)
end while
set_table_steps_shown(%grid_table,$steps)
select ($root_knob)
case 5
set_knob_label($Root_knob,"-3 Oct")
case 6
set_knob_label($Root_knob,"-2 Oct")
case 7
set_knob_label($Root_knob,"-1 Oct")
case 8
set_knob_label($Root_knob,"Note")
case 9
set_knob_label($Root_knob,"+1 Oct")
case 10
set_knob_label($Root_knob,"+2 Oct")
case 11
set_knob_label($Root_knob,"+3 Oct")
case 12 to 115
set_knob_label($Root_knob,!note_class[($Root_knob) mod 1
2]&((($Root_knob)/12)-2))
end select
end on
on ui_control ($t3)
$cur_track := 2
$t1 := 0
$t2 := 0
$t3 := 1
$t4 := 0
$t5 := 0
$t6 := 0
%cur_preset[232] := $cur_track
$steps := %cur_preset[192+$cur_track]
$octave := %cur_preset[206+$cur_track]
$semitone := %cur_preset[212+$cur_track]
$root_knob := %cur_preset[200+$cur_track]
$a := 0
while($a < 16)
%pitchdisplay[$a] := %cur_preset[$cur_track*16 + $a]
%veldisplay[$a] := %cur_preset[96 + $cur_track*16 + $a]
inc($a)
end while
set_table_steps_shown(%veldisplay,$steps)
set_table_steps_shown(%pitchdisplay,$steps)
$a := 0
while($a < $steps)
if ($a mod 4 = 0)
%grid_table[$a] := 2
else
%grid_table[$a] := 0
end if
inc($a)
end while
set_table_steps_shown(%grid_table,$steps)
select ($root_knob)
case 5
set_knob_label($Root_knob,"-3 Oct")
case 6
set_knob_label($Root_knob,"-2 Oct")
case 7
set_knob_label($Root_knob,"-1 Oct")
case 8
set_knob_label($Root_knob,"Note")
case 9
set_knob_label($Root_knob,"+1 Oct")
case 10
set_knob_label($Root_knob,"+2 Oct")
case 11
set_knob_label($Root_knob,"+3 Oct")
case 12 to 115
set_knob_label($Root_knob,!note_class[($Root_knob) mod 1
2]&((($Root_knob)/12)-2))
end select
end on
on ui_control ($t4)
$cur_track := 3
$t1 := 0
$t2 := 0
$t3 := 0
$t4 := 1
$t5 := 0
$t6 := 0
%cur_preset[232] := $cur_track
$steps := %cur_preset[192+$cur_track]
$octave := %cur_preset[206+$cur_track]
$semitone := %cur_preset[212+$cur_track]
$root_knob := %cur_preset[200+$cur_track]
$a := 0
while($a < 16)
%pitchdisplay[$a] := %cur_preset[$cur_track*16 + $a]
%veldisplay[$a] := %cur_preset[96 + $cur_track*16 + $a]
inc($a)
end while
set_table_steps_shown(%veldisplay,$steps)
set_table_steps_shown(%pitchdisplay,$steps)
$a := 0
while($a < $steps)
if ($a mod 4 = 0)
%grid_table[$a] := 2
else
%grid_table[$a] := 0
end if
inc($a)
end while
set_table_steps_shown(%grid_table,$steps)
select ($root_knob)
case 5
set_knob_label($Root_knob,"-3 Oct")
case 6
set_knob_label($Root_knob,"-2 Oct")
case 7
set_knob_label($Root_knob,"-1 Oct")
case 8
set_knob_label($Root_knob,"Note")
case 9
set_knob_label($Root_knob,"+1 Oct")
case 10
set_knob_label($Root_knob,"+2 Oct")
case 11
set_knob_label($Root_knob,"+3 Oct")
case 12 to 115
set_knob_label($Root_knob,!note_class[($Root_knob) mod 1
2]&((($Root_knob)/12)-2))
end select
end on
on ui_control ($t5)
$cur_track := 4
$t1 := 0
$t2 := 0
$t3 := 0
$t4 := 0
$t5 := 1
$t6 := 0
%cur_preset[232] := $cur_track
$steps := %cur_preset[192+$cur_track]
$octave := %cur_preset[206+$cur_track]
$semitone := %cur_preset[212+$cur_track]
$root_knob := %cur_preset[200+$cur_track]
$a := 0
while($a < 16)
%pitchdisplay[$a] := %cur_preset[$cur_track*16 + $a]
%veldisplay[$a] := %cur_preset[96 + $cur_track*16 + $a]
inc($a)
end while
set_table_steps_shown(%veldisplay,$steps)
set_table_steps_shown(%pitchdisplay,$steps)
$a := 0
while($a < $steps)
if ($a mod 4 = 0)
%grid_table[$a] := 2
else
%grid_table[$a] := 0
end if
inc($a)
end while
set_table_steps_shown(%grid_table,$steps)
select ($root_knob)
case 5
set_knob_label($Root_knob,"-3 Oct")
case 6
set_knob_label($Root_knob,"-2 Oct")
case 7
set_knob_label($Root_knob,"-1 Oct")
case 8
set_knob_label($Root_knob,"Note")
case 9
set_knob_label($Root_knob,"+1 Oct")
case 10
set_knob_label($Root_knob,"+2 Oct")
case 11
set_knob_label($Root_knob,"+3 Oct")
case 12 to 115
set_knob_label($Root_knob,!note_class[($Root_knob) mod 1
2]&((($Root_knob)/12)-2))
end select
end on
on ui_control ($t6)
$cur_track := 5
$t1 := 0
$t2 := 0
$t3 := 0
$t4 := 0
$t5 := 0
$t6 := 1
%cur_preset[232] := $cur_track
$steps := %cur_preset[192+$cur_track]
$octave := %cur_preset[206+$cur_track]
$semitone := %cur_preset[212+$cur_track]
$root_knob := %cur_preset[200+$cur_track]
$a := 0
while($a < 16)
%pitchdisplay[$a] := %cur_preset[$cur_track*16 + $a]
%veldisplay[$a] := %cur_preset[96 + $cur_track*16 + $a]
inc($a)
end while
set_table_steps_shown(%veldisplay,$steps)
set_table_steps_shown(%pitchdisplay,$steps)
$a := 0
while($a < $steps)
if ($a mod 4 = 0)
%grid_table[$a] := 2
else
%grid_table[$a] := 0
end if
inc($a)
end while
set_table_steps_shown(%grid_table,$steps)
select ($root_knob)
case 5
set_knob_label($Root_knob,"-3 Oct")
case 6
set_knob_label($Root_knob,"-2 Oct")
case 7
set_knob_label($Root_knob,"-1 Oct")
case 8
set_knob_label($Root_knob,"Note")
case 9
set_knob_label($Root_knob,"+1 Oct")
case 10
set_knob_label($Root_knob,"+2 Oct")
case 11
set_knob_label($Root_knob,"+3 Oct")
case 12 to 115
set_knob_label($Root_knob,!note_class[($Root_knob) mod 1
2]&((($Root_knob)/12)-2))
end select
end on
on ui_control ($mode)
select ($mode)
case 0
set_knob_label($mode,"Off")
if ($last_mode # $mode)
$cur_id := 0
$a := 0
while($a < $steps)
if ($a mod 4 = 0)
%grid_table[$a] := 2
else
%grid_table[$a] := 0
end if
inc($a)
end while
end if
set_table_steps_shown(%grid_table,$steps)
$a := 0
while($a < 128)
%KEY_DOWN_OWN[$a] := 0
inc($a)
end while
$last_note := 0
case 1
set_knob_label($mode,"On")
$b := 0
$a := 0
while($a < 128)
if (%pressed[$a] # 0)
%KEY_DOWN_OWN[$a] := %pressed[$a]
inc($b)
else
%KEY_DOWN_OWN[$a] := 0
end if
inc($a)
end while
{if (($b = 0 and $last_mode = 2) or $last_mode = 0)}
if ($last_mode # $mode)
$a := 0
$max := 0
$max_note := 0
while($a < 128)
if (%KEY_DOWN_OWN[$a] > $max)
$max := %KEY_DOWN_OWN[$a
]
$max_note := $a
end if
inc($a)
end while
if ($max = 0)
$cur_id := 0
$a := 0
while($a < $steps)
if ($a mod 4 = 0)
%grid_table[$a]
:= 2
else
%grid_table[$a]
:= 0
end if
inc($a)
end while
else
$cur_id := $max
end if
{end if}
set_table_steps_shown(%grid_table,$steps)
$last_note := 0
end if
case 2
set_knob_label($mode,"Hold")
end select
$last_mode := $mode
end on
on ui_control (%grid_table)
$a := 0
while($a < $steps)
if ($a mod 4 = 0)
%grid_table[$a] := 2
else
%grid_table[$a] := 0
end if
inc($a)
end while
set_table_steps_shown(%grid_table,$steps)
end on
on ui_control ($edit_menu)
select($edit_menu)
case 4
$a := 0
while($a < 16)
%helper2_arr[$a] := %cur_preset[$cur_track*16 +
$a]
%helper2_arr[16 + $a] := %cur_preset[96+ $cur_tr
ack*16 + $a]
inc($a)
end while
%helper2_arr[32] := %cur_preset[192+ $cur_track]
%helper2_arr[33] := %cur_preset[200+ $cur_track]
%helper2_arr[34] := %cur_preset[206+ $cur_track]
%helper2_arr[35] := %cur_preset[212+ $cur_track]
%helper2_arr[36] := %cur_preset[218+ $cur_track]
%helper2_arr[37] := %cur_preset[224+ $cur_track]
case 5
$a := 0
while($a < 16)
%cur_preset[$cur_track*16 + $a] := %helper2_arr[
$a]
%cur_preset[96+ $cur_track*16 + $a] := %helper2_
arr[16 + $a]
inc($a)
end while
%cur_preset[192+ $cur_track] := %helper2_arr[32]
%cur_preset[200+ $cur_track] := %helper2_arr[33]
%cur_preset[206+ $cur_track] := %helper2_arr[34]
%cur_preset[212+ $cur_track] := %helper2_arr[35]
%cur_preset[218+ $cur_track] := %helper2_arr[36]
%cur_preset[224+ $cur_track] := %helper2_arr[37]
case 6
$a := 0
while($a < 16)
%cur_preset[$cur_track*16 + $a] := %default_pres
et[$cur_track*16 + $a]
%cur_preset[96+ $cur_track*16 + $a] := %default_
preset[96+ $cur_track*16 + $a]
inc($a)
end while
%cur_preset[192+ $cur_track] := %default_preset[192+ $cu
r_track]
%cur_preset[200+ $cur_track] := %default_preset[200+ $cu
r_track]
%cur_preset[206+ $cur_track] := %default_preset[206+ $cu
r_track]
%cur_preset[212+ $cur_track] := %default_preset[212+ $cu
r_track]
%cur_preset[218+ $cur_track] := %default_preset[218+ $cu
r_track]
%cur_preset[224+ $cur_track] := %default_preset[224+ $cu
r_track]
end select
$cur_track := %cur_preset[232]
$a := 0
while($a < 16)
%pitchdisplay[$a] := %cur_preset[$cur_track*16 + $a]
%veldisplay[$a] := %cur_preset[96 + $cur_track*16 + $a]
inc($a)
end while
$steps := %cur_preset[192+$cur_track]
$root_knob := %cur_preset[200+$cur_track]
$octave := %cur_preset[206+$cur_track]
$semitone := %cur_preset[212+$cur_track]
set_table_steps_shown(%veldisplay,$steps)
set_table_steps_shown(%pitchdisplay,$steps)
select ($root_knob)
case 5
set_knob_label($Root_knob,"-3 Oct")
case 6
set_knob_label($Root_knob,"-2 Oct")
case 7
set_knob_label($Root_knob,"-1 Oct")
case 8
set_knob_label($Root_knob,"Note")
case 9
set_knob_label($Root_knob,"+1 Oct")
case 10
set_knob_label($Root_knob,"+2 Oct")
case 11
set_knob_label($Root_knob,"+3 Oct")
case 12 to 115
set_knob_label($Root_knob,!note_class[($Root_knob) mod 1
2]&((($Root_knob)/12)-2))
end select
$t1 := 0
$t2 := 0
$t3 := 0
$t4 := 0
$t5 := 0
$t6 := 0
select($cur_track)
case 0
$t1 := 1
case 1
$t2 := 1
case 2
$t3 := 1
case 3
$t4 := 1
case 4
$t5 := 1
case 5
$t6 := 1
end select
set_table_steps_shown(%grid_table,$steps)
$edit_menu := 100
end on
on _pgs_changed
if(_pgs_key_exists(SEQ_ON_OFF))
$mode := _pgs_get_key_val(SEQ_ON_OFF,0)
select ($mode)
case 0
set_knob_label($mode,"Off")
if ($last_mode # $mode)
$cur_id := 0
$a := 0
while($a < $steps)
if ($a mod 4 = 0)
%grid_table[$a] := 2
else
%grid_table[$a] := 0
end if
inc($a)
end while
end if
set_table_steps_shown(%grid_table,$steps)
$a := 0
while($a < 128)
%KEY_DOWN_OWN[$a] := 0
inc($a)
end while
$last_note := 0
case 1
set_knob_label($mode,"On")
$b := 0
$a := 0
while($a < 128)
if (%pressed[$a] # 0)
%KEY_DOWN_OWN[$a] := %pressed[$a]
inc($b)
else
%KEY_DOWN_OWN[$a] := 0
end if
inc($a)
end while
{if (($b = 0 and $last_mode = 2) or $last_mode = 0)}
if ($last_mode # $mode)
$a := 0
$max := 0
$max_note := 0
while($a < 128)
if (%KEY_DOWN_OWN[$a] > $max)
$max := %KEY_DOWN_OWN[$a
]
$max_note := $a
end if
inc($a)
end while
if ($max = 0)
$cur_id := 0
$a := 0
while($a < $steps)
if ($a mod 4 = 0)
%grid_table[$a]
:= 2
else
%grid_table[$a]
:= 0
end if
inc($a)
end while
else
$cur_id := $max
end if
{end if}
set_table_steps_shown(%grid_table,$steps)
$last_note := 0
end if
case 2
set_knob_label($mode,"Hold")
end select
$last_mode := $mode
end if
end on
{END OF SCRIPT}