Professional Documents
Culture Documents
K4 FactoryLib Vintage Drums Options
K4 FactoryLib Vintage Drums Options
K4 FactoryLib Vintage Drums Options
if ($down_pbend < 0)
if ($helper_pbend < 100000)
set_control_par_str(%pbend_id[0], $CONTROL_PAR_L
ABEL, "-0."&$helper_pbend/10000&($helper_pbend mod 10000)/1000 & " st")
else
set_control_par_str(%pbend_id[0], $CONTROL_PAR_L
ABEL,"-"&$helper_pbend/100000&"."&($helper_pbend mod 100000)/10000 & " st")
end if
else
if ($helper_pbend < 100000)
set_control_par_str(%pbend_id[0], $CONTROL_PAR_L
ABEL,"0."&$helper_pbend/10000&($helper_pbend mod 10000)/1000 & " st")
else
set_control_par_str(%pbend_id[0], $CONTROL_PAR_L
ABEL,$helper_pbend/100000&"."&($helper_pbend mod 100000)/10000 & " st")
end if
end if
if ($up_pbend < 0)
if ($helper_pbend < 100000)
set_control_par_str(%pbend_id[1], $CONTROL_PAR_L
ABEL,"-0."&$helper_pbend/10000&($helper_pbend mod 10000)/1000 & " st")
else
set_control_par_str(%pbend_id[1], $CONTROL_PAR_L
ABEL, "-"&$helper_pbend/100000&"."&($helper_pbend mod 100000)/10000 & " st")
end if
else
if ($helper_pbend < 100000)
set_control_par_str(%pbend_id[1], $CONTROL_PAR_L
ABEL,"0."&$helper_pbend/10000&($helper_pbend mod 10000)/1000 & " st")
else
set_control_par_str(%pbend_id[1], $CONTROL_PAR_L
ABEL,$helper_pbend/100000&"."&($helper_pbend mod 100000)/10000 & " st")
end if
end if
{----------PBEND END----------}
{----------TRANSPOSE START----------}
{POSITIONING OF CONTROL GROUP}
declare $x_grid_transpose := 1 {X Position of Control Group in g
rid}
declare $y_grid_transpose := 6 {Y Position of Control Group in g
rid}
declare $x_px_transpose := 0 {X Position Offset Control Group in
pixel}
declare $y_px_transpose := 0 {Y Position Offset Control Group in
pixel}
{DECLARATION AND UI_IDs}
declare const $NUM_TRANSPOSE := 4 {number of controls in this co
ntrol group}
declare ui_value_edit $semi_transpose (-12,12,1)
declare ui_value_edit $oct_transpose (-5,5,1)
declare ui_label $lb_semi_transpose (1,1)
declare ui_label $lb_oct_transpose (1,1)
declare %transpose_id[$NUM_TRANSPOSE]
%transpose_id[0] := get_ui_id($semi_transpose)
%transpose_id[1] := get_ui_id($oct_transpose)
%transpose_id[2] := get_ui_id($lb_semi_transpose)
%transpose_id[3] := get_ui_id($lb_oct_transpose)
{POSITIONING OF INDIVIDUAL CONTROLS}
move_control_px($semi_transpose, ($GRID_X * 1) - 7, ($GRID_Y * 4
) - 7)
move_control_px($oct_transpose, ($GRID_X * 1) + 45, ($GRID_Y * 4
) - 7)
{VARIOUS ATTRIBUTES}
$count := 0
while ($count < 2)
set_control_par (%transpose_id[$count],$CONTROL_PAR_WIDT
H,35)
set_control_par (%transpose_id[$count],$CONTROL_PAR_VALU
E,0)
set_control_par_str (%transpose_id[$count],$CONTROL_PAR_
PICTURE,"pv_vintage_drums_options_dsp_2")
set_control_par_str (%transpose_id[$count],$CONTROL_PAR_
TEXT,"")
set_control_par (%transpose_id[$count+2],$CONTROL_PAR_HI
DE,$HIDE_PART_BG)
set_control_par (%transpose_id[$count+2],$CONTROL_PAR_FO
NT_TYPE,$FONT_ID)
set_control_par (%transpose_id[$count+2],$CONTROL_PAR_TE
XT_ALIGNMENT,1)
set_control_par (%transpose_id[$count+2],$CONTROL_PAR_WI
DTH,87)
set_control_par (%transpose_id[$count+2],$CONTROL_PAR_PO
S_X,get_control_par...
(%transpose_id[$count],$CONTROL_PAR_POS_X) - 26)
set_control_par (%transpose_id[$count+2],$CONTROL_PAR_PO
S_Y,get_control_par...
(%transpose_id[$count],$CONTROL_PAR_POS_Y) + 22)
inc($count)
end while
set_text($lb_semi_transpose,"Semi")
set_text($lb_oct_transpose,"Oct")
make_persistent ($semi_transpose)
make_persistent ($oct_transpose)
set_control_help($semi_transpose,"Semi: Transposes incoming MIDI
notes in semitones. Only notes which pass the key range are transposed.")
set_control_help($oct_transpose,"Oct: Transposes incoming MIDI n
otes in octaves. Only notes which pass the key range are transposed.")
{Other}
$count := 0
while ($count < $NUM_TRANSPOSE)
set_control_par (%transpose_id[$count],$CONTROL_PAR_POS_
X,get_control_par(%transpose_id[$count],$CONTROL_PAR_POS_X)...
+$ROOT_X + ($x_grid_transpose - 2)*$GRID_X + $x_px_trans
pose)
set_control_par (%transpose_id[$count],$CONTROL_PAR_POS_
Y,get_control_par(%transpose_id[$count],$CONTROL_PAR_POS_Y)...
+$ROOT_Y + ($y_grid_transpose - 2)*$GRID_Y + $y_px_trans
pose)
inc($count)
end while
declare $cur_event_note
{----------TRANSPOSE END----------}
{----------TUNING START----------}
{POSITIONING OF CONTROL GROUP}
declare $x_grid_tuning := 2 {X Position of Control Group in grid
}
declare $y_grid_tuning := 8 {Y Position of Control Group in grid
}
declare $x_px_tuning := 0 {X Position Offset Control Group in pi
xel}
declare $y_px_tuning := -9 {Y Position Offset Control Group in p
ixel}
{DECLARATION AND UI_IDs}
declare const $NUM_tuning := 3 {number of controls in this contr
ol group}
declare ui_menu $key_tuning {the root note}
declare ui_menu $scale_tuning {the scale presets}
declare ui_label $lb_key_tuning (1,1)
declare %tuning_id[$NUM_tuning]
%tuning_id[0] := get_ui_id($key_tuning)
%tuning_id[1] := get_ui_id($scale_tuning)
%tuning_id[2] := get_ui_id($lb_key_tuning)
{POSITIONING OF INDIVIDUAL CONTROLS}
move_control_px($key_tuning, ($GRID_X * 2) - 7, ($GRID_Y * 2) +
0)
move_control_px($scale_tuning, ($GRID_X * 2) -62, ($GRID_Y * 3)
+ 5)
move_control_px($lb_key_tuning, ($GRID_X * 2) -62, ($GRID_Y * 2)
+ 0)
{VARIOUS ATTRIBUTES}
$count := 0
while ($count < 2)
set_control_par_str(%tuning_id[$count],$CONTROL_PAR_PICT
URE,"pv_vintage_drums_dropdown")
inc($count)
end while
set_text($lb_key_tuning,"Key:")
set_control_par(get_ui_id($lb_key_tuning),$CONTROL_PAR_HIDE,$HID
E_PART_BG)
set_control_par(get_ui_id($lb_key_tuning),$CONTROL_PAR_FONT_TYPE
,$FONT_ID)
set_control_par (get_ui_id($key_tuning),$CONTROL_PAR_WIDTH,40)
make_persistent ($key_tuning)
set_control_help($key_tuning,"Key: Select the root note of the s
cale.")
set_control_par (get_ui_id($scale_tuning),$CONTROL_PAR_WIDTH,95)
make_persistent ($scale_tuning)
set_control_help($scale_tuning,"Scale: Choose a preset tuning.")
{Other}
add_menu_item($key_tuning,"C", 0)
add_menu_item($key_tuning,"Db",1)
add_menu_item($key_tuning,"D", 2)
add_menu_item($key_tuning,"Eb",3)
add_menu_item($key_tuning,"E",4)
add_menu_item($key_tuning,"F",5)
add_menu_item($key_tuning,"Gb",6)
add_menu_item($key_tuning,"G",7)
add_menu_item($key_tuning,"Ab",8)
add_menu_item($key_tuning,"A",9)
add_menu_item($key_tuning,"Bb",10)
add_menu_item($key_tuning,"B",11)
add_menu_item($scale_tuning,"Equal Tempered", -1)
add_menu_item($scale_tuning,"Pure", 0)
add_menu_item($scale_tuning,"Pythagorean", 1)
add_menu_item($scale_tuning,"Mean Tone", 2)
add_menu_item($scale_tuning,"Werckmeister", 3)
add_menu_item($scale_tuning,"Valotti", 4)
add_menu_item($scale_tuning,"Overtone", 5)
add_menu_item($scale_tuning,"Pelog & Slendro", 6)
add_menu_item($scale_tuning,"Quartertone", 7)
$count := 0
while ($count < $NUM_tuning)
set_control_par (%tuning_id[$count],$CONTROL_PAR_POS_X,g
et_control_par(%tuning_id[$count],$CONTROL_PAR_POS_X)...
+$ROOT_X + ($x_grid_tuning - 2)*$GRID_X + $x_px_tuning)
set_control_par (%tuning_id[$count],$CONTROL_PAR_POS_Y,g
et_control_par(%tuning_id[$count],$CONTROL_PAR_POS_Y)...
+$ROOT_Y + ($y_grid_tuning - 2)*$GRID_Y + $y_px_tuning)
inc($count)
end while
{taken from original microtuner}
declare %tune_factory[8*12]:= (...
0,-29, 4, 16,-14, -2,-31, 2, 14,-16, 18,-12, {0 Pure } ...
0, 14, 4, -5, 8, -2, 12, 2, 16, 6, 4, 10, {1 Pythagorean }.
..
0,-24, -7, 10,-14, 3,-21, -3,-27,-10, 7,-17, {2 Mean Tone}...
0,-10, -8, -6,-10, -2,-12, -4, -8,-12, -4, -8, {3 Werckmeister}.
..
0, -6, -4, -2, -8, 2, -8, -2, -4, -6, 0,-10, {4 Valotti } ...
0, 5, 4, -2,-14,-29,-49, 2, 41, 6,-31,-12, {5 Overtone}...
0, -100, -29, -60, -57, 14, -120, -14, -80, -43, -40,-71, {6 Pel
og/Slendro} ...
0,-10, -4, -6, -8, -2,-12, -2, -8, -6, -4, -8) {7 Quartertone }
{----------TUNING END----------}
{----------RANDOMIZE START----------}
{POSITIONING OF CONTROL GROUP}
declare $x_grid_randomize := 3 {X Position of Control Group in g
rid}
declare $y_grid_randomize := 8 {Y Position of Control Group in g
rid}
declare $x_px_randomize := 40 {X Position Offset Control Group i
n pixel}
declare $y_px_randomize := 0 {Y Position Offset Control Group in
pixel}
{DECLARATION AND UI_IDs}
declare const $NUM_RANDOMIZE := 10 {number of controls in this c
ontrol group}
declare ui_slider $knob_1_randomize (0,100)
declare ui_slider $knob_2_randomize (0,100)
declare ui_slider $knob_3_randomize (0,100)
declare ui_slider $knob_4_randomize (0,100)
declare ui_label $lb_knob_1_randomize (1,1)
declare ui_label $lb_knob_2_randomize (1,1)
declare ui_label $lb_knob_3_randomize (1,1)
declare ui_label $lb_knob_4_randomize (1,1)
declare ui_switch $button_randomize
declare ui_label $lb_button_randomize (1,1)
declare %randomize_id[$NUM_RANDOMIZE]
%randomize_id[0] := get_ui_id($button_randomize)
%randomize_id[1] := get_ui_id($knob_1_randomize)
%randomize_id[2] := get_ui_id($knob_2_randomize)
%randomize_id[3] := get_ui_id($knob_3_randomize)
%randomize_id[4] := get_ui_id($knob_4_randomize)
%randomize_id[5] := get_ui_id($lb_button_randomize)
%randomize_id[6] := get_ui_id($lb_knob_1_randomize)
%randomize_id[7] := get_ui_id($lb_knob_2_randomize)
%randomize_id[8] := get_ui_id($lb_knob_3_randomize)
%randomize_id[9] := get_ui_id($lb_knob_4_randomize)
{POSITIONING OF INDIVIDUAL CONTROLS}
move_control_px($button_randomize, ($GRID_X * 1) + 24, ($GRID_Y
* 3) - 6) {possible to offset control in pixels}
move_control_px($knob_1_randomize, ($GRID_X * 2) - 11, ($GRID_Y
* 2) + 4)
move_control_px($knob_2_randomize, ($GRID_X * 5/2) - 3, ($GRID_Y
* 2) + 4)
move_control_px($knob_3_randomize, ($GRID_X * 3) + 5, ($GRID_Y *
2) + 4)
move_control_px($knob_4_randomize, ($GRID_X * 7/2) + 13, ($GRID_
Y * 2) + 4)
{VARIOUS ATTRIBUTES}
set_text($lb_button_randomize,"On/Off")
set_text($button_randomize,"")
set_text($lb_knob_1_randomize,"Volume")
set_text($lb_knob_2_randomize,"Velocity")
set_text($lb_knob_3_randomize,"Time")
set_text($lb_knob_4_randomize,"Pitch")
set_control_par_str(%randomize_id[0],$CONTROL_PAR_PICTURE,"pv_vi
ntage_drums_switch")
set_control_par(%randomize_id[0],$CONTROL_PAR_HEIGHT,25)
set_control_par(%randomize_id[0],$CONTROL_PAR_WIDTH,40)
set_control_par(%randomize_id[5],$CONTROL_PAR_HIDE,$HIDE_PART_BG
)
$count := 1
while ($count < 5)
set_control_par(%randomize_id[$count],$CONTROL_PAR_MOUSE
_BEHAVIOUR,-500)
set_control_par_str(%randomize_id[$count],$CONTROL_PAR_P
ICTURE,"pv_vintage_drums_knob")
inc($count)
end while
$count := 5
while ($count < 10)
set_control_par(%randomize_id[$count],$CONTROL_PAR_HIDE,
$HIDE_PART_BG)
set_control_par(%randomize_id[$count],$CONTROL_PAR_TEXT_
ALIGNMENT,1)
set_control_par(%randomize_id[$count],$CONTROL_PAR_FONT_
TYPE,$FONT_ID)
if ($count > 5)
set_control_par(%randomize_id[$count],$CONTROL_P
AR_POS_X,get_control_par...
(%randomize_id[$count-5],$CONTROL_PAR_PO
S_X)-25)
set_control_par(%randomize_id[$count],$CONTROL_P
AR_POS_Y,get_control_par...
(%randomize_id[$count-5],$CONTROL_PAR_PO
S_Y)-16)
else
set_control_par(%randomize_id[$count],$CONTROL_P
AR_POS_X,get_control_par...
(%randomize_id[$count-5],$CONTROL_PAR_PO
S_X)-21)
set_control_par(%randomize_id[$count],$CONTROL_P
AR_POS_Y,get_control_par...
(%randomize_id[$count-5],$CONTROL_PAR_PO
S_Y)-26)
end if
inc($count)
end while
make_persistent ($button_randomize)
$knob_1_randomize := 0
make_persistent ($knob_1_randomize)
set_control_help ($knob_1_randomize,"Volume: randomly changes th
e volume of each note (max: -6db to +6 db).")
$knob_2_randomize := 0
make_persistent ($knob_2_randomize)
set_control_help ($knob_2_randomize,"Velocity: randomly changes
the velocity of each note (max: -64 to +64).")
$knob_3_randomize := 0
make_persistent ($knob_3_randomize)
set_control_help ($knob_3_randomize,"Time: randomly changes the
timing of each note (applying a random delay).")
$knob_4_randomize := 0
make_persistent ($knob_4_randomize)
set_control_help ($knob_4_randomize,"Pitch: randomly detunes eac
h note (max: -100 cent to +100 cent.")
set_control_par_str(get_ui_id($button_randomize), $CONTROL_PAR_A
UTOMATION_NAME, "Randomize")
set_control_par_str(get_ui_id($knob_1_randomize), $CONTROL_PAR_A
UTOMATION_NAME, "Rnd Vol")
set_control_par_str(get_ui_id($knob_2_randomize), $CONTROL_PAR_A
UTOMATION_NAME, "Rnd Vel")
set_control_par_str(get_ui_id($knob_3_randomize), $CONTROL_PAR_A
UTOMATION_NAME, "Rnd Time")
set_control_par_str(get_ui_id($knob_4_randomize), $CONTROL_PAR_A
UTOMATION_NAME, "Rnd Tune")
read_persistent_var($knob_1_randomize)
read_persistent_var($knob_2_randomize)
read_persistent_var($knob_3_randomize)
read_persistent_var($knob_4_randomize)
set_control_par_str(%randomize_id[1], $CONTROL_PAR_LABEL, $knob_
1_randomize & " %")
set_control_par_str(%randomize_id[2], $CONTROL_PAR_LABEL, $knob_
2_randomize & " %")
set_control_par_str(%randomize_id[3], $CONTROL_PAR_LABEL, $knob_
3_randomize & " %")
set_control_par_str(%randomize_id[4], $CONTROL_PAR_LABEL, $knob_
4_randomize & " %")
read_persistent_var($button_randomize)
if ($button_randomize = 1)
set_control_par_str(get_ui_id($button_randomize), $CONTR
OL_PAR_LABEL,"On")
else
set_control_par_str(get_ui_id($button_randomize), $CONTR
OL_PAR_LABEL,"Off")
end if
{Other}
$count := 0
while ($count < $NUM_RANDOMIZE)
set_control_par (%randomize_id[$count],$CONTROL_PAR_POS_
X,get_control_par(%randomize_id[$count],$CONTROL_PAR_POS_X)...
+$ROOT_X + ($x_grid_randomize - 2)*$GRID_X + $x_px_rando
mize)
set_control_par (%randomize_id[$count],$CONTROL_PAR_POS_
Y,get_control_par(%randomize_id[$count],$CONTROL_PAR_POS_Y)...
+$ROOT_Y + ($y_grid_randomize - 2)*$GRID_Y + $y_px_rando
mize)
inc($count)
end while
_read_persistent_var($knob_1_randomize)
_read_persistent_var($knob_2_randomize)
_read_persistent_var($knob_3_randomize)
_read_persistent_var($knob_4_randomize)
_read_persistent_var($button_randomize)
_pgs_set_key_val(VOLUME, 0, $knob_1_randomize)
_pgs_set_key_val(VELOCITY, 0, $knob_2_randomize)
_pgs_set_key_val(TIME, 0, $knob_3_randomize)
_pgs_set_key_val(TUNING, 0, $knob_4_randomize)
_pgs_set_key_val(RAND_ON_OFF, 0, $button_randomize)
{*** END CONTROL GROUP "RANDOMIZE"}
end on
on note
{KEYRANGE}
if ($learn_keyrange = 1)
if ($learn_counter = 0)
$min_keyrange := $EVENT_NOTE
inc($learn_counter)
else
$max_keyrange := $EVENT_NOTE
$learn_counter := 0
$learn_keyrange := 0
if ($min_keyrange > $max_keyrange)
$a_keyrange := $max_keyrange
$max_keyrange := $min_keyrange
$min_keyrange := $a_keyrange
end if
end if
ignore_event($EVENT_ID)
exit
end if
if (not in_range($EVENT_NOTE,$min_keyrange,$max_keyrange))
ignore_event($EVENT_ID)
exit
end if
{END KEYRANGE}
{TUNING}
if ($scale_tuning # -1)
if ($scale_tuning < 7)
change_tune($EVENT_ID,%tune_factory[($scale_tuning*12)+(
($EVENT_NOTE +12-$key_tuning) mod 12)]*1000,0)
else
{copy from quartertone}
if (($EVENT_NOTE - ($key_tuning+60)) mod 2 = 0)
{no detuning}
change_note ($EVENT_ID, (($EVENT_NOTE -
($key_tuning+60)) / 2) + ($key_tuning+60))
else
if ($EVENT_NOTE > ($key_tuning+60))
change_note ($EVENT_ID, (($EVENT
_NOTE - ($key_tuning+60)) / 2) + ($key_tuning+60) + 1)
change_tune ($EVENT_ID, -50000,0
)
end if
if ($EVENT_NOTE < ($key_tuning+60))
change_note ($EVENT_ID, (($EVENT
_NOTE - ($key_tuning+60)) / 2) + ($key_tuning+60) - 1)
change_tune ($EVENT_ID, 50000,0)
end if
end if
{end copy}
end if
end if
{END TUNING}
{TRANSPOSE}
$cur_event_note := $EVENT_NOTE+ $semi_transpose + ($oct_transpose*12)
if ($cur_event_note < 0)
$cur_event_note := 0
end if
if ($cur_event_note > 127)
$cur_event_note := 127
end if
change_note($EVENT_ID,$cur_event_note)
{END TRANSPOSE}
{VELOCITY}
$new_vel := %table[$EVENT_VELOCITY]
if ($new_vel < 1)
$new_vel := 1
end if
if ($new_vel > 127)
$new_vel := 127
end if
change_velo ($EVENT_ID, $new_vel)
{END VELOCITY}
end on
{KEYRANGE CALLBACKS}
on ui_control ($learn_keyrange)
if ($learn_keyrange = 1)
$learn_counter := 0
set_control_par_str(get_ui_id($learn_keyrange), $CONTROL_PAR_LAB
EL, "On")
else
$learn_counter := 0
{reset the key range}
$min_keyrange := 0
$max_keyrange := 127
set_control_par_str(get_ui_id($learn_keyrange), $CONTROL_PAR_LAB
EL, "Off")
end if
end on
on ui_control ($min_keyrange)
if ($min_keyrange > $max_keyrange)
$max_keyrange := $min_keyrange
end if
end on
on ui_control ($max_keyrange)
if ($max_keyrange < $min_keyrange)
$min_keyrange := $max_keyrange
end if
end on
{END KEYRANGE CALLBACKS}
{VELOCITY CALLBACKS}
on ui_control ($linear_velocity)
if ($linear_velocity = 0)
$linear_velocity := 1
else
$mode_velocity := 0
$exp_1_velocity := 0
$exp_2_velocity := 0
$fix_velocity := 0
end if
{start copy}
$CShow := 0
$curve := $CShow
$knob_helper := ($curve*(-1) + 1000)
$count := 0
$helper := 1000
$kurven_hoehe := 0
while($count < 128)
$helper := ($helper * $knob_helper)/1000
%curve_deriv[$count] := $helper
$kurven_hoehe := $kurven_hoehe + %curve_deriv[$count]
inc($count)
end while
$count := 2
%curve_table_helper[0] := 0
%curve_table_helper[1] := 0
while ($count <128)
%curve_table_helper[$count] := ((%curve_table_helper[$count-1]+%
curve_deriv[$count]))
inc($count)
end while
$count := 0
while ($count <128)
%curve_form[$count] := ((%curve_table_helper[$count]*128)/(($kur
ven_hoehe)/100))
inc($count)
end while
$count := 0
while ($count <128)
%curve_form[$count] := (%curve_form[$count]*12700)/%curve_form[1
27]
inc($count)
end while
$count := 0
while ($count <128)
%table[$count] := $min_velocity + (((%curve_form[$count])*($max_
velocity-$min_velocity))/12700)
inc($count)
end while
{end copy}
end on
on ui_control ($exp_1_velocity)
if ($exp_1_velocity = 0)
$exp_1_velocity := 1
else
$mode_velocity := 1
$linear_velocity := 0
$exp_2_velocity := 0
$fix_velocity := 0
end if
{start copy}
$CShow := $EXP_SHAPE
$curve := $CShow
$knob_helper := ($curve*(-1) + 1000)
$count := 0
$helper := 1000
$kurven_hoehe := 0
while($count < 128)
$helper := ($helper * $knob_helper)/1000
%curve_deriv[$count] := $helper
$kurven_hoehe := $kurven_hoehe + %curve_deriv[$count]
inc($count)
end while
$count := 2
%curve_table_helper[0] := 0
%curve_table_helper[1] := 0
while ($count <128)
%curve_table_helper[$count] := ((%curve_table_helper[$count-1]+%
curve_deriv[$count]))
inc($count)
end while
$count := 0
while ($count <128)
%curve_form[$count] := ((%curve_table_helper[$count]*128)/(($kur
ven_hoehe)/100))
inc($count)
end while
$count := 0
while ($count <128)
%curve_form[$count] := (%curve_form[$count]*12700)/%curve_form[1
27]
inc($count)
end while
$count := 0
while ($count <128)
%table[$count] := $min_velocity + (((%curve_form[$count])*($max_
velocity-$min_velocity))/12700)
inc($count)
end while
{end copy}
end on
on ui_control ($exp_2_velocity)
if ($exp_2_velocity = 0)
$exp_2_velocity := 1
else
$mode_velocity := 2
$linear_velocity := 0
$exp_1_velocity := 0
$fix_velocity := 0
end if
{start copy}
$CShow := -$EXP_SHAPE
$curve := $CShow
$knob_helper := ($curve*(-1) + 1000)
$count := 0
$helper := 1000
$kurven_hoehe := 0
while($count < 128)
$helper := ($helper * $knob_helper)/1000
%curve_deriv[$count] := $helper
$kurven_hoehe := $kurven_hoehe + %curve_deriv[$count]
inc($count)
end while
$count := 2
%curve_table_helper[0] := 0
%curve_table_helper[1] := 0
while ($count <128)
%curve_table_helper[$count] := ((%curve_table_helper[$count-1]+%
curve_deriv[$count]))
inc($count)
end while
$count := 0
while ($count <128)
%curve_form[$count] := ((%curve_table_helper[$count]*128)/(($kur
ven_hoehe)/100))
inc($count)
end while
$count := 0
while ($count <128)
%curve_form[$count] := (%curve_form[$count]*12700)/%curve_form[1
27]
inc($count)
end while
$count := 0
while ($count <128)
%table[$count] := $min_velocity + (((%curve_form[$count])*($max_
velocity-$min_velocity))/12700)
inc($count)
end while
{end copy}
end on
on ui_control ($fix_velocity)
if ($fix_velocity = 0)
$fix_velocity := 1
else
$mode_velocity := 3
$linear_velocity := 0
$exp_1_velocity := 0
$exp_2_velocity := 0
end if
{start copy}
$count := 0
while ($count <128)
%table[$count] := $max_velocity
inc($count)
end while
{end copy}
end on
on ui_control ($min_velocity)
if ($min_velocity > $max_velocity)
$min_velocity := $max_velocity
end if
select ($mode_velocity)
case 0 to 2
$count := 0
while ($count <128)
%table[$count] := $min_velocity + ((%curve_form[
$count]*($max_velocity-$min_velocity))/12700)
inc($count)
end while
end select
end on
on ui_control ($max_velocity)
if ($max_velocity < $min_velocity)
$max_velocity := $min_velocity
end if
select ($mode_velocity)
case 0 to 2
$count := 0
while ($count <128)
%table[$count] := $min_velocity + ((%curve_form[
$count]*($max_velocity-$min_velocity))/12700)
inc($count)
end while
case 3
$count := 0
while ($count <128)
%table[$count] := $max_velocity
inc($count)
end while
end select
end on
on ui_control ($vel_vol_velocity)
$count := 0
while($count < $NUM_GROUPS and $count < 512)
_set_engine_par($ENGINE_PAR_MOD_TARGET_INTENSITY,$vel_vol_veloci
ty,$count,find_mod($count,"VEL_VOLUME"),-1)
inc($count)
end while
wait(1)
set_control_par_str(%velocity_id[0], $CONTROL_PAR_LABEL,...
get_engine_par_disp($ENGINE_PAR_MOD_TARGET_INTENSITY,0,find_mod(0,"VEL_V
OLUME"),-1) & " %")
end on
{END VELOCITY CALLBACKS}
{PBEND CALLBACKS}
on ui_control ($down_pbend)
$Pbend_down := $down_pbend*10
$Pbend_diff := $pbend_up - $pbend_down
if (abs($pbend_up) > abs($pbend_down))
$pbend_max := abs($pbend_up *10000)/12
else
$pbend_max := abs($pbend_down *10000)/12
end if
$helper_pbend := ($pbend_down*1000)/1200
$helper_pbend := ($helper_pbend*$helper_pbend*12)/10
if ($down_pbend < 0)
$pdown := $helper_pbend/1000
else
$pdown := -$helper_pbend/1000
end if
if ($down_pbend < 0)
if ($helper_pbend < 100000)
set_text ($lb_down_pbend,"-0."&$helper_pbend/10000&($hel
per_pbend mod 10000)/1000)
set_control_par_str(%pbend_id[0], $CONTROL_PAR_LABEL, "-
0."&$helper_pbend/10000&($helper_pbend mod 10000)/1000 & " st")
else
set_text ($lb_down_pbend,"-"&$helper_pbend/100000&"."&($
helper_pbend mod 100000)/10000)
set_control_par_str(%pbend_id[0], $CONTROL_PAR_LABEL,"-"
&$helper_pbend/100000&"."&($helper_pbend mod 100000)/10000 & " st")
end if
else
if ($helper_pbend < 100000)
set_text ($lb_down_pbend,"0."&$helper_pbend/10000&($help
er_pbend mod 10000)/1000)
set_control_par_str(%pbend_id[0], $CONTROL_PAR_LABEL,"0.
"&$helper_pbend/10000&($helper_pbend mod 10000)/1000 & " st")
else
set_text ($lb_down_pbend,$helper_pbend/100000&"."&($help
er_pbend mod 100000)/10000)
set_control_par_str(%pbend_id[0], $CONTROL_PAR_LABEL,$he
lper_pbend/100000&"."&($helper_pbend mod 100000)/10000 & " st")
end if
end if
$a_pbend := 0
while($a_pbend < $NUM_GROUPS)
_set_engine_par($ENGINE_PAR_MOD_TARGET_INTENSITY,$pbend_max,$a_p
bend,find_mod($a_pbend,"PB_PITCH"),-1)
inc($a_pbend)
end while
$last_time_1 := $ENGINE_UPTIME
wait($wait_time * 1000)
if($ENGINE_UPTIME - $last_time_1 > $wait_time -5)
set_text ($lb_down_pbend,"Down")
end if
end on
on ui_control ($up_pbend)
$Pbend_up := $up_pbend*10
$Pbend_diff := $pbend_up - $pbend_down
if (abs($pbend_up) > abs($pbend_down))
$pbend_max := abs($pbend_up *10000)/12
else
$pbend_max := abs($pbend_down *10000)/12
end if
$helper_pbend := ($pbend_up*1000)/1200
$helper_pbend := ($helper_pbend*$helper_pbend*12)/10
if ($up_pbend < 0)
$pup := -$helper_pbend/1000
else
$pup := $helper_pbend/1000
end if
if ($up_pbend < 0)
if ($helper_pbend < 100000)
set_text ($lb_up_pbend,"-0."&$helper_pbend/10000&($helpe
r_pbend mod 10000)/1000)
set_control_par_str(%pbend_id[1], $CONTROL_PAR_LABEL,"-0
."&$helper_pbend/10000&($helper_pbend mod 10000)/1000 & " st")
else
set_text ($lb_up_pbend,"-"&$helper_pbend/100000&"."&($he
lper_pbend mod 100000)/10000)
set_control_par_str(%pbend_id[1], $CONTROL_PAR_LABEL, "-
"&$helper_pbend/100000&"."&($helper_pbend mod 100000)/10000 & " st")
end if
else
if ($helper_pbend < 100000)
set_text ($lb_up_pbend,"0."&$helper_pbend/10000&($helper
_pbend mod 10000)/1000)
set_control_par_str(%pbend_id[1], $CONTROL_PAR_LABEL,"0.
"&$helper_pbend/10000&($helper_pbend mod 10000)/1000 & " st")
else
set_text ($lb_up_pbend,$helper_pbend/100000&"."&($helper
_pbend mod 100000)/10000)
set_control_par_str(%pbend_id[1], $CONTROL_PAR_LABEL,$he
lper_pbend/100000&"."&($helper_pbend mod 100000)/10000 & " st")
end if
end if
$a_pbend := 0
while($a_pbend < $NUM_GROUPS)
_set_engine_par($ENGINE_PAR_MOD_TARGET_INTENSITY,$pbend_max,$a_p
bend,find_mod($a_pbend,"PB_PITCH"),-1)
inc($a_pbend)
end while
$last_time_2 := $ENGINE_UPTIME
wait($wait_time * 1000)
if($ENGINE_UPTIME - $last_time_2 > $wait_time -5)
set_text ($lb_up_pbend,"Up")
end if
end on
on controller
select ($CC_NUM)
case 128
if (abs($pup) > abs($pdown))
$pmax := abs($pup)
else
$pmax := abs($pdown)
end if
if (%CC[128] < 0)
ignore_controller
$p_helper := ($pdown * %CC[128])/$pmax
set_controller(128,$p_helper)
else
ignore_controller
$p_helper := ($pup * %CC[128])/$pmax
set_controller(128,$p_helper)
end if
end select
end on
{END PBEND CALLBACKS}
{START RANDOMIZE CALLBACKS}
on ui_control ($button_randomize)
_pgs_set_key_val(RAND_ON_OFF, 0, $button_randomize)
if ($button_randomize = 1)
set_control_par_str(get_ui_id($button_randomize), $CONTROL_PAR_L
ABEL,"On")
else
set_control_par_str(get_ui_id($button_randomize), $CONTROL_PAR_L
ABEL,"Off")
end if
end on
on ui_control ($knob_1_randomize)
_pgs_set_key_val(VOLUME, 0, $knob_1_randomize)
set_control_par_str(%randomize_id[1], $CONTROL_PAR_LABEL, $knob_1_random
ize & " %")
end on
on ui_control ($knob_2_randomize)
_pgs_set_key_val(VELOCITY, 0, $knob_2_randomize)
set_control_par_str(%randomize_id[2], $CONTROL_PAR_LABEL, $knob_2_random
ize & " %")
end on
on ui_control ($knob_3_randomize)
_pgs_set_key_val(TIME, 0, $knob_3_randomize)
set_control_par_str(%randomize_id[3], $CONTROL_PAR_LABEL, $knob_3_random
ize & " %")
end on
on ui_control ($knob_4_randomize)
_pgs_set_key_val(TUNING, 0, $knob_4_randomize)
set_control_par_str(%randomize_id[4], $CONTROL_PAR_LABEL, $knob_4_random
ize & " %")
end on
{END RANDOMIZE CALLBACKS}