Sunteți pe pagina 1din 66

{***********************************************

Kontakt 4 Factory Libary - Instrument


Concert Grand
Author : Native Instruments
Modified: September 11 2009
*************************************************}
on init
make_perfview
set_script_title("Instrument")
set_ui_height_px(256)
message("")
declare $last_time
declare $wait_time := 800 {Enter control label wait time}
declare $count
declare const $ROOT_X := 66
declare const $ROOT_Y := 2
declare const $GRID_X := 92
declare const $GRID_Y := 21
declare const $FONT_ID := 5 {the font id for all visible labels}
declare const $FONT_ID_2 := 4 {the font id for menus}
declare const $CREATE_AUTOMATION_ID := 0
declare const $sends_slot := 7
declare const $meq_slot := 5
declare const $eq_slot := 4
declare const $stereo_slot := 6
declare const $comp_slot := 0
declare const $chorus_slot := 2
declare const $reverb_slot := 0
declare const $cab_slot := 3
{*** CONTROL GROUP "INSTR"}
declare ui_menu $Resonance_Release
add_menu_item($Resonance_Release,"Disable",000)
add_menu_item($Resonance_Release,"Soft", 120)
add_menu_item($Resonance_Release,"Medium", 080)
add_menu_item($Resonance_Release,"Strong", 040)
declare ui_knob $Resonance(0,100,1)
set_knob_unit($Resonance,$KNOB_UNIT_PERCENT)
set_text ($Resonance,"Sustain")
set_knob_defval ($Resonance,50)
set_control_help ($Resonance,"Sustain Resonance: Controls the su
stain sample resonance.")
declare ui_knob $KeyNoise(0,100,1)
set_knob_unit($KeyNoise,$KNOB_UNIT_PERCENT)
set_text ($KeyNoise,"Key")
set_knob_defval ($KeyNoise,50)
set_control_help ($KeyNoise,"Key Noise: Adjusts the volume of th
e piano action as a key is released.")
declare ui_knob $PedalNoise(0,100,1)
set_knob_unit($PedalNoise,$KNOB_UNIT_PERCENT)
set_text ($PedalNoise,"Pedal")
set_knob_defval ($PedalNoise,50)
set_control_help ($PedalNoise,"Pedal Noise: Adjusts the volume o
f the pedal mechanism.")
{POSITIONING OF CONTROL GROUP}
declare $x_grid_instr := 1 {X Position of Control Group in grid}
declare $y_grid_instr := 1 {Y Position of Control Group in grid}
declare $x_px_instr := 0 {X Position Offset Control Group in pix
el}
declare $y_px_instr := 0 {Y Position Offset Control Group in pix
el}
{DECLARATION AND UI_IDs}
declare const $NUM_INSTR := 10 {number of elements in this contr
ol group}
declare ui_label $backgr_instr (1,1)
declare ui_label $title_instr (1,1)
declare ui_label $lb_resrel_instr (1,1)
declare ui_label $lb_susres_instr (1,1)
declare ui_label $lb_noise_instr (1,1)
declare ui_label $lb_eq (1,1)
declare ui_slider $susres_instr (0, 100)
declare ui_slider $noise_instr (0, 100)
declare ui_slider $eq (0, 10)
declare ui_switch $resrel_instr
declare %instr_id[$NUM_INSTR]
%instr_id[0] := get_ui_id($backgr_instr)
%instr_id[1] := get_ui_id($title_instr)
%instr_id[2] := get_ui_id($lb_resrel_instr)
%instr_id[3] := get_ui_id($lb_susres_instr)
%instr_id[4] := get_ui_id($lb_noise_instr)
%instr_id[5] := get_ui_id($lb_eq)
%instr_id[6] := get_ui_id($susres_instr)
%instr_id[7] := get_ui_id($noise_instr)
%instr_id[8] := get_ui_id($eq)
%instr_id[9] := get_ui_id($resrel_instr)
set_control_par(%instr_id[6], $CONTROL_PAR_DEFAULT_VALUE, 50)
set_control_par(%instr_id[7], $CONTROL_PAR_DEFAULT_VALUE, 50)
{POSITIONING OF INDIVIDUAL CONTROLS}
move_control_px($backgr_instr,($GRID_X * 1) + 0, ($GRID_Y * 1) +
0) {possible to offset control in pixels}
move_control_px($title_instr, ($GRID_X * 1) + 0, ($GRID_Y * 1) +
0)
move_control_px($lb_resrel_instr, ($GRID_X * 1) + 18, ($GRID_Y *
2) + 21)
move_control_px($lb_susres_instr, ($GRID_X * 2) + 46, ($GRID_Y *
2) + 21)
move_control_px($lb_noise_instr, ($GRID_X * 3) + 81, ($GRID_Y *
2) + 21)
move_control_px($lb_eq, ($GRID_X * 5) + 24, ($GRID_Y * 2) + 21)
move_control_px($susres_instr, ($GRID_X * 2) + 65, ($GRID_Y * 3)
+ 11)
move_control_px($noise_instr, ($GRID_X * 4) + 9, ($GRID_Y * 3) +
11)
move_control_px($eq, ($GRID_X * 5) + 45, ($GRID_Y * 3) + 11)
move_control_px($resrel_instr, ($GRID_X * 1) + 46, ($GRID_Y * 3)
+ 18)
{VARIOUS ATTRIBUTES}

make_persistent($resonance)
make_persistent($resonance_release)
make_persistent($eq)
make_persistent($keynoise)
make_persistent($pedalnoise)
_read_persistent_var($resonance)
_read_persistent_var($resonance_release)
_read_persistent_var($keynoise)
$susres_instr := $resonance
$resrel_instr := $resonance_release
$noise_instr := $keynoise
set_control_par_str(%instr_id[0], $CONTROL_PAR_TEXT, "")
set_control_par_str(%instr_id[1], $CONTROL_PAR_TEXT, "")
set_control_par_str(%instr_id[2], $CONTROL_PAR_TEXT, "REL RESO")
set_control_par_str(%instr_id[3], $CONTROL_PAR_TEXT, "SUS RESO")
set_control_par_str(%instr_id[4], $CONTROL_PAR_TEXT, "NOISE")
set_control_par_str(%instr_id[5], $CONTROL_PAR_TEXT, "SOUND")
set_control_par(%instr_id[0], $CONTROL_PAR_WIDTH, ($GRID_X * 2))
set_control_par(%instr_id[0], $CONTROL_PAR_HEIGHT, ($GRID_Y * 4)
)
set_control_par(%instr_id[1], $CONTROL_PAR_WIDTH, ($GRID_X * 1))
set_control_par(%instr_id[1], $CONTROL_PAR_HEIGHT, ($GRID_Y * 1)
)
$count := 0
while ($count < 6)
set_control_par(%instr_id[$count], $CONTROL_PAR_WIDTH, (
$GRID_X * 1))
set_control_par(%instr_id[$count], $CONTROL_PAR_HEIGHT,
($GRID_Y * 1))
set_control_par(%instr_id[$count], $CONTROL_PAR_HIDE, $H
IDE_PART_BG)
set_control_par(%instr_id[$count], $CONTROL_PAR_TEXT_ALI
GNMENT, 1)
set_control_par(%instr_id[$count], $CONTROL_PAR_FONT_TYP
E, $FONT_ID)
inc($count)
end while
$count := 6
while ($count < 9)
set_control_par_str(%instr_id[$count], $CONTROL_PAR_PICT
URE, "pv_band_knob_big")
set_control_par(%instr_id[$count], $CONTROL_PAR_MOUSE_BE
HAVIOUR, -500)
inc($count)
end while
_read_persistent_var($resrel_instr)
set_control_par_str(%instr_id[9], $CONTROL_PAR_PICTURE, "pv_band
_switch_ring_on_off")
set_control_par(%instr_id[9], $CONTROL_PAR_WIDTH, 33)
set_control_par(%instr_id[9], $CONTROL_PAR_HEIGHT, 50)
set_control_par_str(%instr_id[9], $CONTROL_PAR_TEXT, "")
{Other}
$count := 0
while ($count < $NUM_INSTR)
set_control_par (%instr_id[$count],$CONTROL_PAR_POS_X,ge
t_control_par(%instr_id[$count],$CONTROL_PAR_POS_X)...
+$ROOT_X + ($x_grid_instr - 2)*$GRID_X + $x_px_instr)
set_control_par (%instr_id[$count],$CONTROL_PAR_POS_Y,ge
t_control_par(%instr_id[$count],$CONTROL_PAR_POS_Y)...
+$ROOT_Y + ($y_grid_instr - 2)*$GRID_Y + $y_px_instr)
inc($count)
end while
read_persistent_var($eq)
set_control_par_str(get_ui_id($resrel_instr),$CONTROL_PAR_AUTOMA
TION_NAME,"Rel Resonance")
set_control_par_str(get_ui_id($noise_instr),$CONTROL_PAR_AUTOMAT
ION_NAME,"Noise")
set_control_par_str(get_ui_id($susres_instr),$CONTROL_PAR_AUTOMA
TION_NAME,"Sus Resonance")
set_control_par_str(get_ui_id($eq),$CONTROL_PAR_AUTOMATION_NAME,
"Sound")
set_control_par_str(get_ui_id($noise_instr),$CONTROL_PAR_LABEL,$
noise_instr & " %")
set_control_par_str(get_ui_id($susres_instr),$CONTROL_PAR_LABEL,
$susres_instr & " %")
set_control_par_str(get_ui_id($eq),$CONTROL_PAR_LABEL,$eq)

{*** END CONTROL GROUP "INSTR"}


{*** CONTROL GROUP "FX"}
{POSITIONING OF CONTROL GROUP}
declare $x_grid_fx := 1 {X Position of Control Group in grid}
declare $y_grid_fx := 7 {Y Position of Control Group in grid}
declare $x_px_fx := 0 {X Position Offset Control Group in pixel}
declare $y_px_fx := 0 {Y Position Offset Control Group in pixel}
{DECLARATION AND UI_IDs}
declare const $NUM_FX := 10 {number of elements in this control
group}
declare ui_label $backgr_fx (1,1)
declare ui_label $title_fx (1,1)
declare ui_label $lb_comp_fx (1,1)
declare ui_label $lb_stereo_fx (1,1)
declare ui_label $lb_chorus_fx (1,1)
declare ui_label $lb_delay_fx (1,1)
declare ui_slider $stereo_fx (0, 1000000)
declare ui_slider $chorus_fx (0, 500000)
declare ui_slider $delay_fx (0, 1000000)
declare ui_switch $comp_fx
declare %fx_id[$NUM_FX]
%fx_id[0] := get_ui_id($backgr_fx)
%fx_id[1] := get_ui_id($title_fx)
%fx_id[2] := get_ui_id($lb_comp_fx)
%fx_id[3] := get_ui_id($lb_stereo_fx)
%fx_id[4] := get_ui_id($lb_chorus_fx)
%fx_id[5] := get_ui_id($lb_delay_fx)
%fx_id[6] := get_ui_id($stereo_fx)
%fx_id[7] := get_ui_id($chorus_fx)
%fx_id[8] := get_ui_id($delay_fx)
%fx_id[9] := get_ui_id($comp_fx)
set_control_par(%fx_id[6], $CONTROL_PAR_DEFAULT_VALUE, 500000)
{POSITIONING OF INDIVIDUAL CONTROLS}
move_control_px($backgr_fx,($GRID_X * 1) + 51, ($GRID_Y * 1) + 1
2) {possible to offset control in pixels}
move_control_px($title_fx, ($GRID_X * 1) + 0, ($GRID_Y * 1) + 0)
move_control_px($lb_comp_fx, ($GRID_X * 1) - 49, ($GRID_Y * 2) +
9)
move_control_px($lb_stereo_fx, ($GRID_X * 1) + 18, ($GRID_Y * 2)
+ 9)
move_control_px($lb_chorus_fx, ($GRID_X * 1) + 89, ($GRID_Y * 2)
+ 9)
move_control_px($lb_delay_fx, ($GRID_X * 2) + 66, ($GRID_Y * 2)
+ 9)
move_control_px($stereo_fx, ($GRID_X * 1) + 44, ($GRID_Y * 3) +
5)
move_control_px($chorus_fx, ($GRID_X * 2) + 23, ($GRID_Y * 3) +
5)
move_control_px($delay_fx, ($GRID_X * 3) + 2, ($GRID_Y * 3) + 5)
move_control_px($comp_fx, ($GRID_X * 1) - 16, ($GRID_Y * 3) + 3)
{VARIOUS ATTRIBUTES}
$chorus_fx := _get_engine_par($ENGINE_PAR_SEND_EFFECT_OUTPUT_GAI
N, -1, $chorus_slot, 1)
$delay_fx := _get_engine_par($ENGINE_PAR_SENDLEVEL_1, -1, 7, 1)
$stereo_fx := _get_engine_par($ENGINE_PAR_STEREO, -1, $stereo_sl
ot, 1)
$comp_fx := (_get_engine_par($ENGINE_PAR_EFFECT_BYPASS, -1, $co
mp_slot, 1) + 1) mod 2
set_control_par_str(%fx_id[0], $CONTROL_PAR_TEXT, "")
set_control_par_str(%fx_id[1], $CONTROL_PAR_TEXT, "")
set_control_par_str(%fx_id[2], $CONTROL_PAR_TEXT, "COMP")
set_control_par_str(%fx_id[3], $CONTROL_PAR_TEXT, "STEREO")
set_control_par_str(%fx_id[4], $CONTROL_PAR_TEXT, "CHORUS")
set_control_par_str(%fx_id[5], $CONTROL_PAR_TEXT, "DELAY")
$count := 1
while ($count < 6)
set_control_par(%fx_id[$count], $CONTROL_PAR_WIDTH, ($GR
ID_X * 1))
set_control_par(%fx_id[$count], $CONTROL_PAR_HEIGHT, ($G
RID_Y * 1))
set_control_par(%fx_id[$count], $CONTROL_PAR_HIDE, $HIDE
_PART_BG)
set_control_par(%fx_id[$count], $CONTROL_PAR_TEXT_ALIGNM
ENT, 1)
set_control_par(%fx_id[$count], $CONTROL_PAR_FONT_TYPE,
$FONT_ID)
inc($count)
end while
set_control_par_str(%fx_id[0], $CONTROL_PAR_PICTURE, "pv_band_in
st_perf_headline_animation")
set_control_par(%fx_id[0], $CONTROL_PAR_PICTURE_STATE, 1)
$count := 6
while ($count < 9)
set_control_par_str(%fx_id[$count], $CONTROL_PAR_PICTURE
, "pv_band_knob_small")
set_control_par(%fx_id[$count], $CONTROL_PAR_MOUSE_BEHAV
IOUR, -500)
inc($count)
end while
_read_persistent_var($comp_fx)
set_control_par_str(%fx_id[9], $CONTROL_PAR_PICTURE, "pv_band_sw
itch_on_off")
set_control_par(%fx_id[9], $CONTROL_PAR_WIDTH, 23)
set_control_par(%fx_id[9], $CONTROL_PAR_HEIGHT, 45)
set_control_par_str(%fx_id[9], $CONTROL_PAR_TEXT, "")
{Other}
$count := 0
while ($count < $NUM_FX)
set_control_par (%fx_id[$count],$CONTROL_PAR_POS_X,get_c
ontrol_par(%fx_id[$count],$CONTROL_PAR_POS_X)...
+$ROOT_X + ($x_grid_fx - 2)*$GRID_X + $x_px_fx)
set_control_par (%fx_id[$count],$CONTROL_PAR_POS_Y,get_c
ontrol_par(%fx_id[$count],$CONTROL_PAR_POS_Y)...
+$ROOT_Y + ($y_grid_fx - 2)*$GRID_Y + $y_px_fx)
inc($count)
end while
set_control_par_str(get_ui_id($comp_fx),$CONTROL_PAR_AUTOMATION_
NAME,"Comp")
set_control_par_str(get_ui_id($stereo_fx),$CONTROL_PAR_AUTOMATIO
N_NAME,"Stereo")
set_control_par_str(get_ui_id($chorus_fx),$CONTROL_PAR_AUTOMATIO
N_NAME,"Chorus")
set_control_par_str(get_ui_id($delay_fx),$CONTROL_PAR_AUTOMATION
_NAME,"Delay")
set_control_par_str(get_ui_id($stereo_fx),$CONTROL_PAR_LABEL,get
_engine_par_disp($ENGINE_PAR_STEREO, -1, $stereo_slot, 1) & " %")
set_control_par_str(get_ui_id($chorus_fx),$CONTROL_PAR_LABEL,get
_engine_par_disp($ENGINE_PAR_SEND_EFFECT_OUTPUT_GAIN, -1, $chorus_slot, 1) & " d
B")
set_control_par_str(get_ui_id($delay_fx),$CONTROL_PAR_LABEL,get_
engine_par_disp($ENGINE_PAR_SENDLEVEL_1, -1, 7, 1) & " dB")
{*** END CONTROL GROUP "FX"}
{*** CONTROL GROUP "BANDFX"}
{POSITIONING OF CONTROL GROUP}
declare $x_grid_bandfx := 3 {X Position of Control Group in grid
}
declare $y_grid_bandfx := 7 {Y Position of Control Group in grid
}
declare $x_px_bandfx := 0 {X Position Offset Control Group in pi
xel}
declare $y_px_bandfx := 0 {Y Position Offset Control Group in pi
xel}
{DECLARATION AND UI_IDs}
declare const $num_ir_samples := 10 {the number of ir samples us
ed in this instrument group}
declare const $NUM_BANDFX := 42 {number of elements in this cont
rol group}
declare ui_label $backgr_bandfx (1,1)
declare ui_label $title_bandfx (1,1)
declare ui_label $lb_rev_bandfx (1,1)
declare ui_label $lb_cab_bandfx(1,1)
declare ui_label $lb_eq_bandfx(1,1)
declare ui_label $lb_rev_onoff_bandfx (1,1)
declare ui_label $lb_rev_room_bandfx (1,1)
declare ui_label $lb_rev_mix_bandfx (1,1)
declare ui_label $image_reverb (1,1)
declare ui_label $lb_cab_onoff_bandfx (1,1)
declare ui_label $lb_cab_type_bandfx (1,1)
declare ui_label $lb_cab_air_bandfx (1,1)
declare ui_label $lb_eq_onoff_bandfx (1,1)
declare ui_label $lb_eq_lo_bandfx (1,1)
declare ui_label $lb_eq_mid_bandfx (1,1)
declare ui_label $lb_eq_hi_bandfx (1,1)
declare ui_label $cab_image_bandfx (1,1)
declare ui_slider $rev_amount_bandfx (0, 1000000)
declare ui_slider $cab_air_bandfx (0, 1000000)
declare ui_slider $eq_lo_bandfx (166666, 833333)
declare ui_slider $eq_mid_bandfx (166666, 833333)
declare ui_slider $eq_hi_bandfx (166666, 833333)
declare ui_button $rev_bandfx
declare ui_button $cab_bandfx
declare ui_button $eq_bandfx
declare ui_switch $rev_onoff_bandfx
declare ui_switch $cab_onoff_bandfx
declare ui_switch $eq_onoff_bandfx
declare ui_menu $cab_type_bandfx
declare ui_menu $category_reverb
declare ui_label $eq_background_bandfx (1,1)
declare ui_label $masterfx_bg_bandfx (1,1)

{reverb functionality}
declare ui_menu $hall_reverb
declare ui_menu $cathedral_reverb
declare ui_menu $club_reverb
declare ui_menu $room_reverb
declare ui_menu $l300_reverb
declare ui_menu $quadstick_reverb
declare ui_menu $brt7_reverb
declare ui_menu $plate_reverb
declare ui_menu $cabinet_reverb
declare %subcat_menu_id[9]
%subcat_menu_id[0] := get_ui_id($hall_reverb)
%subcat_menu_id[1] := get_ui_id($cathedral_reverb)
%subcat_menu_id[2] := get_ui_id($club_reverb)
%subcat_menu_id[3] := get_ui_id($room_reverb)
%subcat_menu_id[4] := get_ui_id($l300_reverb)
%subcat_menu_id[6] := get_ui_id($quadstick_reverb)
%subcat_menu_id[7] := get_ui_id($brt7_reverb)
%subcat_menu_id[5] := get_ui_id($plate_reverb)
%subcat_menu_id[8] := get_ui_id($cabinet_reverb)
declare %offset_reverb[9] := (0,3,6,14,21,52,34,42,62)
{Skin the subcategory menus}
$count := 0
while($count < 9)
set_control_par_str(%subcat_menu_id[$count],$CONTROL_PAR
_PICTURE,"pv_band_master_fx_rev_dropdown_1")
set_control_par(%subcat_menu_id[$count], $CONTROL_PAR_PO
S_X, ($GRID_X * 2) + 84)
set_control_par(%subcat_menu_id[$count], $CONTROL_PAR_PO
S_Y, ($GRID_Y * 5) + 2)
set_control_par(%subcat_menu_id[$count], $CONTROL_PAR_FO
NT_TYPE, $FONT_ID_2)
inc($count)
end while
set_control_par_str(get_ui_id($image_reverb),$CONTROL_PAR_PICTUR
E,"pv_band_reverb_animation")
{Fill the menus}
add_menu_item($category_reverb, "CONCERT HALL", 0)
add_menu_item($category_reverb, "CATHEDRAL", 1)
add_menu_item($category_reverb, "CLUB", 2)
add_menu_item($category_reverb, "ROOM", 3)
add_menu_item($category_reverb, "L300", 4)
add_menu_item($category_reverb, "QUADSTICK", 6)
add_menu_item($category_reverb, "BRT 7", 7)
add_menu_item($category_reverb, "PLATE", 5)
add_menu_item($category_reverb, "CABINET", 8)
declare !ir_path[68]
!ir_path[0] := "presets/effects/convolution/<<<K4IR.nkx>>>/K4 IR
Samples/Concert Hall A.wav"
!ir_path[1] := "presets/effects/convolution/<<<K4IR.nkx>>>/K4 IR
Samples/Concert Hall B.wav"
!ir_path[2] := "presets/effects/convolution/<<<K4IR.nkx>>>/K4 IR
Samples/Exhibition Hall.wav"
!ir_path[3] := "presets/effects/convolution/<<<K4IR.nkx>>>/K4 IR
Samples/Cathedral A.wav"
!ir_path[4] := "presets/effects/convolution/<<<K4IR.nkx>>>/K4 IR
Samples/Cathedral B.wav"
!ir_path[5] := "presets/effects/convolution/10 Big Rooms/IR Samp
les/ndb_cathedral_ir_32bit.wav"
!ir_path[6] := "presets/effects/convolution/<<<K4IR.nkx>>>/K4 IR
Samples/Club A.wav"
!ir_path[7] := "presets/effects/convolution/<<<K4IR.nkx>>>/K4 IR
Samples/Club B.wav"
!ir_path[8] := "presets/effects/convolution/<<<K4IR.nkx>>>/K4 IR
Samples/Tavern Close.wav"
!ir_path[9] := "presets/effects/convolution/<<<K4IR.nkx>>>/K4 IR
Samples/Tavern Near.wav"
!ir_path[10] := "presets/effects/convolution/<<<K4IR.nkx>>>/K4 I
R Samples/Tavern Medium.wav"
!ir_path[11] := "presets/effects/convolution/<<<K4IR.nkx>>>/K4 I
R Samples/Tavern Far.wav"
!ir_path[12] := "presets/effects/convolution/<<<K4IR.nkx>>>/K4 I
R Samples/Auditorium A.wav"
!ir_path[13] := "presets/effects/convolution/<<<K4IR.nkx>>>/K4 I
R Samples/Auditorium B.wav"
!ir_path[14] := "presets/effects/convolution/<<<K4IR.nkx>>>/K4 I
R Samples/Chamber A.wav"
!ir_path[15] := "presets/effects/convolution/<<<K4IR.nkx>>>/K4 I
R Samples/Chamber B.wav"
!ir_path[16] := "presets/effects/convolution/<<<K4IR.nkx>>>/K4 I
R Samples/Rehearsal Room.wav"
!ir_path[17] := "presets/effects/convolution/<<<K4IR.nkx>>>/K4 I
R Samples/Hard Wood Room B.wav"
!ir_path[18] := "presets/effects/convolution/<<<K4IR.nkx>>>/K4 I
R Samples/Music Studio C.wav"
!ir_path[19] := "presets/effects/convolution/<<<K4IR.nkx>>>/K4 I
R Samples/Small Room A.wav"
!ir_path[20] := "presets/effects/convolution/<<<K4IR.nkx>>>/K4 I
R Samples/Small Room B.wav"
!ir_path[21] := "presets/effects/convolution/<<<K4IR.nkx>>>/K4 I
R Samples/L300 Large Hall.wav"
!ir_path[22] := "presets/effects/convolution/<<<K4IR.nkx>>>/K4 I
R Samples/L300 Gated Hall.wav"
!ir_path[23] := "presets/effects/convolution/<<<K4IR.nkx>>>/K4 I
R Samples/L300 Large Room.wav"
!ir_path[24] := "presets/effects/convolution/<<<K4IR.nkx>>>/K4 I
R Samples/L300 Large Chamber.wav"
!ir_path[25] := "presets/effects/convolution/<<<K4IR.nkx>>>/K4 I
R Samples/L300 Studio C.wav"
!ir_path[26] := "presets/effects/convolution/<<<K4IR.nkx>>>/K4 I
R Samples/L300 Contem-Plate.wav"
!ir_path[27] := "presets/effects/convolution/<<<K4IR.nkx>>>/K4 I
R Samples/L300 Space & Echoes.wav"
!ir_path[28] := "presets/effects/convolution/<<<K4IR.nkx>>>/K4 I
R Samples/L300 Medium Stop.wav"
!ir_path[29] := "presets/effects/convolution/<<<K4IR.nkx>>>/K4 I
R Samples/L300 Drum Cave.wav"
!ir_path[30] := "presets/effects/convolution/<<<K4IR.nkx>>>/K4 I
R Samples/L300 Large Ambience.wav"
!ir_path[31] := "presets/effects/convolution/<<<K4IR.nkx>>>/K4 I
R Samples/L300 Smooth Ambience.wav"
!ir_path[32] := "presets/effects/convolution/<<<K4IR.nkx>>>/K4 I
R Samples/L300 Ambience Wave.wav"
!ir_path[33] := "presets/effects/convolution/<<<K4IR.nkx>>>/K4 I
R Samples/L300 Le Gate.wav"
!ir_path[34] := "presets/effects/convolution/<<<K4IR.nkx>>>/K4 I
R Samples/Quadstick Small - Basic.wav"
!ir_path[35] := "presets/effects/convolution/<<<K4IR.nkx>>>/K4 I
R Samples/Quadstick Small - Disco.wav"
!ir_path[36] := "presets/effects/convolution/<<<K4IR.nkx>>>/K4 I
R Samples/Quadstick Small - Funk.wav"
!ir_path[37] := "presets/effects/convolution/<<<K4IR.nkx>>>/K4 I
R Samples/Quadstick Small - Funky Club.wav"
!ir_path[38] := "presets/effects/convolution/<<<K4IR.nkx>>>/K4 I
R Samples/Quadstick Small - Hip Hop.wav"
!ir_path[39] := "presets/effects/convolution/<<<K4IR.nkx>>>/K4 I
R Samples/Quadstick Small - Reggae Modern.wav"
!ir_path[40] := "presets/effects/convolution/<<<K4IR.nkx>>>/K4 I
R Samples/Quadstick Small - RnB Neptunes.wav"
!ir_path[41] := "presets/effects/convolution/<<<K4IR.nkx>>>/K4 I
R Samples/Quadstick Small - RnB Today 1.wav"
!ir_path[42] := "presets/effects/convolution/<<<K4IR.nkx>>>/K4 I
R Samples/BRT 7 Ambience Large A.wav"
!ir_path[43] := "presets/effects/convolution/<<<K4IR.nkx>>>/K4 I
R Samples/BRT 7 Ambience Small.wav"
!ir_path[44] := "presets/effects/convolution/<<<K4IR.nkx>>>/K4 I
R Samples/BRT 7 Chamber Small.wav"
!ir_path[45] := "presets/effects/convolution/<<<K4IR.nkx>>>/K4 I
R Samples/BRT 7 Chamber Vocal.wav"
!ir_path[46] := "presets/effects/convolution/<<<K4IR.nkx>>>/K4 I
R Samples/BRT 7 Hall Dense.wav"
!ir_path[47] := "presets/effects/convolution/<<<K4IR.nkx>>>/K4 I
R Samples/BRT 7 Location Chapel A.wav"
!ir_path[48] := "presets/effects/convolution/<<<K4IR.nkx>>>/K4 I
R Samples/BRT 7 Plate Snare.wav"
!ir_path[49] := "presets/effects/convolution/<<<K4IR.nkx>>>/K4 I
R Samples/BRT 7 Room Drum.wav"
!ir_path[50] := "presets/effects/convolution/<<<K4IR.nkx>>>/K4 I
R Samples/BRT 7 Room Wood.wav"
!ir_path[51] := "presets/effects/convolution/<<<K4IR.nkx>>>/K4 I
R Samples/BRT 7 Location Cineastic Room.wav"
!ir_path[52] := "presets/effects/convolution/<<<K4IR.nkx>>>/K4 I
R Samples/E245 0.5s A.wav"
!ir_path[53] := "presets/effects/convolution/<<<K4IR.nkx>>>/K4 I
R Samples/E245 1.0s A.wav"
!ir_path[54] := "presets/effects/convolution/<<<K4IR.nkx>>>/K4 I
R Samples/E245 1.4s A.wav"
!ir_path[55] := "presets/effects/convolution/<<<K4IR.nkx>>>/K4 I
R Samples/E245 2.1s A.wav"
!ir_path[56] := "presets/effects/convolution/<<<K4IR.nkx>>>/K4 I
R Samples/E245 4.5s A.wav"
!ir_path[57] := "presets/effects/convolution/<<<K4IR.nkx>>>/K4 I
R Samples/E252 0.6s.wav"
!ir_path[58] := "presets/effects/convolution/<<<K4IR.nkx>>>/K4 I
R Samples/E252 1.0s.wav"
!ir_path[59] := "presets/effects/convolution/<<<K4IR.nkx>>>/K4 I
R Samples/E252 1.8s.wav"
!ir_path[60] := "presets/effects/convolution/<<<K4IR.nkx>>>/K4 I
R Samples/E252 3.0s.wav"
!ir_path[61] := "presets/effects/convolution/<<<K4IR.nkx>>>/K4 I
R Samples/E252 4.5s.wav"
!ir_path[62] := "presets/effects/convolution/17 Cabinets/Brit 21
2/IR Samples/Brit_212_Tube_Center.wav"
!ir_path[63] := "presets/effects/convolution/17 Cabinets/Tweed 1
12/IR Samples/Tweed_112_Tube_Center.wav"
!ir_path[64] := "presets/effects/convolution/17 Cabinets/Tweed 2
12/IR Samples/Tweed_212_Tube_Center.wav"
!ir_path[65] := "presets/effects/convolution/17 Cabinets/Tweed 4
10/IR Samples/Tweed_410_Tube_Center.wav"
!ir_path[66] := "presets/effects/convolution/17 Cabinets/Rock 41
2/IR Samples/Rock_412_Tube_Center.wav"
!ir_path[67] := "presets/effects/convolution/17 Cabinets/Modern
412/IR Samples/Modern_412_Tube_Center.wav"

declare !ir_type[68]
!ir_type[0] := "HALL A"
!ir_type[1] := "HALL B"
!ir_type[2] := "EXHIBITION HALL"
!ir_type[3] := "CATHEDRAL A"
!ir_type[4] := "CATHEDRAL B"
!ir_type[5] := "NDB"
!ir_type[6] := "CLUB A"
!ir_type[7] := "CLUB B"
!ir_type[8] := "TAVERN CLOSE"
!ir_type[9] := "TAVERN NEAR"
!ir_type[10] := "TAVERN MID"
!ir_type[11] := "TAVERN FAR"
!ir_type[12] := "AUDITORIUM A"
!ir_type[13] := "AUDITORIUM B"
!ir_type[14] := "CHAMBER A"
!ir_type[15] := "CHAMBER B"
!ir_type[16] := "REHEARSAL"
!ir_type[17] := "HARD WOOD"
!ir_type[18] := "MUSIC STUDIO"
!ir_type[19] := "SMALL ROOM A"
!ir_type[20] := "SMALL ROOM B"
!ir_type[21] := "LARGE HALL"
!ir_type[22] := "GATED HALL"
!ir_type[23] := "LARGE ROOM"
!ir_type[24] := "LRG CHAMBER"
!ir_type[25] := "STUDIO C"
!ir_type[26] := "PLATE"
!ir_type[27] := "ECHOES"
!ir_type[28] := "MEDIUM STOP"
!ir_type[29] := "DRUM CAVE"
!ir_type[30] := "LARGE AMBI"
!ir_type[31] := "SMOOTH AMBI"
!ir_type[32] := "AMBI WAVE"
!ir_type[33] := "LE GATE"
!ir_type[34] := "BASIC"
!ir_type[35] := "DISCO"
!ir_type[36] := "FUNK"
!ir_type[37] := "FUNKY CLUB"
!ir_type[38] := "HIP HOP"
!ir_type[39] := "REGGAE MOD"
!ir_type[40] := "RNB NEPTUNES"
!ir_type[41] := "RNB TODAY"
!ir_type[42] := "LARGE AMBI"
!ir_type[43] := "SMALL AMBI"
!ir_type[44] := "SML CHAMBER"
!ir_type[45] := "VOC CHAMBER"
!ir_type[46] := "DENSE HALL"
!ir_type[47] := "CHAPEL"
!ir_type[48] := "SNARE PLATE"
!ir_type[49] := "DRUM ROOM"
!ir_type[50] := "WOOD ROOM"
!ir_type[51] := "CINEASTIC"
!ir_type[52] := "E245 0.5s"
!ir_type[53] := "E245 1.0s"
!ir_type[54] := "E245 1.4s"
!ir_type[55] := "E245 2.1s"
!ir_type[56] := "E245 4.5s"
!ir_type[57] := "E252 0.6s"
!ir_type[58] := "E252 1.0s"
!ir_type[59] := "E252 1.8s"
!ir_type[60] := "E252 3.0s"
!ir_type[61] := "E252 4.5s"
!ir_type[62] := "BRIT 2x12"
!ir_type[63] := "TWEED 1x12"
!ir_type[64] := "TWEED 2x12"
!ir_type[65] := "TWEED 4x10"
!ir_type[66] := "ROCK 4x12"
!ir_type[67] := "MODERN 4x12"
$count := 0
while ($count < 68)
if ($count < 3)
add_menu_item($hall_reverb,!ir_type[$count],$cou
nt)
else
if ($count < 6)
add_menu_item($cathedral_reverb,!ir_type
[$count],$count)
else
if ($count < 14)
add_menu_item($club_reverb,!ir_t
ype[$count],$count)
else
if ($count < 21)
add_menu_item($room_reve
rb,!ir_type[$count],$count)
else
if ($count < 34)
add_menu_item($l300_reve
rb,!ir_type[$count],$count)
else
if($count < 42)
add_menu
_item($quadstick_reverb,!ir_type[$count],$count)
else
if ($cou
nt < 52)
add_menu_item($brt7_reverb,!ir_type[$count],$count)
else
if ($count < 62)
add_menu_item($plate_reverb,!ir_type[$count],$count)
else
add_menu_item($cabinet_reverb,!ir_type[$count],$count)
end if
end if
end if
end if
end if
end if
end if
end if
inc ($count)
end while
make_persistent($category_reverb)
make_persistent($hall_reverb)
make_persistent($cathedral_reverb)
make_persistent($club_reverb)
make_persistent($room_reverb)
make_persistent($l300_reverb)
make_persistent($quadstick_reverb)
make_persistent($brt7_reverb)
make_persistent($plate_reverb)
make_persistent($cabinet_reverb)
_read_persistent_var($category_reverb)
_read_persistent_var($hall_reverb)
_read_persistent_var($cathedral_reverb)
_read_persistent_var($club_reverb)
_read_persistent_var($room_reverb)
_read_persistent_var($l300_reverb)
_read_persistent_var($quadstick_reverb)
_read_persistent_var($brt7_reverb)
_read_persistent_var($plate_reverb)
_read_persistent_var($cabinet_reverb)
$count := 0
while ($count < 9)
if ($count = $category_reverb)
set_control_par(%subcat_menu_id[$count],$CONTROL
_PAR_HIDE,$HIDE_PART_NOTHING)
else
set_control_par(%subcat_menu_id[$count],$CONTROL
_PAR_HIDE,$HIDE_WHOLE_CONTROL)
end if
inc ($count)
end while
set_control_par(get_ui_id($image_reverb),$CONTROL_PAR_PICTURE_ST
ATE,$category_reverb)
{/reverb functionality}
declare %bandfx_id[$NUM_BANDFX]
%bandfx_id[0] := get_ui_id($backgr_bandfx)
%bandfx_id[1] := get_ui_id($title_bandfx)
%bandfx_id[2] := get_ui_id($lb_rev_bandfx)
%bandfx_id[3] := get_ui_id($lb_cab_bandfx)
%bandfx_id[4] := get_ui_id($lb_eq_bandfx)
%bandfx_id[5] := get_ui_id($lb_rev_onoff_bandfx)
%bandfx_id[6] := get_ui_id($lb_rev_room_bandfx)
%bandfx_id[7] := get_ui_id($lb_rev_mix_bandfx)
%bandfx_id[8] := get_ui_id($image_reverb)
%bandfx_id[9] := get_ui_id($lb_cab_onoff_bandfx)
%bandfx_id[10] := get_ui_id($lb_cab_type_bandfx)
%bandfx_id[11] := get_ui_id($lb_cab_air_bandfx)
%bandfx_id[12] := get_ui_id($cab_image_bandfx)
%bandfx_id[13] := get_ui_id($lb_eq_onoff_bandfx)
%bandfx_id[14] := get_ui_id($lb_eq_lo_bandfx)
%bandfx_id[15] := get_ui_id($lb_eq_mid_bandfx)
%bandfx_id[16] := get_ui_id($lb_eq_hi_bandfx)
%bandfx_id[17] := get_ui_id($rev_amount_bandfx)
%bandfx_id[18] := get_ui_id($cab_air_bandfx)
%bandfx_id[19] := get_ui_id($eq_lo_bandfx)
%bandfx_id[20] := get_ui_id($eq_mid_bandfx)
%bandfx_id[21] := get_ui_id($eq_hi_bandfx)
%bandfx_id[22] := get_ui_id($rev_bandfx)
%bandfx_id[23] := get_ui_id($cab_bandfx)
%bandfx_id[24] := get_ui_id($eq_bandfx)
%bandfx_id[25] := get_ui_id($rev_onoff_bandfx)
%bandfx_id[26] := get_ui_id($cab_onoff_bandfx)
%bandfx_id[27] := get_ui_id($eq_onoff_bandfx)
%bandfx_id[29] := get_ui_id($cab_type_bandfx)
%bandfx_id[30] := get_ui_id($category_reverb)
%bandfx_id[31] := get_ui_id($eq_background_bandfx)
%bandfx_id[32] := get_ui_id($masterfx_bg_bandfx)
%bandfx_id[33] := get_ui_id($hall_reverb)
%bandfx_id[34] := get_ui_id($cathedral_reverb)
%bandfx_id[35] := get_ui_id($club_reverb)
%bandfx_id[36] := get_ui_id($room_reverb)
%bandfx_id[37] := get_ui_id($l300_reverb)
%bandfx_id[38] := get_ui_id($quadstick_reverb)
%bandfx_id[39] := get_ui_id($brt7_reverb)
%bandfx_id[40] := get_ui_id($plate_reverb)
%bandfx_id[41] := get_ui_id($cabinet_reverb)
{POSITIONING OF INDIVIDUAL CONTROLS}
move_control_px($backgr_bandfx,($GRID_X * 1) + 77, ($GRID_Y * 1)
+ 16) {possible to offset control in pixels}
move_control_px($title_bandfx, ($GRID_X * 1) + 0, ($GRID_Y * 1)
+ 0)
move_control_px($lb_rev_bandfx, ($GRID_X * 1) + 0, ($GRID_Y * 2)
+ 0)
move_control_px($lb_cab_bandfx, ($GRID_X * 1) + 46, ($GRID_Y * 2
) + 0)
move_control_px($lb_eq_bandfx, ($GRID_X * 2) + 0, ($GRID_Y * 2)
+ 0)
move_control_px($lb_rev_onoff_bandfx, ($GRID_X * 2) + 46, ($GRID
_Y * 2) + 0)
move_control_px($lb_rev_room_bandfx, ($GRID_X * 3) + 46, ($GRID_
Y * 2) + 0)
move_control_px($lb_rev_mix_bandfx, ($GRID_X * 3) + 85, ($GRID_Y
* 2) + 9)
move_control_px($image_reverb, ($GRID_X * 2) + 86, ($GRID_Y * 2)
+ 20)
move_control_px($lb_cab_onoff_bandfx, ($GRID_X * 2) + 46, ($GRID
_Y * 2) + 0)
move_control_px($lb_cab_type_bandfx, ($GRID_X * 2) + 46, ($GRID_
Y * 4) + 0)
move_control_px($lb_cab_air_bandfx, ($GRID_X * 3) + 85, ($GRID_Y
* 2) + 9)
move_control_px($cab_image_bandfx, ($GRID_X * 2) + 89, ($GRID_Y
* 2) + 12)
move_control_px($lb_eq_onoff_bandfx, ($GRID_X * 2) + 46, ($GRID_
Y * 2) + 0)
move_control_px($lb_eq_lo_bandfx, ($GRID_X * 2) + 87, ($GRID_Y *
5) + 0)
move_control_px($lb_eq_mid_bandfx, ($GRID_X * 3) + 41, ($GRID_Y
* 5) + 0)
move_control_px($lb_eq_hi_bandfx, ($GRID_X * 3) + 86, ($GRID_Y *
5) + 0)
move_control_px($rev_amount_bandfx, ($GRID_X * 4) + 21, ($GRID_Y
* 3) + 5)
move_control_px($cab_air_bandfx, ($GRID_X * 4) + 21, ($GRID_Y *
3) + 5)
move_control_px($eq_lo_bandfx, ($GRID_X * 3) + 35, ($GRID_Y * 2)
+ 12)
move_control_px($eq_mid_bandfx, ($GRID_X * 3) + 80, ($GRID_Y * 2
) + 12)
move_control_px($eq_hi_bandfx, ($GRID_X * 4) + 33, ($GRID_Y * 2)
+ 12)
move_control_px($rev_bandfx, ($GRID_X * 2) + 7, ($GRID_Y * 1) +
16)
move_control_px($cab_bandfx, ($GRID_X * 2) + 7, ($GRID_Y * 3) +
5)
move_control_px($eq_bandfx, ($GRID_X * 2) + 7, ($GRID_Y * 4) + 1
6)
move_control_px($rev_onoff_bandfx, ($GRID_X * 1) + 79, ($GRID_Y
* 1) + 18)
move_control_px($cab_onoff_bandfx, ($GRID_X * 1) + 79, ($GRID_Y
* 3) + 8)
move_control_px($eq_onoff_bandfx, ($GRID_X * 1) + 79, ($GRID_Y *
4) + 20)
move_control_px($cab_type_bandfx, ($GRID_X * 2) + 84, ($GRID_Y *
5) + 2)
move_control_px($category_reverb, ($GRID_X * 2) + 84, ($GRID_Y *
2) + 6)
move_control_px($eq_background_bandfx, ($GRID_X * 2) + 79, ($GRI
D_Y * 2) + 2)
move_control_px($masterfx_bg_bandfx, ($GRID_X * 2) + 85, ($GRID_
Y * 2) + 6)
{VARIOUS ATTRIBUTES}
set_control_par(%bandfx_id[19], $CONTROL_PAR_DEFAULT_VALUE, 5000
00)
set_control_par(%bandfx_id[20], $CONTROL_PAR_DEFAULT_VALUE, 5000
00)
set_control_par(%bandfx_id[21], $CONTROL_PAR_DEFAULT_VALUE, 5000
00)
$rev_amount_bandfx := _get_engine_par ($ENGINE_PAR_SENDLEVEL_0,
-1, 7, 1)
$cab_air_bandfx := _get_engine_par ($ENGINE_PAR_CB_AIR, -1, $cab
_slot, 1)
$eq_lo_bandfx := _get_engine_par($ENGINE_PAR_GAIN1, -1, $meq_slo
t, 1)
$eq_mid_bandfx := _get_engine_par($ENGINE_PAR_GAIN2, -1, $meq_sl
ot, 1)
$eq_hi_bandfx := _get_engine_par($ENGINE_PAR_GAIN3, -1, $meq_slo
t, 1)
$rev_onoff_bandfx := (_get_engine_par($ENGINE_PAR_SEND_EFFECT_BY
PASS, -1, $reverb_slot, 0) + 1) mod 2
$cab_onoff_bandfx := (_get_engine_par($ENGINE_PAR_SEND_EFFECT_BY
PASS, -1, $cab_slot, 1) + 1) mod 2
$eq_onoff_bandfx := (_get_engine_par($ENGINE_PAR_SEND_EFFECT_BYP
ASS, -1, $meq_slot, 1) + 1) mod 2
make_persistent($cab_type_bandfx)
set_control_par_str(%bandfx_id[0], $CONTROL_PAR_TEXT, "")
set_control_par_str(%bandfx_id[1], $CONTROL_PAR_TEXT, "")
set_control_par_str(%bandfx_id[2], $CONTROL_PAR_TEXT, "")
set_control_par_str(%bandfx_id[3], $CONTROL_PAR_TEXT, "")
set_control_par_str(%bandfx_id[4], $CONTROL_PAR_TEXT, "")
set_control_par_str(%bandfx_id[5], $CONTROL_PAR_TEXT, "")
set_control_par_str(%bandfx_id[6], $CONTROL_PAR_TEXT, "")
set_control_par_str(%bandfx_id[7], $CONTROL_PAR_TEXT, "AMOUNT")
set_control_par_str(%bandfx_id[8], $CONTROL_PAR_TEXT, "")
set_control_par_str(%bandfx_id[9], $CONTROL_PAR_TEXT, "")
set_control_par_str(%bandfx_id[10], $CONTROL_PAR_TEXT, "")
set_control_par_str(%bandfx_id[11], $CONTROL_PAR_TEXT, "AIR")
set_control_par_str(%bandfx_id[12], $CONTROL_PAR_TEXT, "")
set_control_par_str(%bandfx_id[13], $CONTROL_PAR_TEXT, "")
set_control_par_str(%bandfx_id[14], $CONTROL_PAR_TEXT, "BASS")
set_control_par_str(%bandfx_id[15], $CONTROL_PAR_TEXT, "MID")
set_control_par_str(%bandfx_id[16], $CONTROL_PAR_TEXT, "TREBLE")
set_control_par_str(%bandfx_id[31], $CONTROL_PAR_TEXT, "")
set_control_par_str(%bandfx_id[32], $CONTROL_PAR_TEXT, "")
add_menu_item ($cab_type_bandfx,"TWEED GREEN",0)
add_menu_item ($cab_type_bandfx,"BRIT 60s",1)
add_menu_item ($cab_type_bandfx,"CHIEF V-30",2)
add_menu_item ($cab_type_bandfx,"CHIEF Back",3)
add_menu_item ($cab_type_bandfx,"TWEED ALNICO",4)
add_menu_item ($cab_type_bandfx,"TWEED FAR",5)
add_menu_item ($cab_type_bandfx,"UK 70s",6)
add_menu_item ($cab_type_bandfx,"UK 70s FAR",7)
add_menu_item ($cab_type_bandfx,"BASS-WR",8)
add_menu_item ($cab_type_bandfx,"BASS-WR HORN",9)
add_menu_item ($cab_type_bandfx,"LESLIE",10)

$count := 1
while ($count < 17)
set_control_par(%bandfx_id[$count], $CONTROL_PAR_WIDTH,
($GRID_X * 1))
set_control_par(%bandfx_id[$count], $CONTROL_PAR_HEIGHT,
($GRID_Y * 1))
set_control_par(%bandfx_id[$count], $CONTROL_PAR_HIDE, $
HIDE_PART_BG)
set_control_par(%bandfx_id[$count], $CONTROL_PAR_TEXT_AL
IGNMENT, 1)
set_control_par(%bandfx_id[$count], $CONTROL_PAR_FONT_TY
PE, $FONT_ID)
inc($count)
end while
set_control_par(%bandfx_id[8], $CONTROL_PAR_HIDE, $HIDE_PART_NOT
HING)
set_control_par_str(%bandfx_id[0], $CONTROL_PAR_PICTURE, "pv_ban
d_master_tab_animation")
set_control_par_str(%bandfx_id[31], $CONTROL_PAR_PICTURE, "pv_ba
nd_master_fx_eq_bg")
set_control_par_str(%bandfx_id[32], $CONTROL_PAR_PICTURE, "pv_ba
nd_master_fx_bg")
$count := 17
while ($count < 19)
set_control_par_str(%bandfx_id[$count], $CONTROL_PAR_PIC
TURE, "pv_band_knob_small")
set_control_par(%bandfx_id[$count], $CONTROL_PAR_MOUSE_B
EHAVIOUR, -500)
inc($count)
end while
$count := 19
while ($count < 22)
set_control_par_str(%bandfx_id[$count], $CONTROL_PAR_PIC
TURE, "pv_band_master_fx_eq_fader")
set_control_par(%bandfx_id[$count], $CONTROL_PAR_MOUSE_B
EHAVIOUR, -1000)
inc($count)
end while
set_control_par(%bandfx_id[22], $CONTROL_PAR_VALUE, 1)
$count := 22
while ($count < 25)
set_control_par_str(%bandfx_id[$count], $CONTROL_PAR_PIC
TURE, "pv_vintage_drums_btn_trans")
set_control_par(%bandfx_id[$count], $CONTROL_PAR_WIDTH,
51)
set_control_par(%bandfx_id[$count], $CONTROL_PAR_HEIGHT,
31)
set_control_par_str(%bandfx_id[$count], $CONTROL_PAR_TEX
T, "")
inc($count)
end while
$count := 25
while ($count < 28)
set_control_par_str(%bandfx_id[$count], $CONTROL_PAR_PIC
TURE, "pv_synth_button_small")
set_control_par(%bandfx_id[$count], $CONTROL_PAR_WIDTH,
23)
set_control_par(%bandfx_id[$count], $CONTROL_PAR_HEIGHT,
23)
set_control_par_str(%bandfx_id[$count], $CONTROL_PAR_TEX
T, "")
inc($count)
end while
set_control_par_str(%bandfx_id[29], $CONTROL_PAR_PICTURE, "pv_ba
nd_master_fx_rev_dropdown_1")
set_control_par_str(%bandfx_id[30], $CONTROL_PAR_PICTURE, "pv_ba
nd_master_fx_rev_dropdown_2")
set_control_par(%bandfx_id[29], $CONTROL_PAR_FONT_TYPE, $FONT_ID
_2)
set_control_par(%bandfx_id[30], $CONTROL_PAR_FONT_TYPE, $FONT_ID
_2)
_read_persistent_var($cab_type_bandfx)
set_control_par_str(%bandfx_id[12], $CONTROL_PAR_PICTURE, "pv_gl
obal_cabinets")
set_control_par(%bandfx_id[12], $CONTROL_PAR_PICTURE_STATE, $cab
_type_bandfx)
{Hide the Cabinet Elements}
$count := 9
while ($count < 13)
set_control_par(%bandfx_id[$count], $CONTROL_PAR_HIDE, $
HIDE_WHOLE_CONTROL)
inc($count)
end while
set_control_par(%bandfx_id[18], $CONTROL_PAR_HIDE, $HIDE_WHOLE_C
ONTROL)
set_control_par(%bandfx_id[29], $CONTROL_PAR_HIDE, $HIDE_WHOLE_C
ONTROL)
{Hide the EQ Elements}
$count := 13
while ($count < 17)
set_control_par(%bandfx_id[$count], $CONTROL_PAR_HIDE, $
HIDE_WHOLE_CONTROL)
inc($count)
end while
set_control_par(%bandfx_id[19], $CONTROL_PAR_HIDE, $HIDE_WHOLE_C
ONTROL)
set_control_par(%bandfx_id[20], $CONTROL_PAR_HIDE, $HIDE_WHOLE_C
ONTROL)
set_control_par(%bandfx_id[21], $CONTROL_PAR_HIDE, $HIDE_WHOLE_C
ONTROL)
set_control_par(%bandfx_id[31], $CONTROL_PAR_HIDE, $HIDE_WHOLE_C
ONTROL)
{Other}
$count := 0
while ($count < $NUM_bandfx)
if ($count # 28)
set_control_par (%bandfx_id[$count],$CONTROL_PAR_POS_X,g
et_control_par(%bandfx_id[$count],$CONTROL_PAR_POS_X)...
+$ROOT_X + ($x_grid_bandfx - 2)*$GRID_X + $x_px_bandfx)
set_control_par (%bandfx_id[$count],$CONTROL_PAR_POS_Y,g
et_control_par(%bandfx_id[$count],$CONTROL_PAR_POS_Y)...
+$ROOT_Y + ($y_grid_bandfx - 2)*$GRID_Y + $y_px_bandfx)
end if
inc($count)
end while

{Automation}
set_control_par_str(get_ui_id($rev_onoff_bandfx),$CONTROL_PAR_AU
TOMATION_NAME,"Reverb")
set_control_par_str(get_ui_id($cab_onoff_bandfx),$CONTROL_PAR_AU
TOMATION_NAME,"Cabinet")
set_control_par_str(get_ui_id($eq_onoff_bandfx),$CONTROL_PAR_AUT
OMATION_NAME,"EQ")
set_control_par_str(get_ui_id($rev_amount_bandfx),$CONTROL_PAR_A
UTOMATION_NAME,"Rv Amt")
set_control_par_str(get_ui_id($cab_air_bandfx),$CONTROL_PAR_AUTO
MATION_NAME,"Cb Air")
set_control_par_str(get_ui_id($eq_lo_bandfx),$CONTROL_PAR_AUTOMA
TION_NAME,"Lo EQ")
set_control_par_str(get_ui_id($eq_mid_bandfx),$CONTROL_PAR_AUTOM
ATION_NAME,"Mid EQ")
set_control_par_str(get_ui_id($eq_hi_bandfx),$CONTROL_PAR_AUTOMA
TION_NAME,"Hi EQ")
set_control_par_str(get_ui_id($rev_amount_bandfx),$CONTROL_PAR_L
ABEL,get_engine_par_disp($ENGINE_PAR_SENDLEVEL_0, -1, $sends_slot, 1) & " dB")
set_control_par_str(get_ui_id($cab_air_bandfx),$CONTROL_PAR_LABE
L,get_engine_par_disp($ENGINE_PAR_CB_AIR, -1, $cab_slot, 1) & " %")
set_control_par_str(get_ui_id($eq_lo_bandfx),$CONTROL_PAR_LABEL,
get_engine_par_disp($ENGINE_PAR_GAIN1, -1, $meq_slot, 1) & " dB")
set_control_par_str(get_ui_id($eq_mid_bandfx),$CONTROL_PAR_LABEL
,get_engine_par_disp($ENGINE_PAR_GAIN2, -1, $meq_slot, 1) & " dB")
set_control_par_str(get_ui_id($eq_hi_bandfx),$CONTROL_PAR_LABEL,
get_engine_par_disp($ENGINE_PAR_GAIN3, -1, $meq_slot, 1) & " dB")
{*** END CONTROL GROUP "BANDFX"}

declare %EQ_Data[99] := (...


{0} 500000,500000,500000, 500000,500000,500000, 500000,500000,50
0000,...
{1} 365637,62500,700000, 620113,62500,500000, 1000000,1000000,0,
...
{2} 83984,326172,200195, 405273,128906,589844, 1000000,1000000,1
81641,...
{3} 245117,416016,266602, 632813,207031,625977, 862305,173828,66
1133,...
{4} 515625,0,704102, 447266,0,169922, 706055,0,714844,...
{5} 870117,586914,715820, 333008,360352,272461, 856445,0,192383,
...
{6} 648438,586914,757813, 266602,360352,165039, 670898,0,132813,
...
{7} 376953,0,39062, 555664,0,578125, 796875,144531,623047,...
{8} 172852,660156,0, 699219,6836,692383, 407227,0,778320,...
{9} 233398,219727,583984, 533203,250000,355469, 633789,639648,60
1563,...
{10} 137695,357422,362305, 491211,250000,571289, 832031,417969,46386
7)
message ("")
declare $dynamic_helper
declare $Resonance_Release_helper
{------------------------------------------------------------}
{----------- Individual Instrument declarations -------------}
{------------------------------------------------------------}
{These settings are different from instrument to instrument...}

{------------------------------}
{-- Dry Tone Group Ids --------}
{------------------------------}
{The first variable contains the group ID of key C0.
The second varibale contains either 0 or 1. If 1 is
entered the must separate groups per half tone with
increasing group ids.}
declare const $DryTone_Group_ID_C0 := 8
declare const $DryTone_Group_Increase := 1
declare const $Lowest_Key := 21
declare const $Highest_Key := 108
declare $First_Undamped_Pitch := 90 {88 for Upright!}

{------------------------------}
{--Dry Tone Release Time/Curve-}
{------------------------------}
{These arrays control the release fade out time and the release
envelope shape of the dry tones.}
declare const $FADE_OUT_TIME_FACTOR := 10000 { 100 = 1 sec}
{--- Release Fade Out Times ---}
{This array defines the fade-out-time of the dry tones
for each pitch when the key is released.}
declare %fade_out_time[128] := (...
000,000,000,000,000,000,000,000,000,000,000,000, {C-2 to B-2}...
050,050,050,050,050,050,050,050,050,050,050,050, {C-1 to B-1}...
049,048,047,046,045,044,043,043,042,042,041,040, {C0 to B0}...
039,038,037,036,035,034,033,033,032,032,031,030, {C1 to B1}...
030,030,030,030,029,029,029,029,028,028,028,028, {C2 to B2}...
027,027,027,027,026,026,026,026,025,025,025,025, {C3 to B3}...
024,024,024,024,023,023,023,023,022,022,022,022, {C4 to B4}...
021,021,021,021,020,020,020,020,020,020,020,020, {C5 to B5}...
020,020,020,020,020,020,020,020,020,020,020,020, {C6 to B6}...
020,020,020,020,020,020,020,020,020,020,020,020, {C7 to B7}...
020,020,020,020,020,020,020,020) {C8 to G8}
{--Release Envelope Type -----}
{This array selects one of the available release enevelope presets
for each pitch.
0 selects preset number 0, 1 selects preset number 1 etc.}
declare %fade_out_type[128] := (...
4,4,4,4,4,4,4,4,4,4,4,4, {C-2 to B-2}...
4,4,4,4,4,4,4,4,4,4,4,4, {C-1 to B-1}...
4,4,4,4,4,4,4,4,4,4,4,4, {C0 to B0}...
4,4,4,4,4,4,4,4,4,4,4,4, {C1 to B1}...
4,4,4,4,4,4,4,4,4,4,4,4, {C2 to B2}...
4,4,4,4,4,4,4,4,4,4,4,4, {C3 to B3}...
4,4,4,4,4,4,4,4,4,4,4,4, {C4 to B4}...
4,4,4,4,4,4,4,4,4,4,4,4, {C5 to B5}...
4,4,4,4,4,4,4,4,4,4,4,4, {C6 to B6}...
4,4,4,4,4,4,4,4,4,4,4,4, {C7 to B7}...
4,4,4,4,4,4,4,4){C8 to G8}
{-- 10 Step Enevelope Presets ---}
{These arrays define the 10 steps presets of release fade out envelopes.
E.g. The second value = Original volume * factor = volume after 1/10 of release
time.
E.g. The ninth value = Original volume * factor = volume after 9/10 of release
time.}
declare const $FADE_OUT_CURVE_NUMBERS := 5 {Number of defined presets}
declare %Fade_Out_Presets[$FADE_OUT_CURVE_NUMBERS*11] := (...
100,90, 80, 70, 60, 50, 40, 30, 20, 10, 0,...
100,85, 69, 55, 42, 31, 22, 15, 9, 4, 0,...
100,75, 55, 40, 27, 18, 13, 9, 6, 3, 0,...
100,65, 45, 28, 18, 13, 9, 6, 4, 2, 0,...
100,50, 26, 15, 10, 7, 5, 3, 2, 1, 0)
{------------------------------}
{-- Db-Smoothing/Adjustment ---}
{---- Layer dB Correction -----}
{------------------------------}
{These arrays define the max. dB-volume reduction
for all layer lower borders at all pitch positions.
The first line of an octave array defines the layer borders.
The following lines contain the db-reduction per key.
100 = - 1 dB Volume at the lower layer border.
The upper layer border will alway be played at the
original sample volume.
ATTENTION: If you change the layer borders in the sample
they layer borders in first lines in these arrays must
match with the new setting!!!}
{Settings Octave -1}
declare const $LayerNr_01 := 10 {C-1 to B-1}
declare %Layer_dB_Cor_01[$LayerNr_01*13] := (...
17, 28, 40, 52, 64, 76, 88, 100,112,127, {Layer Upper Borders}...
1200,400,400,400,400,400,400,400,400,400, {C}...
1200,400,400,400,400,400,400,400,400,400, {C#}...
1200,400,400,400,400,400,400,400,400,400, {D}...
1200,400,400,400,400,400,400,400,400,400, {D#}...
1200,400,400,400,400,400,400,400,400,400, {E}...
1200,400,400,400,400,400,400,400,400,400, {F}...
1200,400,400,400,400,400,400,400,400,400, {F#}...
1200,400,400,400,400,400,400,400,400,400, {G}...
1200,400,400,400,400,400,400,400,400,400, {G#}...
1200,500,300,100,200,200,300,200,150,100, {A}...
1200,500,300,100,200,200,300,200,150,100, {Bb}...
1200,400,400,200,200,300,350,150,150,100) {B}
declare %Layer_LP_Cor_01[$LayerNr_01*12] := (...
10, 50, 50, 54, 57, 58, 70,72,80,75, {C-1}...
10, 50, 50, 54, 57, 58, 70,72,80,75, {C#-1}...
10, 50, 50, 54, 57, 58, 70,72,80,75, {D-1}...
10, 50, 50, 54, 57, 58, 70,72,80,75, {D#-1}...
10, 50, 50, 54, 57, 58, 70,72,80,75, {E-1}...
10, 50, 50, 54, 57, 58, 70,72,80,75, {F-1}...
10, 50, 50, 54, 57, 58, 70,72,80,75, {F#-1}...
10, 50, 50, 54, 57, 58, 70,72,80,75, {G-1}...
10, 50, 50, 54, 57, 58, 70,72,80,75, {G#-1}...
10, 29, 43, 54, 57, 66, 70,80,88,86, {A-1}...
10, 29, 43, 54, 57, 66, 70,80,88,86, {Bb-1}...
10, 34, 46, 54, 55, 66, 75,75,75,80) {B-1}...

{Settings Octave 0}
declare const $LayerNr_02 := 10 {C0 to B0}
declare %Layer_dB_Cor_02[$LayerNr_02*13] := (...
17, 28, 40, 52, 64, 76, 88, 100,112,127, {Layer Upper Borders}...
1200,600,350,200,100,300,300,200,150,100, {C}...
1200,600,350,200,100,300,300,200,150,100, {C#}...
1200,600,400,200,100,200,250,250,150,300, {D}...
1200,600,400,200,100,200,250,250,150,300, {D#}...
1200,500,350,200,200,050,300,250,150,100, {E}...
1200,600,200,300,100,100,300,150,150,100, {F}...
1200,600,200,300,100,100,300,150,150,100, {F#}...
1200,450,250,300,170,050,350,150,150,300, {G}...
1200,450,250,300,170,050,350,150,150,300, {G#}...
1200,400,250,400,200,050,350,200,150,150, {A}...
1200,400,250,400,200,050,350,200,150,150, {Bb}...
1200,400,250,250,200,050,400,150,150,150) {B}
declare %Layer_LP_Cor_02[$LayerNr_02*12] := (...
10, 41, 45, 54, 55, 61, 65,69,75,86, {C0}...
10, 41, 45, 54, 55, 61, 65,69,75,86, {C#0}...
10, 45, 46, 54, 57, 61, 65,72,78,88, {D0}...
10, 45, 46, 54, 57, 61, 65,72,78,88, {D#0}...
10, 41, 47, 54, 50, 61, 65,73,80,86, {E0}...
10, 45, 41, 54, 53, 61, 67,72,75,79, {F0}...
10, 45, 41, 54, 53, 61, 76,72,75,79, {F#0}...
10, 38, 45, 54, 54, 66, 68,90,80,90, {G0}...
10, 38, 45, 54, 54, 66, 68,90,80,90, {G#}...
10, 45, 44, 49, 50, 66, 68,77,80,79, {A0}...
10, 45, 44, 49, 50, 66, 68,77,80,79, {Bb0}...
10, 40, 54, 54, 62, 58, 70,77,82,79) {B0}

{Settings Octave 1}
declare const $LayerNr_03 := 10 {C1 to B1}
declare %Layer_dB_Cor_03[$LayerNr_03*13] := (...
17, 28, 40, 52, 64,76, 88, 100,112,127, {Layer Upper Borders}...
1200,150,200,200,250,150,450,150,200,200, {C}...
1200,150,200,200,250,150,450,150,200,200, {C#}...
1200,300,300,200,200,100,350,200,150,100, {D}...
1200,300,300,200,200,100,350,200,150,100, {D#}...
1200,450,250,100,200,050,400,200,200,100, {E}...
1200,350,100,200,250,100,400,200,200,150, {F}...
1200,350,100,200,250,100,400,200,200,150, {F#}...
1200,500,200,500,300,150,400,200,100,150, {G}...
1200,500,200,500,300,150,400,200,100,150, {G#}...
1200,300,050,400,200,400,400,200,050,100, {A}...
1200,300,050,400,200,400,400,200,050,100, {Bb}...
1200,450,350,200,300,100,400,150,050,300) {B}
declare %Layer_LP_Cor_03[$LayerNr_03*12] := (...
10, 30, 50, 54, 55, 67, 75,57,99,86, {C1}...
10, 30, 50, 54, 55, 67, 75,57,99,86, {C#1}...
10, 30, 50, 54, 53, 57, 65,75,78,75, {D1}...
10, 30, 50, 54, 53, 57, 65,75,78,75, {D#1}...
10, 40, 50, 58, 57, 58, 68,77,80,81, {E1}...
10, 30, 54, 54, 56, 58, 73,75,80,84, {F1}...
10, 30, 54, 54, 56, 58, 73,75,80,84, {F#1}...
10, 45, 50, 54, 54, 59, 70,70,84,81, {G1}...
10, 45, 50, 54, 54, 59, 70,70,84,81, {G#1}...
10, 25, 55, 54, 54, 57, 70,80,86,81, {A1}...
10, 25, 55, 54, 54, 57, 70,80,86,81, {Bb1}...
10, 45, 44, 54, 55, 55, 70,80,80,81) {B1}

{Settings Octave 2}
declare const $LayerNr_04 := 10 {C2 to B2}
declare %Layer_dB_Cor_04[$LayerNr_04*13] := (...
17, 28, 40, 52, 64, 76, 88, 100,112,127, {Layer Upper Borders}...
1200,350,250,300,100,150,200,150,100,200, {C}...
1200,350,250,300,100,150,200,150,100,200, {C#}...
1200,300,300,200,100,150,200,150,100,050, {D}...
1200,300,300,200,100,150,200,150,100,050, {D#}...
1200,200,250,300,100,150,300,150,100,150, {E}...
1200,600,300,200,100,100,300,200,100,100, {F}...
1200,600,300,200,100,100,300,200,100,100, {F#}...
1200,300,200,300,200,100,350,200,150,200, {G}...
1200,300,200,300,200,100,350,200,150,200, {G#}...
1200,350,300,250,200,200,350,200,100,050, {A}...
1200,350,300,250,200,200,350,200,100,050, {Bb}...
1200,400,200,250,100,250,300,250,150,150) {B}
declare %Layer_LP_Cor_04[$LayerNr_04*12] := (...
10, 50, 50, 55, 56, 62, 68,80,84,81, {C2}...
10, 50, 50, 55, 56, 62, 68,80,84,81, {C#2}...
10, 50, 37, 54, 55, 57, 68,80,82,86, {D2}...
10, 50, 37, 54, 55, 57, 68,80,82,86, {Eb2}...
10, 25, 47, 56, 58, 56, 70,72,75,81, {E2}...
10, 40, 48, 54, 55, 56, 68,75,82,81, {F2}...
10, 40, 48, 54, 55, 56, 68,75,82,81, {F#2}...
10, 55, 50, 63, 61, 60, 73,77,82,86, {G2}...
10, 55, 50, 63, 61, 60, 73,77,82,86, {G#2}...
10, 50, 48, 58, 60, 60, 70,77,86,86, {A2}...
10, 50, 48, 58, 60, 60, 70,77,86,86, {Bb2}...
10, 40, 61, 60, 59, 62, 73,99,80,80) {B2}
{Settings Octave 3}
declare const $LayerNr_05 := 10 {C3 to B3}
declare %Layer_dB_Cor_05[$LayerNr_05*13] := (...
17, 28, 40, 52, 64, 76, 88, 100,112,127, {Layer Upper Borders}...
900,600,100,200,250,200,350,200,200,100, {C}...
900,600,100,200,250,200,350,200,200,100, {C#}...
900,300,300,250,200,100,200,250,200,100, {D}...
900,300,300,250,200,100,200,250,200,100, {Eb}...
900,400,200,200,200,200,200,200,250,100, {E}...
900,500,300,300,200,200,250,350,100,150, {F}...
900,500,300,300,200,200,250,350,100,150, {F#}...
900,350,400,200,100,050,400,100,250,100, {G}...
900,350,400,200,100,050,400,100,250,100, {G#}...
900,250,200,200,200,200,400,050,100,200, {A}...
900,250,200,200,200,200,400,050,100,200, {Bb}...
900,500,400,200,200,100,400,100,200,100) {B}
declare %Layer_LP_Cor_05[$LayerNr_05*12] := (...
10, 50, 54, 57, 57, 57, 70,77,80,86, {C3}...
10, 50, 54, 57, 57, 57, 70,77,80,86, {C#3}...
10, 40, 63, 57, 59, 58, 68,80,80,84, {D3}...
10, 40, 63, 57, 59, 58, 68,80,80,84, {Eb3}...
10, 55, 50, 57, 62, 62, 70,75,84,86, {E3}...
10, 55, 54, 59, 63, 70, 73,80,84,84, {F3}...
10, 55, 54, 59, 63, 70, 73,80,84,84, {F#3}...
10, 50, 57, 62, 64, 63, 75,80,84,84, {G3}...
10, 50, 57, 62, 64, 63, 75,80,84,84, {G#3}...
10, 45, 59, 61, 61, 65, 80,80,82,84, {A3}...
10, 45, 59, 61, 61, 65, 80,80,82,84, {Bb3}...
10, 55, 58, 62, 61, 69, 80,77,82,84) {B3}

{Settings Octave 4}
declare const $LayerNr_06 := 10 {C4 to B4}
declare %Layer_dB_Cor_06[$LayerNr_06*13] := (...
17, 28, 40, 52, 64, 76, 88, 100,112,127, {Layer Upper Borders}...
1200,800,350,100,250,100,300,200,200,100, {C}...
1200,800,350,100,250,100,300,200,200,100, {C#}...
1200,650,600,150,400,100,350,100,200,150, {D}...
1200,650,600,150,400,100,350,100,200,150, {Eb}...
1200,600,300,300,300,100,400,100,150,150, {E}...
1200,500,300,400,100,100,400,250,200,150, {F}...
1200,500,300,400,100,100,400,250,200,150, {F#}...
1200,650,400,200,200,100,400,250,150,200, {G}...
1200,650,400,200,200,100,400,250,150,200, {G#}...
1200,650,300,200,250,200,450,150,050,150, {A}...
1200,650,300,200,250,200,450,150,050,150, {Bb}...
1200,600,500,200,200,200,600,150,050,050) {B}
declare %Layer_LP_Cor_06[$LayerNr_06*12] := (...
10, 50, 56, 60, 63, 68, 70,80,84,95, {C4}...
10, 50, 56, 60, 63, 68, 70,80,84,95, {C#4}...
10, 55, 61, 65, 63, 71, 76,80,84,86, {D4}...
10, 55, 61, 65, 63, 71, 76,80,84,86, {D#4}...
10, 57, 58, 61, 66, 70, 76,85,84,86, {E4}...
10, 50, 60, 62, 59, 70, 76,80,88,86, {F4}...
10, 50, 60, 62, 59, 70, 76,80,88,86, {F#4}...
10, 55, 59, 62, 67, 70, 76,85,90,86, {G4}...
10, 55, 59, 62, 67, 70, 76,85,90,86, {G#4}...
10, 60, 60, 62, 60, 67, 80,84,84,86, {A4}...
10, 60, 60, 62, 60, 67, 80,84,84,86, {Bb4}...
10, 60, 66, 62, 59, 65, 76,95,88,88) {B4}
{Settings Octave 5}
declare const $LayerNr_07 := 10 {C5 to B5}
declare %Layer_dB_Cor_07[$LayerNr_07*13] := (...
17, 28, 40, 52, 64, 76, 88, 100,112,127, {Layer Upper Borders}...
1200,700,400,350,100,100,450,200,100,200, {C}...
1200,700,400,350,100,100,450,200,100,200, {C#}...
1200,600,450,200,300,100,400,250,100,150, {D}...
1200,600,450,200,300,100,400,250,100,150, {Eb}...
1200,600,400,200,300,050,300,250,050,100, {E}...
1200,400,400,300,200,100,500,250,050,150, {F}...
1200,400,400,300,200,100,500,250,050,150, {F#}...
1200,400,400,300,500,100,400,300,100,200, {G}...
1200,400,400,300,500,100,400,300,100,200, {G#}...
1200,150,500,200,400,300,400,350,050,200, {A}...
1200,150,500,200,400,300,400,350,050,200, {Bb}...
1200,150,500,200,400,100,400,250,150,050) {B}
declare %Layer_LP_Cor_07[$LayerNr_07*12] := (...
10, 57, 62, 65, 64, 68, 80,99,88,90, {C5}...
10, 57, 62, 65, 64, 68, 80,99,88,90, {C#5}...
10, 70, 59, 63, 62, 69, 80,85,86,90, {D5}...
10, 70, 59, 63, 62, 69, 80,85,86,90, {Eb5}...
10, 70, 62, 63, 65, 67, 80,80,88,88, {E5}...
10, 99, 62, 65, 65, 66, 80,85,88,86, {F5}...
10, 99, 62, 65, 65, 66, 80,85,88,86, {F#5}...
10, 70, 62, 67, 64, 68, 80,85,86,88, {G5}...
10, 70, 62, 67, 64, 68, 80,85,86,88, {G#5}...
10, 70, 62, 67, 63, 66, 80,85,86,88, {A5}...
10, 70, 62, 67, 63, 66, 80,85,86,88, {Bb5}...
10, 70, 62, 66, 67, 69, 80,85,86,90) {B5}

{Settings Octave 6}
declare const $LayerNr_08 := 10 {C6 to C7 one extra not
e!!!}
declare %Layer_dB_Cor_08[$LayerNr_08*14] := (...
17, 28, 40, 52, 64, 76, 88, 100,112,127, {Layer Upper Borders}...
1200,100,400,200,400,100,550,300,100,050, {C}...
1200,100,400,200,400,100,550,300,100,050, {C#}...
1200,300,400,200,400,200,500,300,100,100, {D}...
1200,300,400,200,400,200,500,300,100,100, {D#}...
1200,300,400,200,200,100,650,300,100,100, {E}...
1200,400,400,200,200,150,550,300,150,150, {F}...
1200,400,400,200,200,150,550,300,150,150, {F#}...
1200,600,300,050,200,150,400,150,050,200, {G}...
1200,600,300,050,200,150,400,150,050,200, {G#}...
1200,500,400,200,200,200,500,150,100,250, {A}...
1200,500,400,200,200,200,500,150,100,250, {Bb}...
1200,200,350,200,200,300,400,150,100,250, {B}...
1200,450,200,250,400,100,500,200,100,200) {C extra Note!!!!!!!}
declare %Layer_LP_Cor_08[$LayerNr_08*13] := (...
10, 99, 62, 70, 66, 78, 76,85,86,90, {C6}...
10, 99, 62, 70, 66, 78, 76,85,86,90, {C#6}...
10, 99, 62, 70, 64, 74, 76,85,86,90, {D6}...
10, 99, 62, 70, 64, 74, 76,85,86,90, {D#6}...
10, 75, 60, 70, 64, 72, 76,85,86,92, {E6}...
10, 75, 62, 70, 68, 73, 80,90,90,90, {F6}...
10, 75, 62, 70, 68, 73, 80,90,90,90, {F#6}...
10, 99, 66, 70, 67, 72, 80,85,86,86, {G6}...
10, 99, 66, 70, 67, 72, 80,85,86,86, {G#6}...
10, 66, 66, 70, 69, 72, 80,85,88,90, {A6}...
10, 66, 66, 70, 69, 72, 80,85,88,90, {Bb6}...
10, 62, 62, 70, 71, 72, 80,85,86,86, {B6}...
10, 60, 62, 70, 72, 72, 76,99,88,86) {C7 extra Note !!!!}
{-------------------------------}
{--- Custom stretched tuning ---}
{-------------------------------}
declare %stretched[128] := (...
00000, 00000, 00000, 00000, 00000, 00000, 00000, 00000, 00000, 00000, 00000, 0
0000, {C-2 to B-2}...
00000, 00000, 00000, 00000, 00000, 00000, 00000, 00000, 00000, 00000, 00000,-6
5000, {C-1 to B-1}...
-46000,-46000,-34000,-34000,-46000,-29000,-30000,-29000,-30000,-33000,-27000,-2
3000, {C0 to B0}...
-17000,-18000,-18000,-18000,-16000,-20000,-19000,-15000,-15000,-13000,-13000,-1
4000, {C1 to B1}...
-10000,-10000,-13000,-15000,-11000,-17000,-17000,-14000,-14000,-16000,-13000,-0
9000, {C2 to B2}...
-11000,-12000,-13000,-14000,-12000,-17000,-18000,-11000,-11000,-11000,-13000,-1
0000, {C3 to B3}...
-10000,-11000,-13000,-14000,-12000,-12000,-11000,-12000,-17000,-12000,-13000,-1
1000, {C4 to B4}...
-15000,-15000,-14000,-10000,-13000,-11000,-11000,-05000,-08000,-03000,-01000,-0
8000, {C5 to B5}...
-06000,-05000, 14000, 14000, 07000, 22000, 18000, 42000, 45000, 43000, 41000, 5
5000, 95000) {C6 to C7}

{-----------------------------------------------------------------------------
----}
{------------------------ Instrument independant declarations ----------------
----}
{-----------------------------------------------------------------------------
----}
{These settings are the same for every instrument...}
{------------------------------}
{--- Max. number of voices ----}
{------------------------------}
{These variables define the max. number of voices.
The scripts fades out the softest samples in each
group if the max number is exceeded.}
declare $Sustain_Max_Voices
declare $Release_Max_Voices
declare $DryTone_Max_Voices
$Sustain_Max_Voices := 8
$Release_Max_Voices := 5
$DryTone_Max_Voices := 50
declare $Release_Velocity_Min
declare $Sustain_Velocity_Min
$Release_Velocity_Min := 5
$Sustain_Velocity_Min := 5
{------------------------------}
{--- Declare Pedal MIDI Contr.-}
{------------------------------}
declare const $SUSTAIN_CC := 64
declare const $SOSTENUTO_CC := 66
declare const $UNA_CORDA_CC := 67 {= Damper pedal...}
declare const $UNA_CORDA_FILTER := 600000{Damper pedal LP value )
{------------------------------}
{--- Declare (Micro)-Tunings --}
{------------------------------}
{The following arrays define the pitch adjustments in microcent for all
12 halftones for each tuning: C,C#,D,D#,E,F,F#,G,G#,A,A#,B
To add a new tuning add a new array to the list and insert another
CASE in the Note On script section.}
{There is also an instrument dependant custom stretched tuning!}

declare %Equal[12] := (0,0,0,0,0,0,0,0,0,0,0,0)


declare %Pure[12] := (0,29328,3910,15641,-13686,-1955,-31283,19
55,13686,-15641,17596,-11731)
declare %Overtone_16_32[12] := (0,4955,3910,-2487,-13686,-29219,-48682,1955,40
528,5865,-31174,-11731)
declare %PythagMid[12] := (0,-9775,3910,-5865,7820,-1955,0,1955,-7820
,5865,-3910,9775)
declare %MeanTone14[12] := (0,-23950,-6843,10265,-13686,3422,-20529,-34
22,-27372,-10265,6843,-17108)
declare %WerckmeisterIII[12]:= (0,-9775,-7820,-5865,-9775,-1955,-11730,-3910,-
7820,-11730,-3910,-7820)
declare %KirnbergerIII[12] := (0,-9775,-6843,-5865,-13686,-1955,-11730,-3421,
-7820,-10264,-3910,-11731)
declare %Valotti[12] := (0,-5865,-3910,-1955,-7820,1955,-7820,-1955,-
3910,-5865,0,-9775)
declare %Young[12] := (0,-9775,-3910,-5865,-7820,-1955,-11730,-19
55,-7820,-5865,-3910,-9775)
declare $basic_tone := 0

{------------------------------}
{------ Rumble Filter ---------}
{------------------------------}
declare %Rumble_HP_Filter[128] := (...
000,000,000,000,000,000,000,000,000,000,000,000, {C-2 to B-2}...
000,000,000,000,000,000,000,000,000,000,000,000, {C-1 to B-1}...
000,000,000,000,000,000,000,000,000,000,000,000, {C0 to B0}...
009,009,009,009,010,010,011,011,012,012,013,013, {C1 to B1}...
014,014,015,015,016,016,017,017,018,018,019,019, {C2 to B2}...
020,020,020,020,021,021,021,021,022,022,022,022, {C3 to B3}...
023,023,023,023,024,024,024,024,025,025,025,025, {C4 to B4}...
026,026,027,027,028,028,029,029,030,030,031,031, {C5 to B5}...
032,032,033,033,034,034,035,035,036,036,037,037, {C6 to B6}...
038,000,000,000,000,000,000,000,000,000,000,000, {C7 to B7}...
000,000,000,000,000,000,000,000) {C8 to G8}

{------------------------------}
{---- Declare Note Length -----}
{------------------------------}
{This array contains the note length
in seconds after which the loudness
is 0.
10 = 1 sec.
It's used in the script to calculate/
guess the current loudness of playing
samples.}
declare %Note_Length[128] := (...
000,000,000,000,000,000,000,000,000,000,000,000, {C-2 to B-2}...
350,350,350,350,350,350,350,350,350,350,350,350, {C-1 to B-1}...
350,350,350,350,350,350,350,350,350,350,350,350, {C0 to B0}...
346,342,338,334,330,326,322,318,314,310,306,300, {C1 to B1}...
300,296,292,288,284,280,276,272,268,264,260,250, {C2 to B2}...
246,242,238,234,230,226,222,218,214,210,206,204, {C3 to B3}...
200,196,192,188,184,180,176,172,168,164,160,150, {C4 to B4}...
146,142,138,134,130,126,122,118,114,110,106,104, {C5 to B5}...
100,096,092,088,084,080,076,072,068,064,060,050, {C6 to B6}...
050,050,050,050,050,050,050,050,050,050,050,050, {C7 to B7}...
050,050,050,050,050,050,050,050) {C8 to G8}
declare %Note_Length_for_Release_Trigger[128] := (...
000,000,000,000,000,000,000,000,000,000,000,000, {C-2 to B-2}...
300,300,300,300,300,300,300,300,300,300,300,300, {C-1 to B-1}...
300,300,299,298,297,296,295,294,293,292,291,290, {C0 to B0}...
260,260,250,250,240,240,230,230,220,220,210,210, {C1 to B1}...
210,210,209,208,207,206,205,204,203,202,201,200, {C2 to B2}...
200,200,190,190,180,170,160,150,140,130,120,110, {C3 to B3}...
100,090,090,080,080,070,070,070,060,060,060,050, {C4 to B4}...
050,050,050,050,050,050,050,050,050,050,050,050, {C5 to B5}...
050,050,050,050,050,050,050,050,050,050,050,050, {C6 to B6}...
050,050,050,050,050,050,050,050,050,050,050,050, {C7 to B7}...
050,050,050,050,050,050,050,050) {C8 to G8}

declare %Note_Length_for_Sustain_Trigger[128] := (...


000,000,000,000,000,000,000,000,000,000,000,000, {C-2 to B-2}...
120,120,120,120,120,120,120,120,120,120,120,120, {C-1 to B-1}...
120,120,119,118,117,116,115,114,113,112,111,110, {C0 to B0}...
109,108,107,106,105,105,104,103,102,101,100,100, {C1 to B1}...
099,098,097,096,095,095,095,094,093,092,091,090, {C2 to B2}...
090,090,090,090,090,090,090,090,090,090,090,090, {C3 to B3}...
080,080,080,080,070,070,060,060,060,060,060,060, {C4 to B4}...
060,060,056,054,052,050,048,046,044,042,040,038, {C5 to B5}...
038,038,036,034,032,030,028,026,024,022,020,015, {C6 to B6}...
010,000,000,000,000,000,000,000,000,000,000,000, {C7 to B7}...
000,000,000,000,000,000,000,000) {C8 to G8}

{------------------------------}
{--- Volume_Adjustment --------}
{------------------------------}
{These values adjust the value of all pitches.}
declare %Volume_Adjustment [128]
declare %Volume_AdjustmentBassBoost1 [128] := (...
000,000,000,000,000,000,000,000,000,000,000,000, {C-2 to B-2}...
000,000,000,000,000,000,000,000,000,000,000,000, {C-1 to B-1}...
000,000,000,000,000,000,000,000,000,000,000,000, {C0 to B0}...
000,000,000,000,000,000,000,000,000,000,000,000, {C1 to B1}...
000,000,000,000,000,000,000,000,000,000,000,000, {C2 to B2}...
000,000,000,000,000,000,000,000,000,000,000,000, {C3 to B3}...
000,000,000,000,000,000,000,000,000,000,000,000, {C4 to B4}...
000,000,000,000,000,000,000,000,000,000,000,000, {C5 to B5}...
000,000,000,000,000,000,000,000,000,000,000,000, {C6 to B6}...
000,000,000,000,000,000,000,000,000,000,000,000, {C7 to B7}...
000,000,000,000,000,000,000,000) {C8 to G8}
declare %Volume_AdjustmentBassBoost2 [128] := (...
250,250,250,250,250,250,250,250,250,250,250,250, {C-2 to B-2}...
250,250,250,250,250,250,250,250,250,250,250,250, {C-1 to B-1}...
250,250,250,250,250,250,250,250,250,250,250,250, {C0 to B0}...
250,250,250,250,250,250,250,250,250,250,250,250, {C1 to B1}...
200,200,200,200,200,200,200,200,200,200,200,200, {C2 to B2}...
100,100,100,100,100,100,100,000,000,000,000,000, {C3 to B3}...
000,000,000,000,000,000,000,000,000,000,000,000, {C4 to B4}...
000,000,000,000,000,000,000,000,000,000,000,000, {C5 to B5}...
000,000,000,000,000,000,000,000,000,000,000,000, {C6 to B6}...
000,000,000,000,000,000,000,000,000,000,000,000, {C7 to B7}...
000,000,000,000,000,000,000,000) {C8 to G8}
declare %Volume_AdjustmentBassBoost3 [128] := (...
400,400,400,400,400,400,400,400,400,400,400,400, {C-2 to B-2}...
400,400,400,400,400,400,400,400,400,400,400,400, {C-1 to B-1}...
400,400,400,400,400,400,400,400,400,400,400,400, {C0 to B0}...
400,400,400,400,400,400,400,400,400,400,400,400, {C1 to B1}...
300,300,300,300,300,300,300,300,300,300,300,300, {C2 to B2}...
200,200,200,200,200,100,100,100,100,100,100,100, {C3 to B3}...
000,000,000,000,000,000,000,000,000,000,000,000, {C4 to B4}...
000,000,000,000,000,000,000,000,000,000,000,000, {C5 to B5}...
000,000,000,000,000,000,000,000,000,000,000,000, {C6 to B6}...
000,000,000,000,000,000,000,000,000,000,000,000, {C7 to B7}...
000,000,000,000,000,000,000,000) {C8 to G8}

{------------------------------}
{--------- Others ------------}
{------------------------------}

declare ui_button $Play_Dry_Tones


declare ui_button $Play_Key_Noise
declare ui_button $Play_Release
declare ui_button $Play_Sustain
declare ui_button $Delete_Rumble
declare ui_button $dB_Smooth
declare ui_button $LP_Smooth

declare ui_menu $Performance


add_menu_item($Performance,"15 Voices", 0)
add_menu_item($Performance,"20 Voices", 1)
add_menu_item($Performance,"25 Voices", 2)
add_menu_item($Performance,"30 Voices", 3)
add_menu_item($Performance,"40 Voices", 4)
add_menu_item($Performance,"50 Voices", 5)
add_menu_item($Performance,"75 Voices", 6)
add_menu_item($Performance,"100 Voices", 7)
add_menu_item($Performance,"150 Voices", 8)
$Performance:=5
declare ui_menu $Bass
add_menu_item($Bass,"Soft",0)
add_menu_item($Bass,"Medium",1)
add_menu_item($Bass,"Strong",2)

{The Values equal the dB increase above and the


decreas below MIDI velocity 64. 1000 = 1dB}
declare ui_menu $Dynamic
add_menu_item($Dynamic,"+3", 11000)
add_menu_item($Dynamic,"+2", 7000)
add_menu_item($Dynamic,"+1", 4000)
add_menu_item($Dynamic,"Neutral",0)
add_menu_item($Dynamic,"-1",- 4000)
add_menu_item($Dynamic,"-2",- 7000)
add_menu_item($Dynamic,"-3",-11000)
declare ui_label $LabelLid(1,1)
declare ui_label $LabelKeyNoise(1,1)
declare ui_label $LabelResonance(1,1)
declare ui_label $LabelDynamic(1,1)
declare ui_label $LabelPedalNoise(1,1)
declare ui_label $LabelResonance_Release(1,1)
declare ui_label $dBSmoothing(2,1)
declare ui_label $dBDynamicAdjustement(1,1)
declare ui_label $Display_Dry_Tones(1,1)
declare ui_label $LabelBass(1,1)
set_text($LabelResonance,"Sustain Reso")
set_text($LabelResonance_Release,"Release Reso")
set_text($LabelPedalNoise,"Pedal Noise")
set_text($LabelDynamic,"dB Dynamic")
set_text($LabelKeyNoise,"Key Noise")
set_text($LabelLid,"Lid")
set_text($dBSmoothing," --- ")
set_text($dBDynamicAdjustement,"---")
set_text($Display_Dry_Tones,"")
set_text($LabelBass,"Bass")
move_control ($LabelResonance, 0,0)
move_control ($Resonance, 0,0)
move_control ($LabelResonance_Release, 0,0)
move_control ($Resonance_Release, 0,0)
move_control ($LabelKeyNoise, 0,0)
move_control ($KeyNoise, 0,0)
move_control ($LabelPedalNoise, 0,0)
move_control ($PedalNoise, 0,0)
move_control ($LabelLid, 0,0)
move_control ($LabelDynamic, 0,0)
move_control ($Dynamic, 0,0)
move_control ($Play_Dry_Tones, 0,0)
move_control ($Play_Key_Noise, 0,0)
move_control ($Play_Release, 0,0)
move_control ($Play_Sustain, 0,0)
move_control ($Delete_Rumble, 0,0)
move_control ($dB_Smooth,0,0)
move_control ($LP_Smooth,0,0)
move_control ($dBSmoothing,0,0)
move_control ($dBDynamicAdjustement,0,0)
move_control ($Performance,0,0)
move_control ($Display_Dry_Tones,0,0)
move_control ($Bass,0,0)
move_control ($LabelBass,0,0)

$Dynamic := 0
$Play_Dry_Tones := 1
$Play_Key_Noise := 1
$Play_Release := 1
$Play_Sustain := 1
$dB_smooth := 1
$LP_smooth := 1
$Delete_Rumble := 1

{------------------------------}
{---- Internal Variables ------}
{------------------------------}
declare $KeyNoiseVelo
declare $PedalNoise_ID
declare $LayerNr
declare $quarter_tone
declare const $ROOT := 60
declare $a {allgemeine Variable}
declare $b
declare $c
declare polyphonic $v
declare polyphonic $w
declare polyphonic $x {allgemeine Variable fuer Note On Sachen...}
declare polyphonic $y {allgemeine Variable fuer Sustain Script...}
declare polyphonic $z {allgemeine Variable...}
declare polyphonic $Trigger_New_Sustain_Sample
declare $Sustain_Pedal {Diese Variable zeigt den Zusatand des Sustain Pedals}
declare $Sustain_Pedal_End_Time {Timestamp of the last Sustain Release Time}
declare $Sostenuto_Pedal
declare polyphonic $DryTone_ID {die ID des trockenen Samples}
declare polyphonic $KeyNoise_ID {die ID des Key Noise Samples}
declare polyphonic $Release_ID {die ID des Key Noise Samples}
declare polyphonic $Sustain_ID {die ID des Sustain Samples}
declare polyphonic $Sustain_Note_Playing {Status = wenn 1 spielt ein Sustainsa
mple}
declare polyphonic $note_begin
declare polyphonic $vol_change
declare polyphonic $old_event_note
declare polyphonic $SkipRelease
declare polyphonic $Sustain_Killer_Candidate_Pitch := 0
declare polyphonic $Sustain_Killer_Candidate_Loudness := 127
declare %Last_Sustain_ID[128] {enthaelt die IDs, der aktiven Sustain Samples}
declare %Last_Sustain_Begin[128]
declare %Last_Sustain_Velocity[128]
declare %Last_DryTone_ID[128] {enthaelt die IDs, der aktiven DryTone Samples}
declare %Last_DryTone_Begin[128]
declare %Last_DryTone_Velocity[128]
declare $Active_Dry_Tones
$Active_Dry_Tones:=0
declare $Active_Dry_Tones_Softest_Velocity:=130
declare polyphonic $Waited_one_loop
declare polyphonic $Release_Killer_Candidate_Pitch := 0
declare polyphonic $Release_Killer_Candidate_Loudness := 127
declare polyphonic $Change_Note
declare polyphonic $Change_Tune
declare polyphonic $DryTone_Note
declare polyphonic $LPSmooth_Cutoff {the correct LP cutoff settings of the cu
rrent voice}
declare %Last_Release_ID[128] {enthaelt die IDs, der aktiven Release Samples}
declare %Last_Release_Begin[128]
declare %Last_Release_Velocity[128]
declare %tune[128] {current tuning }
declare $pedal_Noise_Helper
declare $Duration
declare $Tuning
declare %sostenuto[128]
make_persistent(%tune)
make_persistent($tuning)
make_persistent($Play_Dry_Tones)
make_persistent($Play_Key_Noise)
make_persistent($Play_Release)
make_persistent($Play_Sustain)
make_persistent($Dynamic)
make_persistent($Performance)
make_persistent($dB_Smooth)
make_persistent($LP_Smooth)
make_persistent ($Bass)
make_persistent($Sustain_Max_Voices)
make_persistent($Release_Max_Voices)
make_persistent($DryTone_Max_Voices)
make_persistent($quarter_tone)
make_persistent(%Volume_Adjustment) {Bass Adjustment}
declare polyphonic $vol_change_sustain
declare polyphonic $Repedal_ID {die ID des Sustain Samples in release}
declare polyphonic $Play_repedal
declare %Last_Repedal_ID[128]

declare $original_tune
declare $original_pan
declare $original_vol
declare polyphonic $check_id
{Control Help}
set_control_help($resrel_instr,"Release Resonance: Activates the
release resonance samples.")
set_control_help($noise_instr,"Noise: Adjusts the volume of the
piano action as a key is released, plus the volume of the pedal mechanism, thus
creating a more realistic sound.")
set_control_help($susres_instr,"Sustain Resonance: Controls the
sustain sample resonance and release sample volume.")
set_control_help($eq,"Sound: Jumps through 10 preset EQ settings
.")
set_control_help($comp_fx,"Comp: Turns the compressor on and off
.")
set_control_help($stereo_fx,"Stereo: Controls the width of the
stereo field. Extreme left is mono, while the middle is the sound as originally
recorded and right is artificially expanded.")
set_control_help($chorus_fx,"Chorus: Sets the send level of the
chorus effect.")
set_control_help($delay_fx,"Delay: Sets the send level of the de
lay effect.")
set_control_help($rev_bandfx, "Reverb: Displays the controls for
the reverb effect.")
set_control_help($cab_bandfx, "Cabinet: Displays the controls fo
r the cabinet effect.")
set_control_help($eq_bandfx, "EQ: Displays the controls for the
master equalizer.")
set_control_help($rev_onoff_bandfx, "Reverb On/Off: Turns the re
verb effect on or off.")
set_control_help($cab_onoff_bandfx, "Cabinet On/Off: Turns the c
abinet effect on or off.")
set_control_help($eq_onoff_bandfx, "EQ On/Off: Turns the master
equalizer on or off.")
set_control_help($rev_amount_bandfx, "Reverb Amount: Sets the se
nd level of the reverb effect.")
set_control_help($category_reverb, "Reverb IR Category: Select a
category from which you can choose a specific impulse response from the second
dropdown menu.")
set_control_help($hall_reverb, "Concert Hall: Impulse responses
in this category are capured from real spaces and represent a variety of large p
erformance spaces.")
set_control_help($cathedral_reverb, "Cathedral: A mix of real an
d modelled spaces that offer large and dense reverb tails.")
set_control_help($club_reverb, "Club: Impulse responses in this
category are capured from real spaces and represent a variety of small performan
ce spaces.")
set_control_help($room_reverb, "Room: Impulse responses in this
category are capured from real spaces and cover a variety of smaller rooms.")
set_control_help($l300_reverb, "L300: Impulse responses taken fr
om the classic studio digital reverb.")
set_control_help($plate_reverb, "Plate: Impulse responses from c
lassic plate reverb effect units.")
set_control_help($quadstick_reverb, "Quadstick: Impulse response
s taken from the classic studio digital reverb.")
set_control_help($brt7_reverb, "BRT 7: Impulse responses taken f
rom the classic studio digital reverb.")
set_control_help($cabinet_reverb, "Cabinet: Impulse responses of
several cabinet types.")
set_control_help($cab_air_bandfx,"Air: Controls the volume of th
e early reflections in the room response, adding space to the sound.")
set_control_help($cab_type_bandfx,"Type: Selects the type of cab
inet that is simulated.")
set_control_help($eq_lo_bandfx, "Low EQ Gain: Controls the gain
of the master output's lower frequencies.")
set_control_help($eq_mid_bandfx, "Mid EQ Gain: Controls the gain
of the master output's mid frequencies.")
set_control_help($eq_hi_bandfx, "High EQ Gain: Controls the gain
of the master output's higher frequencies.")
if ($CREATE_AUTOMATION_ID = 1)

set_control_par(get_ui_id($resrel_instr),$CONTROL_PAR_AUTOMATION
_ID,17)
set_control_par(get_ui_id($noise_instr),$CONTROL_PAR_AUTOMATION_
ID,18)
set_control_par(get_ui_id($susres_instr),$CONTROL_PAR_AUTOMATION
_ID,19)
set_control_par(get_ui_id($eq),$CONTROL_PAR_AUTOMATION_ID,0)
set_control_par(get_ui_id($comp_fx),$CONTROL_PAR_AUTOMATION_ID,8
)
set_control_par(get_ui_id($stereo_fx),$CONTROL_PAR_AUTOMATION_ID
,1)
set_control_par(get_ui_id($chorus_fx),$CONTROL_PAR_AUTOMATION_ID
,2)
set_control_par(get_ui_id($delay_fx),$CONTROL_PAR_AUTOMATION_ID,
3)

set_control_par(get_ui_id($rev_onoff_bandfx),$CONTROL_PAR_AUTOMA
TION_ID,12)
set_control_par(get_ui_id($cab_onoff_bandfx),$CONTROL_PAR_AUTOMA
TION_ID,13)
set_control_par(get_ui_id($eq_onoff_bandfx),$CONTROL_PAR_AUTOMAT
ION_ID,14)
set_control_par(get_ui_id($rev_amount_bandfx),$CONTROL_PAR_AUTOM
ATION_ID,4)
set_control_par(get_ui_id($cab_air_bandfx),$CONTROL_PAR_AUTOMATI
ON_ID,5)
set_control_par(get_ui_id($eq_lo_bandfx),$CONTROL_PAR_AUTOMATION
_ID,6)
set_control_par(get_ui_id($eq_mid_bandfx),$CONTROL_PAR_AUTOMATIO
N_ID,16)
set_control_par(get_ui_id($eq_hi_bandfx),$CONTROL_PAR_AUTOMATION
_ID,7)
end if

end on

on note
$check_id := $EVENT_ID
$original_vol := get_event_par($EVENT_ID,$EVENT_PAR_VOLUME)
$original_tune := get_event_par($EVENT_ID,$EVENT_PAR_TUNE)
$original_pan := get_event_par($EVENT_ID,$EVENT_PAR_PAN)
$note_begin := $ENGINE_UPTIME {= Startime of Event}
$Sustain_Note_Playing := 0
$play_repedal := 0
{---------------------------------}
{Calculate tuning/note adjustments}
{---------------------------------}
if ($quarter_tone = 1)
{Adjust the tuning special case of *quarter tone* tuning.}
if (($EVENT_NOTE - $Root) mod 2 = 0) {no detuning}
$Change_Note := (($EVENT_NOTE - $Root) / 2) + $Root
$Change_Tune := 0
else
if ($EVENT_NOTE > $Root)
$Change_Note := (($EVENT_NOTE - $Root) / 2) + $Root + 1
$Change_Tune := -50000
end if
if ($EVENT_NOTE < $Root)
$Change_Note := (($EVENT_NOTE - $Root) / 2) + $Root - 1
$Change_Tune := 50000
end if
end if
else
{All other tunings are looked up in the tune array which is
filled by the controller script.}
$Change_Note := $EVENT_NOTE
$Change_Tune := %tune[$EVENT_NOTE]
end if
change_note ($EVENT_ID, $Change_Note) {Only required for quarter tone tuning.}
ignore_event($EVENT_ID) {Ignore the original event}
{------------PART I -----------}
{------- Play Dry Tone --------}
{------------------------------}
{This part triggers the dry tone an takes care of the correct tuning.
The dB velocity smoothing and the lowpass group insert filter settings are
also controlled in this part.}
$Active_Dry_Tones := $Active_Dry_Tones +1
set_text($Display_Dry_Tones, "Voices: " & $Active_Dry_Tones)
{--------------------}
{Trigger new dry tone}
{--------------------}
{Play dry tone only if GUI button is active}
if ($Play_Dry_Tones = 1)

{----------------------------------------------}
{Lookup dB Smoothing ($x) and LP-Smoothing ($z)}
{----------------------------------------------}
$a := 0
$b := 0
$x := 0
$z := 0
{calculate the LP Smooth and dB Smooth depending in the $EVENT_NOTE and $EVEN
T_VELOCITY and the arrays above}
{This is pretty long SELECT CASE Code which looks up the appropriate dB-Smoot
h and LP-Smooth
Value in the arrays. This code is neccesary because arrays are limited t
o max. 512 values}
select ($EVENT_NOTE)
{----------------------------------}
{----- Event Note = Octave -1 -----}
{----------------------------------}
case 12 to 23
while($a < $LayerNr_01)
if (%Layer_dB_Cor_01[$a] >= $EVENT_VELOCITY)
if ($a > 0)
$x := (%Layer_dB_Cor_01[$a + $LayerNr_01*(($EVENT_NOTE - 12)+1)]*...
(%Layer_dB_Cor_01[$a] - $EVENT_VELOCITY))/(%Layer_dB_Cor_01[$a] - %La
yer_dB_Cor_01[$a-1]-1)
$z := ((100 - %Layer_LP_Cor_01[$a + $LayerNr_01*(($EVENT_NOTE - 12))]
)*...
(%Layer_dB_Cor_01[$a] - $EVENT_VELOCITY))/(%Layer_dB_Cor_01[$a] - %La
yer_dB_Cor_01[$a-1]-1)
else
$x := (%Layer_dB_Cor_01[$a + $LayerNr_01*(($EVENT_NOTE - 12)+1)]*...
(%Layer_dB_Cor_01[$a] - $EVENT_VELOCITY))/(%Layer_dB_Cor_01[$a] - 1)
$z := ((100 - %Layer_LP_Cor_01[$a + $LayerNr_01*(($EVENT_NOTE - 12))]
)*...
(%Layer_dB_Cor_01[$a] - $EVENT_VELOCITY))/(%Layer_dB_Cor_01[$a] - 1)
end if
$b := $a
$a := $LayerNr_01
end if
inc($a)
end while
{----------------------------------}
{----- Event Note = Octave 0 -----}
{----------------------------------}
case 24 to 35
while($a < $LayerNr_02)
if (%Layer_dB_Cor_02[$a] >= $EVENT_VELOCITY)
if ($a > 0)
$x := (%Layer_dB_Cor_02[$a + $LayerNr_02*(($EVENT_NOTE - 24)+1)]*...
(%Layer_dB_Cor_02[$a] - $EVENT_VELOCITY))/(%Layer_dB_Cor_02[$a] - %La
yer_dB_Cor_02[$a-1]-1)
$z := ((100 - %Layer_LP_Cor_02[$a + $LayerNr_02*(($EVENT_NOTE - 24))]
)*...
(%Layer_dB_Cor_02[$a] - $EVENT_VELOCITY))/(%Layer_dB_Cor_02[$a] - %La
yer_dB_Cor_02[$a-1]-1)
else
$x := (%Layer_dB_Cor_02[$a + $LayerNr_02*(($EVENT_NOTE - 24)+1)]*...
(%Layer_dB_Cor_02[$a] - $EVENT_VELOCITY))/(%Layer_dB_Cor_02[$a] - 1)
$z := ((100 - %Layer_LP_Cor_02[$a + $LayerNr_02*(($EVENT_NOTE - 24))]
)*...
(%Layer_dB_Cor_02[$a] - $EVENT_VELOCITY))/(%Layer_dB_Cor_02[$a] - 1)
end if
$b := $a
$a := $LayerNr_02
end if
inc($a)
end while
{----------------------------------}
{----- Event Note = Octave 1 -----}
{----------------------------------}
case 36 to 47
while($a < $LayerNr_03)
if (%Layer_dB_Cor_03[$a] >= $EVENT_VELOCITY)
if ($a > 0)
$x := (%Layer_dB_Cor_03[$a + $LayerNr_03*(($EVENT_NOTE - 36)+1)]*...
(%Layer_dB_Cor_03[$a] - $EVENT_VELOCITY))/(%Layer_dB_Cor_03[$a] - %La
yer_dB_Cor_03[$a-1]-1)
$z := ((100 - %Layer_LP_Cor_03[$a + $LayerNr_03*(($EVENT_NOTE - 36))]
)*...
(%Layer_dB_Cor_03[$a] - $EVENT_VELOCITY))/(%Layer_dB_Cor_03[$a] - %La
yer_dB_Cor_03[$a-1]-1)
else
$x := (%Layer_dB_Cor_03[$a + $LayerNr_03*(($EVENT_NOTE - 36)+1)]*...
(%Layer_dB_Cor_03[$a] - $EVENT_VELOCITY))/(%Layer_dB_Cor_03[$a] - 1)
$z := ((100 - %Layer_LP_Cor_03[$a + $LayerNr_03*(($EVENT_NOTE - 36))]
)*...
(%Layer_dB_Cor_03[$a] - $EVENT_VELOCITY))/(%Layer_dB_Cor_03[$a] - 1)
end if
$b := $a
$a := $LayerNr_03
end if
inc($a)
end while
{----------------------------------}
{----- Event Note = Octave 2 -----}
{----------------------------------}
case 48 to 59
while($a < $LayerNr_04)
if (%Layer_dB_Cor_04[$a] >= $EVENT_VELOCITY)
if ($a > 0)
$x := (%Layer_dB_Cor_04[$a + $LayerNr_04*(($EVENT_NOTE - 48)+1)]*...
(%Layer_dB_Cor_04[$a] - $EVENT_VELOCITY))/(%Layer_dB_Cor_04[$a] - %La
yer_dB_Cor_04[$a-1]-1)
$z := ((100 - %Layer_LP_Cor_04[$a + $LayerNr_04*(($EVENT_NOTE - 48))]
)*...
(%Layer_dB_Cor_04[$a] - $EVENT_VELOCITY))/(%Layer_dB_Cor_04[$a] - %La
yer_dB_Cor_04[$a-1]-1)
else
$x := (%Layer_dB_Cor_04[$a + $LayerNr_04*(($EVENT_NOTE - 48)+1)]*...
(%Layer_dB_Cor_04[$a] - $EVENT_VELOCITY))/(%Layer_dB_Cor_04[$a] - 1)
$z := ((100 - %Layer_LP_Cor_04[$a + $LayerNr_04*(($EVENT_NOTE - 48))]
)*...
(%Layer_dB_Cor_04[$a] - $EVENT_VELOCITY))/(%Layer_dB_Cor_04[$a] - 1)
end if
$b := $a
$a := $LayerNr_04
end if
inc($a)
end while
{----------------------------------}
{----- Event Note = Octave 3 -----}
{----------------------------------}
case 60 to 71
while($a < $LayerNr_05)
if (%Layer_dB_Cor_05[$a] >= $EVENT_VELOCITY)
if ($a > 0)
$x := (%Layer_dB_Cor_05[$a + $LayerNr_05*(($EVENT_NOTE - 60)+1)]*...
(%Layer_dB_Cor_05[$a] - $EVENT_VELOCITY))/(%Layer_dB_Cor_05[$a] - %La
yer_dB_Cor_05[$a-1]-1)
$z := ((100 - %Layer_LP_Cor_05[$a + $LayerNr_05*(($EVENT_NOTE - 60))]
)*...
(%Layer_dB_Cor_05[$a] - $EVENT_VELOCITY))/(%Layer_dB_Cor_05[$a] - %La
yer_dB_Cor_05[$a-1]-1)
else
$x := (%Layer_dB_Cor_05[$a + $LayerNr_05*(($EVENT_NOTE - 60)+1)]*...
(%Layer_dB_Cor_05[$a] - $EVENT_VELOCITY))/(%Layer_dB_Cor_05[$a] - 1)
$z := ((100 - %Layer_LP_Cor_05[$a + $LayerNr_05*(($EVENT_NOTE - 60))]
)*...
(%Layer_dB_Cor_05[$a] - $EVENT_VELOCITY))/(%Layer_dB_Cor_05[$a] - 1)
end if
$b := $a
$a := $LayerNr_05
end if
inc($a)
end while
{----------------------------------}
{----- Event Note = Octave 4 -----}
{----------------------------------}
case 72 to 83
while($a < $LayerNr_06)
if (%Layer_dB_Cor_06[$a] >= $EVENT_VELOCITY)
if ($a > 0)
$x := (%Layer_dB_Cor_06[$a + $LayerNr_06*(($EVENT_NOTE - 72)+1)]*...
(%Layer_dB_Cor_06[$a] - $EVENT_VELOCITY))/(%Layer_dB_Cor_06[$a] - %La
yer_dB_Cor_06[$a-1]-1)
$z := ((100 - %Layer_LP_Cor_06[$a + $LayerNr_06*(($EVENT_NOTE - 72))]
)*...
(%Layer_dB_Cor_06[$a] - $EVENT_VELOCITY))/(%Layer_dB_Cor_06[$a] - %La
yer_dB_Cor_06[$a-1]-1)
else
$x := (%Layer_dB_Cor_06[$a + $LayerNr_06*(($EVENT_NOTE - 72)+1)]*...
(%Layer_dB_Cor_06[$a] - $EVENT_VELOCITY))/(%Layer_dB_Cor_06[$a] - 1)
$z := ((100 - %Layer_LP_Cor_06[$a + $LayerNr_06*(($EVENT_NOTE - 72))]
)*...
(%Layer_dB_Cor_06[$a] - $EVENT_VELOCITY))/(%Layer_dB_Cor_06[$a] - 1)
end if
$b := $a
$a := $LayerNr_06
end if
inc($a)
end while
{----------------------------------}
{----- Event Note = Octave 5 -----}
{----------------------------------}
case 84 to 95
while($a < $LayerNr_07)
if (%Layer_dB_Cor_07[$a] >= $EVENT_VELOCITY)
if ($a > 0)
$x := (%Layer_dB_Cor_07[$a + $LayerNr_07*(($EVENT_NOTE - 84)+1)]*...
(%Layer_dB_Cor_07[$a] - $EVENT_VELOCITY))/(%Layer_dB_Cor_07[$a] - %La
yer_dB_Cor_07[$a-1]-1)
$z := ((100 - %Layer_LP_Cor_07[$a + $LayerNr_07*(($EVENT_NOTE - 84))]
)*...
(%Layer_dB_Cor_07[$a] - $EVENT_VELOCITY))/(%Layer_dB_Cor_07[$a] - %La
yer_dB_Cor_07[$a-1]-1)
else
$x := (%Layer_dB_Cor_07[$a + $LayerNr_07*(($EVENT_NOTE - 84)+1)]*...
(%Layer_dB_Cor_07[$a] - $EVENT_VELOCITY))/(%Layer_dB_Cor_07[$a] - 1)
$z := ((100 - %Layer_LP_Cor_07[$a + $LayerNr_07*(($EVENT_NOTE - 84))]
)*...
(%Layer_dB_Cor_07[$a] - $EVENT_VELOCITY))/(%Layer_dB_Cor_07[$a] - 1)
end if
$b := $a
$a := $LayerNr_07
end if
inc($a)
end while
{----------------------------------}
{----- Event Note = Octave 6 + C7 -}
{----------------------------------}
case 96 to 108
while($a < $LayerNr_08)
if (%Layer_dB_Cor_08[$a] >= $EVENT_VELOCITY)
if ($a > 0)
$x := (%Layer_dB_Cor_08[$a + $LayerNr_08*(($EVENT_NOTE -96 )+1)]*...
(%Layer_dB_Cor_08[$a] - $EVENT_VELOCITY))/(%Layer_dB_Cor_08[$a] - %La
yer_dB_Cor_08[$a-1]-1)
$z := ((100 - %Layer_LP_Cor_08[$a + $LayerNr_08*(($EVENT_NOTE -96 ))]
)*...
(%Layer_dB_Cor_08[$a] - $EVENT_VELOCITY))/(%Layer_dB_Cor_08[$a] - %La
yer_dB_Cor_08[$a-1]-1)
else
$x := (%Layer_dB_Cor_08[$a + $LayerNr_08*(($EVENT_NOTE - 96)+1)]
*...
(%Layer_dB_Cor_08[$a] - $EVENT_VELOCITY))/(%Layer_dB_Cor_08[$a]
- 1)
$z := ((100 - %Layer_LP_Cor_08[$a + $LayerNr_08*(($EVENT_NOTE -
96))])*...
(%Layer_dB_Cor_08[$a] - $EVENT_VELOCITY))/(%Layer_dB_Cor_08[$a]
- 1)
end if
$b := $a
$a := $LayerNr_08
end if
inc($a)
end while
end select {$b = Layer, $x = dB Adjustment, $z = LP Adjustment}
$z := 100-$z
{Display the adjustements in text box}
set_text($dBSmoothing,"V=" & $EVENT_VELOCITY & " L=" & $b & " dB=" & $x & " L
P=" & $z)

{----------------------------------}
{----- Adjust volume --------------}
{----------------------------------}
{--- dB-Smoothing adjustment ---}
if ($dB_Smooth = 1) {Adjust only if GUI button is active}
$vol_change := $x*(-10)
else
$vol_change := 0
end if

{--- dB Dynamic Range GUI Knob adjustment ---}


{Look up the dB increase/decrease in the GUI selector
and adjust the volume...}
$x:= ($Dynamic * ($EVENT_VELOCITY - 64)) /64
set_text($dBDynamicAdjustement, $x/10)
$vol_change := $vol_change + $x
{--- Lookup volume adjustment per pitch ---}
$vol_change := $vol_change + %Volume_Adjustment[$EVENT_NOTE]*10

{----------------------------------}
{----- Change LP Cutoff -----------}
{----------------------------------}

{Adjust the LP cutoff in the correct dry tone group.}


$x:= ($EVENT_NOTE -24)*$DryTone_Group_Increase + $DryTone_Group_ID_C0
$LPSmooth_Cutoff := $z

{--------------------}
{Trigger new dry tone}
{--------------------}
{Allow the correct dry tone group.}
disallow_group($ALL_GROUPS)
allow_group(5)
$DryTone_ID :=play_note($EVENT_NOTE,$EVENT_VELOCITY,0,0)
change_pan($DryTone_ID,$original_pan,1)
{------ Append new ID to array ------}
%Last_DryTone_ID[$EVENT_NOTE] := $DryTone_ID
%Last_DryTone_Begin[$EVENT_NOTE] := $ENGINE_UPTIME
%Last_DryTone_Velocity[$EVENT_NOTE] := $EVENT_VELOCITY
{--------------------}
{Change/Adjust Tuning}
{--------------------}
change_tune ($DryTone_ID, $Change_Tune+$original_tune,0)
{----------------------------------}
{----- change volume --------------}
{----------------------------------}
change_vol($DryTone_ID,$vol_change + $original_vol,0)
end if { If Play Dry Tones GUI button is pressed.}
{------------PART II-----------}
{--- Loop while key is down ---}
{-- Trigger sustain samples ---}
{------------------------------}

{Reduce the overall volume according to the GUI knob.


max -18db Reduction}
$vol_change := -180 * (100-$Resonance)
$vol_change := $vol_change + ($Dynamic * ($EVENT_VELOCITY - 64)) /64
{--- Lookup volume adjustment per pitch ---}
$vol_change := $vol_change + %Volume_Adjustment[$EVENT_NOTE]*10
$vol_change_sustain := $vol_change {to be used "in repedal in release
" section}
{This part waits/loops until the key is released.
During the loop sustain effect samples are triggered
if the sustain pedal is triggered.
This scripts starts/triggers multiple sustain effect samples
if the sustain pedal is repressed several times.
Note: The stop and fadeout of the sustain effect samples is
controlled by the sustain controller script and not by this
note on script. This script adds all new sustain sample ids
to an array which is is used by the sustain controller script
to fade out the samples when the sustain pedal is released.}
while($NOTE_HELD = 1 )
$Duration := ($ENGINE_UPTIME - $note_begin )/1000 {calculate the played time
in seconds}
{Continue only if GUI knob and button are active.}
if($Resonance > 0 and $Play_Sustain = 1)
if($Sustain_Pedal = 0) {Check if the sustain pedal is triggered}
{If no, reset the variable so that the next new sustain pedal down
triggers the play sustain code.}
$Sustain_Note_Playing := 0
else
{If yes, run the sustain effect sample trigger code}
if($Sustain_Note_Playing = 0)
{Continue only if it's a new pedal event.}
{Set to 1 so it triggers only time per pedal down event.}
$Sustain_Note_Playing := 1
{---------------------------------------}
{-- Calculate sustain trigger velocity -}
{---------------------------------------}
$x:= ($ENGINE_UPTIME - $note_begin )/100 {Note Duration 10 = 1 sec}
if ($x>%Note_Length_for_Sustain_Trigger[$EVENT_NOTE]) {Look up note le
ngth and limit the value.}
$x:=%Note_Length_for_Sustain_Trigger[$EVENT_NOTE]
end if
$x := $EVENT_VELOCITY*(%Note_Length_for_Sustain_Trigger[$EVENT_NOTE]-$
x)
$x := $x / %Note_Length_for_Sustain_Trigger[$EVENT_NOTE]
{--------------------------------------}
{ Decide if you play new sustain or not}
{--------------------------------------}
{Trigger new sustain samples only if it's currently "louder"
than the last active sustain sample with the same pitch.}
if (%Last_Sustain_ID[$EVENT_NOTE] = 0) {If there is no active sustain
sample before trigger new one}
$Trigger_New_Sustain_Sample := 1
else
{Compare the new sustain sample with the old one and
decide whether to play the new one and fade out the old one
or whether to skip the new sustain samples because it's
softer.}
{Calculate a time/duration factor to guess the current loudness
of the last sustain sample.}
$y:= ($ENGINE_UPTIME - %Last_Sustain_Begin[$EVENT_NOTE])/100
if ($y>300) {All samples older than 30 sec reduce current vel. t
o 0}
$y:=300
end if
{Calculate the current loudness of the last sample}
$y := %Last_Sustain_Velocity[$EVENT_NOTE]*(100-$y)
$y := $y / 100
if ($x +10 > $y) {Trigger new sample if new vel +10 > old vel *
duration factor}
{-----------------------------------------------}
{ Yes,trigger new sustain & fade out old sustain}
{-----------------------------------------------}
$Trigger_New_Sustain_Sample := 1
{Fade out old sustain sample over linear 0.3 sec}
fade_out(%Last_Sustain_ID[$EVENT_NOTE],300000,1)
end if
end if
{-----------------------------------------}
{--Max. number of sustain voices reached?-}
{-- Yes -> kill softest sustain sample ---}
{-----------------------------------------}
{This code counts the active sustain voices and
finds the currently softest sample ID which is
faded out if the max number of voices is succeeded.}
$z:=$Lowest_Key
$w:=0
$Sustain_Killer_Candidate_Pitch := 0
$Sustain_Killer_Candidate_Loudness := 127
while ($z<=$Highest_Key) {Go through all keys}
if (%Last_Sustain_ID[$z] # 0)
$w := $w+1 {Increase the active voice counter}
{Calculate current sample loudness $v= vel * time factor}
$v:= ($ENGINE_UPTIME - %Last_Sustain_Begin[$z])/100
if ($v>200) {All samples older than 20 sec reduce current vel.
to 0}
$v:=200
end if
$v := %Last_Sustain_Velocity[$z]*(200-$v)
$v := $v / 200
if ($v< $Sustain_Killer_Candidate_Loudness)
$Sustain_Killer_Candidate_Pitch := $z
$Sustain_Killer_Candidate_Loudness := $v
end if
end if
$z := $z+1
end while
{----- Max voices reached? ----}
if ($w >= $Sustain_Max_Voices )
fade_out(%Last_Sustain_ID[$Sustain_Killer_Candidate_Pitch],3000
00,1)
%Last_Sustain_ID[$Sustain_Killer_Candidate_Pitch] := 0 {Delete
from array.}

end if
{----------------------------------}
{-- Fade in new sustain sample ----}
{----------------------------------}
{Trigger only if vel. > defined minimum and decision is positive.}

if ($x > $Sustain_Velocity_Min and $Trigger_New_Sustain_Sample = 1)


disallow_group($ALL_GROUPS)
allow_group(find_group("Sustain"))
$Sustain_ID := play_note($EVENT_NOTE,$x,0,0)
change_pan($Sustain_ID,$original_pan,1)
set_event_mark($Sustain_ID, $MARK_2) {group all $Sustain samples in $
Mark2)
{If it's triggered together with the dry tone otherwise
fade in over 1.2 sec..}
if (($ENGINE_UPTIME - $note_begin )/10=0)
{Fade-in the sample over 10ms}
fade_in($Sustain_ID,10000)
else
{Fade-in the sample over 0.7 sec}
fade_in($Sustain_ID,1000000)
end if

change_vol($Sustain_ID,$vol_change_sustain + $original_vol,0)
change_tune ($Sustain_ID, $Change_Tune + $original_tune,0)
{----------------------------------}
{------ Append ID to array ------}
{----------------------------------}
{The sustain controller code will stop/fadeout
the sustain samples according to this array.}
%Last_Sustain_ID[$EVENT_NOTE] := $Sustain_ID
%Last_Sustain_Begin[$EVENT_NOTE] := $ENGINE_UPTIME
%Last_Sustain_Velocity[$EVENT_NOTE] := $x
end if{($x > $Sustain_Velocity_Min)}
end if {($Sustain_Note_Playing = 0 and $Duration <= $Sustain_Seconds_Ma
x)}
end if {($Sustain_Pedal = 0)}
end if {($Resonance > 0)}
wait(10000) {Wait to save cpu performance.}
end while

{-----------------------------PART III -----------------------}


{---------------------------Key is released ------------------}
{- the script Trigger key noise samples in release callback --}
{-------------------------------------------------------------}
{ part moved in on "release callback" to avoid Kontakt2 visual keyboard bug}

{-----------------PART IV -----------------}
{------ Wait until sustain,sostenuto ------}
{-------release or key retrigger ----------}
{------------------------------------------}
{This part waits as long the dry should still continue.
To save voices this loop aborts in special cases.}
while((($Sustain_Pedal = 1 or %sostenuto[$EVENT_NOTE] = 1 or ...
$EVENT_NOTE>=$First_Undamped_Pitch or %KEY_DOWN[$EVENT_NOTE]=1).
..
and $SkipRelease=0))...
wait(10000)
if ($LP_smooth = 1 and %CC[$UNA_CORDA_CC] < 64) {UNA_CORDA 0 to 63}
{-------------------------------------------}
{-- Check/Correct LP Cutoff Settings -------}
{-------------------------------------------}
{Check LP Filter settings and readjust the filter cutoff to make sure, that
the "brightest" currently playing sample in the same pitch group has got
the correct filter settings.}
{Lookup correct pitch group ID.}
$x:= ($EVENT_NOTE -24)*$DryTone_Group_Increase + $DryTone_Group_ID_C0
{
if (_get_engine_par($ENGINE_PAR_CUTOFF,$x, 3, 0) < $LPSmooth_Cutoff*10000)
_set_engine_par($ENGINE_PAR_CUTOFF, $LPSmooth_Cutoff*10000, $x, 3, 0)
end if
}
end if
{-------------------------------------------}
{-- Stop if there is a louder retrigger ----}
{-------------------------------------------}
if (%Last_DryTone_ID[$EVENT_NOTE] # $DryTone_ID)
{--- Calculate current loudness of event sample ---}
$v:= ($ENGINE_UPTIME - $note_begin )/100 {Note Duration 10 = 1 sec}
if ($v>%Note_Length[$EVENT_NOTE]) {Look up note length and limit the va
lue.}
$v:=%Note_Length[$EVENT_NOTE]
end if
$v := $EVENT_VELOCITY*(%Note_Length[$EVENT_NOTE]-$v)
$v := $v / %Note_Length[$EVENT_NOTE]
{Compare the new note with the old one}
if ($v < %Last_DryTone_Velocity[$EVENT_NOTE] + 10)
$SkipRelease := 1 {Stop the loop and fade out event sample without re
lease trigger}
$w := 200000
end if
end if
{-------------------------------------------}
{--- Stop if the note length is reached ----}
{-------------------------------------------}
if (($ENGINE_UPTIME - $note_begin)/100 > %Note_Length[$EVENT_NOTE])
$SkipRelease:=1 {Stop sample and skip release trigger if note end has
been reached.
In combination with the while conditi
on this keeps track of the
undamped strings.}
$w := 1000
end if
{-------------------------------------------}
{-- Stop if max voices is reached and if ---}
{----it's the softest note... --------------}
{-------------------------------------------}
if ($Active_Dry_Tones > $DryTone_Max_Voices)
{--- Calculate current loudness of event sample ---}
$v:= ($ENGINE_UPTIME - $note_begin )/100 {Note Duration 10 = 1 sec}
if ($v>%Note_Length[$EVENT_NOTE]) {Look up note length and limit the va
lue.}
$v:=%Note_Length[$EVENT_NOTE]
end if
$v := $EVENT_VELOCITY*(%Note_Length[$EVENT_NOTE]-$v)
$v := $v / %Note_Length[$EVENT_NOTE]
if ($v <= $Active_Dry_Tones_Softest_Velocity)
$Active_Dry_Tones_Softest_Velocity := $v
if ($Waited_one_loop = 1)
$SkipRelease:=1
$Active_Dry_Tones_Softest_Velocity := 130
$Waited_one_loop := 0
$w := 300000
else
$Waited_one_loop := 1
end if
else
$Waited_one_loop := 0
end if
end if
end while
{--------------PART V ---------------}
{-- Trigger/Fade in release sample --}
{--------- Fade out dry Tone --------}
{------------------------------------}
{-- Trigger/Fade in release sample is moved "on release" callback to avoid --}
{--visual keyboard bug in kontakt }

{----------------------------------}
{------- Fade out dry tone -------}
{----------------------------------}
{Finish the dry tone with a 10 step fade out.
The total fade out time and the fade out curve preset
are looked up in arrays.}
{---- Look up fade out time -----}
$x:= %fade_out_time[$EVENT_NOTE]*$FADE_OUT_TIME_FACTOR
{Avoid errors by setting the minimum fade out time to 1ms}
if ($x < 1000)
$x := 1000
end if
{---- Look up fadeout type -----}
$y := %fade_out_type[$EVENT_NOTE]
{Avoid errors by setting wrong curve numbers to 0}
if ($y<0 or $y>$FADE_OUT_CURVE_NUMBERS-1)
$y := 0
end if
{-----------------------------------------------------------------------------
----------}
{----- scan potential $repedal_id $event here to avoid bad $EVENT_NOTE in the
loop -----}
{------for $repedal_id and repedal enhanced effect----------------------------
----------}
{-----------------------------------------------------------------------------
----------}
{----------------------------------}
{----- 10 steps fade out loop -----}
{----------------------------------}
if ($SkipRelease=0)
$z := 1
while($z <11)
{Calculate fade out time of next "sub-fade"}
$w := (($x/10) * %Fade_Out_Presets[$y*11 + $z - 1])/...
(%Fade_Out_Presets[$y*11 + $z - 1] - %Fade_Out_Presets[$y*11 +
$z])
fade_out($DryTone_ID,$w,1) {replace last fade out with new one}
wait($x/10) {Wait 1/10 of the total fade out time}

{--------------------------------}
{--- Repedal sustain effect -----}
{--------------------------------}
{trigger wet samples for repedal in release - enhanced version by Olivier F.
{and Interrupt the fade out loop if the sustain pedal is retriggered
during the Fade Out loop.}
{The fadeout will only be delayed if: Sustain Pedal = 1 and
no skip release flag is set and less than 7 steps have been processed.}
if ($Sustain_Pedal=1 and $SkipRelease=0 and $z<7 and...
($ENGINE_UPTIME - $note_begin)/100 < %Note_Length[$EVENT_NOTE])

if ($play_repedal = 0 and $Resonance > 0 and $Play_Sustain = 1...


and $EVENT_VELOCITY > $Sustain_Velocity_Min )
if ($Active_Dry_Tones >= $Sustain_Max_Voices)
fade_out(%Last_Repedal_ID[$Sustain_Killer_Candidate_Pitch],10000,1)
end if
{trigger just one time repedal_id samples}
disallow_group($ALL_GROUPS)
allow_group(find_group("Sustain"))
fade_out(%Last_Repedal_ID[$EVENT_NOTE],10000,1)
$Repedal_ID := play_note($EVENT_NOTE,$EVENT_VELOCITY,...
(($ENGINE_UPTIME - $note_begin)*1000),0)
{the repedal depend on note_lenth too !}
change_pan ($Repedal_ID,$original_pan,1)
change_tune ($Repedal_ID, $Change_Tune+$original_tune,0)
fade_in($Repedal_ID,30000)
change_vol($Repedal_ID,$vol_change_sustain-12000,0){sustain_vol -12db}
%Last_Repedal_ID[$EVENT_NOTE] := $Repedal_ID
{Repedal_voices management use Release voices management in the release
section}
end if
if ($play_repedal = 1) {for repedal in repedal effect !}
fade_out($Repedal_ID,100000000,1)
end if
$play_repedal := 1 {play repedal just one time in the fade out loop !}
while ($Sustain_Pedal=1 and $SkipRelease=0 and $z<7 and...
($ENGINE_UPTIME - $note_begin)/100 < %Note_Length[$EVENT_NOTE])

wait (10000) {Wait to save cpu recources}


end while

end if
inc($z)
fade_out($Repedal_ID,$w,1)
end while
else
{If $SkipRelease = 1 fade out depend of kind of Skiprelease !...}
fade_out($DryTone_ID,$w,1) {$w := 1000 if note_length is reached, $w := 20000
0 if...
repeated key, $x is 3
00000 is max voices.reached}
end if

$Active_Dry_Tones:= $Active_Dry_Tones-1
set_text($Display_Dry_Tones, "Voices: " & $Active_Dry_Tones)
if (%Last_DryTone_ID[$EVENT_NOTE] = $DryTone_ID)
%Last_DryTone_ID[$EVENT_NOTE] := 0
end if

end on

{-------------------------------------------------------------------}
{-------------------------------------------------------------------}

on controller
{---------------------------------------}
{------------ Sustain Pedal ------------}
{-Play noise & fade out sustain samples-}
{---------------------------------------}
if ($CC_NUM = $SUSTAIN_CC) {Continue if the defined sustain controller changed
...}
if (%CC[64]>63) {Pedal is pressed down case 64 to 127}
if ($Sustain_Pedal=0) {Continue if it's new pedal down event}
$Sustain_Pedal := 1 {Set to 1 so it only triggers once per pedal down.}
if ($pedalnoise > 0) {trigger pedal noise only if GUI knob is active}
{----------------------------------}
{-----Trigger pedal down noise-----}
{----------------------------------}
$PedalNoise_ID := play_note(0,100,0,0) {Trigger Pitch=0, Velocity = 10
0}
change_pan($PedalNoise_ID,$original_pan,1)
{Adjust the volume according to the GUI knob.
max -25db Reduction}
$a := -250 * (100-$PedalNoise)
change_vol($PedalNoise_ID,$a,0)
end if
end if {($Sustain_Pedal=0)}
else {Pedal is pressed up case 0 to 63}

if ($Sustain_Pedal=1) {Continue if it's new pedal up event}


$Sustain_Pedal := 0 {Set to 0 so it only triggers once per pedal up.}
$Sustain_Pedal_End_Time := $ENGINE_UPTIME {Set the Sustain Up Time Stam
p}
if ($pedalnoise > 0) {trigger pedal noise only if GUI knob is active}
{----------------------------------}
{-----Trigger pedal up noise ------}
{----------------------------------}
$PedalNoise_ID := play_note(1,100,0,0) {Trigger Pitch=1, Velocity = 10
0}
change_pan($PedalNoise_ID,$original_pan,1)
{Adjust the volume according to the GUI knob.
max -25db Reduction}
$a := -250 * (100-$PedalNoise)
change_vol($PedalNoise_ID,$a,0)
{fade_out all sustain samples, that are in the virtual group $MARK_2}
fade_out(by_marks($MARK_2),200000,1)
end if
end if
end if
end if {Sustain Controller...}

{---------------- Sostenuto Controller -----------}


if ($CC_NUM = $SOSTENUTO_CC)
if (%CC[$SOSTENUTO_CC] # 0 and $quarter_tone = 0)
$a := 0
while($a < 128)
%sostenuto[$a] := %KEY_DOWN[$a] {save the curre
ntly pressed notes}
inc($a)
end while
else
$a := 0
while($a < 128)
%sostenuto[$a] := 0
inc($a)
end while
end if
end if

{---------------- Tuning Changes -----------}


if ($CC_NUM = 87) {copy the selected tuning into the %tune array}
$quarter_tone := 0
select (%CC[87])
case 0
$a := 0
while($a < 128)
%tune[$a] := 0
inc($a)
end while
case 1
$a := 0
while($a < 128)
%tune[$a] := %stretched[$a]
inc($a)
end while
case 10
$a := 0
while($a < 128)
%tune[$a] := %Pure[($a + 12 - $basic_to
ne) mod 12]
inc($a)
end while
case 11
$a := 0
while($a < 128)
%tune[$a] := %Overtone_16_32[($a + 12 -
$basic_tone) mod 12]
inc($a)
end while
case 12
$a := 0
while($a < 128)
%tune[$a] := %PythagMid[($a + 12 - $bas
ic_tone) mod 12]
inc($a)
end while
case 13
$a := 0
while($a < 128)
%tune[$a] := %MeanTone14[($a + 12 - $ba
sic_tone) mod 12]
inc($a)
end while
case 14
$a := 0
while($a < 128)
%tune[$a] := %WerckmeisterIII[($a + 12
- $basic_tone) mod 12]
inc($a)
end while
case 15
$a := 0
while($a < 128)
%tune[$a] := %KirnbergerIII[($a + 12 -
$basic_tone) mod 12]
inc($a)
end while
case 16
$a := 0
while($a < 128)
%tune[$a] := %Valotti[($a + 12 - $basic
_tone) mod 12]
inc($a)
end while
case 17
$a := 0
while($a < 128)
%tune[$a] := %Young[($a + 12 - $basic_t
one) mod 12]
inc($a)
end while
case 18
$a := 0
while($a < 128)
%tune[$a] := 0
inc($a)
end while
$quarter_tone := 1
end select
ignore_controller
end if
end on

{---------Delete Rumble -----------}


on ui_control ($Delete_Rumble)
$a:=$Lowest_Key
if ($Delete_Rumble = 1)
while ($a<=$Highest_Key)
{Select the correct dry tone group per pitch.}
$b:= ($a-24)*$DryTone_Group_Increase + $DryTone_Group_ID_C0

_set_engine_par($ENGINE_PAR_EFFECT_BYPASS, 0, $b, 4, -1)

{Adjust the HP Cutoff in this group.}


_set_engine_par($ENGINE_PAR_CUTOFF, %Rumble_HP_Filter[$a]*10000, $b, 4, 0)
$a:=$a+1
end while
else
while ($a<=$Highest_Key)
{Select the correct dry tone group per pitch.}
$b:= ($a-24)*$DryTone_Group_Increase + $DryTone_Group_ID_C0
_set_engine_par($ENGINE_PAR_EFFECT_BYPASS, 1, $b, 4, -1)
{Adjust the HP Cutoff in this group.}
_set_engine_par($ENGINE_PAR_CUTOFF, 0, $b, 4, 0)
$a:=$a+1
end while

end if
end on

{-------- Performance/Voice Menu -----------}


on ui_control ($Performance)
select($Performance)
case(0) {15 Voices}
$Sustain_Max_Voices := 5
$Release_Max_Voices := 5
$DryTone_Max_Voices := 15
$Release_Velocity_Min := 5
$Sustain_Velocity_Min := 5
case(1) {20 Voices}
$Sustain_Max_Voices := 5
$Release_Max_Voices := 5
$DryTone_Max_Voices := 20
$Release_Velocity_Min := 5
$Sustain_Velocity_Min := 5
case(2) {25 Voices}
$Sustain_Max_Voices := 5
$Release_Max_Voices := 5
$DryTone_Max_Voices := 25
$Release_Velocity_Min := 5
$Sustain_Velocity_Min := 5
case(3) {30 Voices}
$Sustain_Max_Voices := 8
$Release_Max_Voices := 5
$DryTone_Max_Voices := 30
$Release_Velocity_Min := 5
$Sustain_Velocity_Min := 5
case(4) {40 Voices}
$Sustain_Max_Voices := 8
$Release_Max_Voices := 5
$DryTone_Max_Voices := 40
$Release_Velocity_Min := 5
$Sustain_Velocity_Min := 5
case(5) {50 Voices}
$Sustain_Max_Voices := 8
$Release_Max_Voices := 5
$DryTone_Max_Voices := 50
$Release_Velocity_Min := 5
$Sustain_Velocity_Min := 5
case(6) {75 Voices}
$Sustain_Max_Voices := 10
$Release_Max_Voices := 5
$DryTone_Max_Voices := 75
$Release_Velocity_Min := 5
$Sustain_Velocity_Min := 5
case(7) {100 Voices}
$Sustain_Max_Voices := 10
$Release_Max_Voices := 5
$DryTone_Max_Voices := 100
$Release_Velocity_Min := 5
$Sustain_Velocity_Min := 5
case(8) {150 Voices}
$Sustain_Max_Voices := 10
$Release_Max_Voices := 5
$DryTone_Max_Voices := 150
$Release_Velocity_Min := 5
$Sustain_Velocity_Min := 5

end select
end on

{-------- Bass Volume Adjustment -----------}


on ui_control ($Bass)
{Reset Volume Adjustment array.}
$a := 0
while($a < 128)
%Volume_Adjustment[$a] := 0
inc($a)
end while
select($Bass)
case (0) {Soft Bass}
$a := 0
while($a < 128)
%Volume_Adjustment[$a] := %Volume_AdjustmentBassBoost1 [$a]
inc($a)
end while
case (1) {Medium Bass}
$a := 0
while($a < 128)
%Volume_Adjustment[$a] := %Volume_AdjustmentBassBoost2 [$a]
inc($a)
end while
case (2) {Strong Bass}
$a := 0
while($a < 128)
%Volume_Adjustment[$a] := %Volume_AdjustmentBassBoost3 [$a]
inc($a)
end while

end select
end on
on release

if($EVENT_ID # $check_id)
exit
end if
{-----------------------------PART III -----------------------}
{---------------------------Key is released ------------------}
{- the script Trigger key noise samples in release callback --}
{-------------------------------------------------------------}
{This parts triggers the key noise sample.
Please note that the dry tone and the sustain samples
are still playing...
KONTAKT and most of the master keyboards can't handle release
velocity properly, so there is no way to include it
in the script.
Due to this limitation the key noise velocity is more or less
a fixed value with a small influence of note on velocity and
note duration.}
{Continue if GUI knob and button are active.}
if ($KeyNoise>0 and $Play_Key_Noise = 1)
{----------------------------------}
{-- Trigger key noise sample ------}
{----------------------------------}
disallow_group($ALL_GROUPS)
allow_group(find_group("Key Noise"))
$KeyNoise_ID := play_note($EVENT_NOTE,100,0,0)
change_pan ($KeyNoise_ID,$original_pan,1)
{Velocity doesn't matter because there is no volume modulation.}
{Reduce the overall volume according to the GUI knob.
max -25db Reduction}
$vol_change := -250 * (100-$KeyNoise)
{Reduce the volume by another max. 3dB depending
on the note on velocity.}
$x := -30 * (100-(($EVENT_VELOCITY*100)/127))
$vol_change := $vol_change + $x
{Reduce the volume further depending on the
note duration. 10 sec = -6dB, 5 sec = -3 dB}
$x := -60 * ((100*(($ENGINE_UPTIME - $note_begin )/1000))/10)
$vol_change := $vol_change + $x
change_vol($KeyNoise_ID,$vol_change,0)
end if

{--------------PART V ---------------}
{-- Trigger/Fade in release sample --}
{------------------------------------}
{------------------------------------}
{-- Trigger/Fade in release sample is moved "on release" callback to avoid --}
{--visual kayboard bug in kontakt }
{Trigger the release sample only if GUI knob and button are active.
Skip the release sample trigger if the variable is 1.}
if($Resonance_Release>0 and $Play_Release=1 and $SkipRelease=0 and...
$Sustain_Pedal # 1 and %sostenuto[$EVENT_NOTE] # 1 and $EVENT_NOTE<=$Fi
rst_Undamped_Pitch)
{------------------------------------------}
{- Calculate new release trigger velocity -}
{------------------------------------------}
{Look up the note length in the array and calculate
the correct release trigger velocity at the current time.
Note on Velocity * Factor = Release trigger velocity
E.g. if the array value is 60 after 6 sec the factor is 0, after
3 seconds the factor is 0.5}
$x:= ($ENGINE_UPTIME - $note_begin )/100 {Note Duration 10 = 1 sec}
if ($x>%Note_Length_for_Release_Trigger[$EVENT_NOTE]) {Look up note length an
d limit the value.}
$x:=%Note_Length_for_Release_Trigger[$EVENT_NOTE]
end if
$x := $EVENT_VELOCITY*(%Note_Length_for_Release_Trigger[$EVENT_NOTE]-$x)
$x := $x / %Note_Length_for_Release_Trigger[$EVENT_NOTE]
{----------------------------------------}
{- How many release samples are active? -}
{- Find softest Velocity and Sample ID. -}
{----------------------------------------}
$z:=$Lowest_Key
$w:=0
$Release_Killer_Candidate_Pitch := 0
$Release_Killer_Candidate_Loudness := 127
while ($z<=$First_Undamped_Pitch) {Go through all keys}
if (%Last_Release_ID[$z] # 0)
{Calculate current sample loudness $v= vel * time factor}
$v:= ($ENGINE_UPTIME - %Last_Release_Begin[$z])/100
if ($v>50) {All samples older than 5 sec reduce current vel. to 0}
$v:=50
end if
$v := %Last_Release_Velocity[$z]*(50-$v)
$v := $v / 50
if ($v>10) {Voice is still active}
$w := $w+1 {Increase the active voice counter}
if ($v< $Release_Killer_Candidate_Loudness)
$Release_Killer_Candidate_Pitch := $z
$Release_Killer_Candidate_Loudness := $v
end if
end if
end if
$z := $z+1
end while
{------------------------------------------}
{-- If max. number is reached decide to ---}
{-- cancel trigger or fade out softest ID -}
{------------------------------------------}
if ($w >= $Release_Max_Voices)
if ($x < $Release_Killer_Candidate_Loudness)
{---- Ignore new sample because it's the softest ----}
$x := 0
else
{---- Else fade out killer candidate linear 10 ms ----}
fade_out(%Last_Release_ID[$Release_Killer_Candidate_Pitch],10000,1)
%Last_Release_ID[$Release_Killer_Candidate_Pitch] := 0 {Delete from a
rray.}
end if
end if

{------------------------------------}
{-- If vel < same pitch predecessor--}
{--------cancel new trigger. --------}
{------------------------------------}
$v:= ($ENGINE_UPTIME - %Last_Release_Begin[$EVENT_NOTE])/100
if ($v>50) {All samples older than 5 sec reduce current vel. to 0}
$v:=50
end if
$v := %Last_Release_Velocity[$EVENT_NOTE]*(50-$v)
$v := $v / 50
if ($x < $v)
$x:=0 {Ignore new release sample}
else
fade_out(%Last_Release_ID[$EVENT_NOTE],10000,1) {10 ms fade out.}

end if

if ($x > $Release_Velocity_Min) {Trigger release sample only if vel. > define
d minimum}
{------------------------------------------}
{-- Trigger/Fade in new release sample ----}
{------------------------------------------}
disallow_group($ALL_GROUPS)
allow_group(find_group("Release"))
$Release_ID := play_note($EVENT_NOTE,$x,0,0)
change_pan($Release_ID,$original_pan,1)
{Fade-in the sample over 30ms}
fade_in($Release_ID,30000)

{Reduce the overall volume according to the GUI knob. max -25db Reductio
n}
$vol_change := -100*$Resonance_Release
{Adjust the volume according to the dB Dynamic Range GUI Knob}
$vol_change := $vol_change + ($Dynamic * ($EVENT_VELOCITY - 64)) /64
{--- Lookup volume adjustment per pitch ---}
$vol_change := $vol_change + %Volume_Adjustment[$EVENT_NOTE]*10
{Reduce the volume further depending on the
note duration}
if ( ( -120 * ( (100*($ENGINE_UPTIME - $note_begin )/10000)) ) > -4500) {limi
t}
$vol_change := $vol_change + ( -120 * ( (100*($ENGINE_UPTIME - $note_begin )/
10000)) )
else
$vol_change := $vol_change - 4500
end if
change_vol($Release_ID,$vol_change,0)
{----------------------------------}
{------ Tune release sample ------}
{----------------------------------}
change_tune ($Release_ID, $Change_Tune+$original_tune,0)
{----------------------------------}
{------ Append ID to array ------}
{----------------------------------}
{The array is used for the max voices.}
%Last_Release_ID[$EVENT_NOTE] := $Release_ID
%Last_Release_Begin[$EVENT_NOTE] := $ENGINE_UPTIME
%Last_Release_Velocity[$EVENT_NOTE] := $x

end if{($x > $Release_Velocity_Min)}


end if {the big one ;-)...}

end on
{*** CONTROL GROUP "INSTR" UI_CONTROL CALLBACKS}
on ui_control ($susres_instr)
$Resonance := $susres_instr
set_control_par_str(get_ui_id($susres_instr),$CONTROL_PAR_LABEL,$susres_
instr & " %")
end on
on ui_control ($noise_instr)
$keynoise := $noise_instr
$pedalnoise := $noise_instr
set_control_par_str(get_ui_id($noise_instr),$CONTROL_PAR_LABEL,$noise_in
str & " %")
end on
on ui_control ($resrel_instr)
$resonance_release := $resrel_instr * 40
end on
on ui_control ($EQ)
_set_engine_par ($ENGINE_PAR_FREQ1,%EQ_Data[$EQ*9],-1,$eq_slot,1)
_set_engine_par ($ENGINE_PAR_BW1,%EQ_Data[$EQ*9+1],-1,$eq_slot,1)
_set_engine_par ($ENGINE_PAR_GAIN1,%EQ_Data[$EQ*9+2],-1,$eq_slot,1)
_set_engine_par ($ENGINE_PAR_FREQ2,%EQ_Data[$EQ*9+3],-1,$eq_slot,1)
_set_engine_par ($ENGINE_PAR_BW2,%EQ_Data[$EQ*9+4],-1,$eq_slot,1)
_set_engine_par ($ENGINE_PAR_GAIN2,%EQ_Data[$EQ*9+5],-1,$eq_slot,1)
_set_engine_par ($ENGINE_PAR_FREQ3,%EQ_Data[$EQ*9+6],-1,$eq_slot,1)
_set_engine_par ($ENGINE_PAR_BW3,%EQ_Data[$EQ*9+7],-1,$eq_slot,1)
_set_engine_par ($ENGINE_PAR_GAIN3,%EQ_Data[$EQ*9+8],-1,$eq_slot,1)
if ($eq = 0)
set_text ($lb_eq, "OFF")
else
set_text ($lb_eq, $eq)
end if
set_control_par_str(get_ui_id($eq),$CONTROL_PAR_LABEL,$eq)
$last_time := $ENGINE_UPTIME
wait($wait_time * 1000)
if($ENGINE_UPTIME - $last_time > $wait_time -5)
set_text ($lb_eq,"SOUND")
end if
end on
{*** END CONTROL GROUP "INSTR" UI_CONTROL CALLBACKS}
{*** CONTROL GROUP "FX" UI_CONTROL CALLBACKS}
on ui_control ($comp_fx)
if ($comp_fx = 1)
_set_engine_par($ENGINE_PAR_EFFECT_BYPASS, 0, -1, $comp_slot, 1)
else
_set_engine_par($ENGINE_PAR_EFFECT_BYPASS, 1, -1, $comp_slot, 1)
end if
_set_engine_par($ENGINE_PAR_EFFECT_BYPASS, ($comp_fx + 1) mod 2, -1, $co
mp_slot, 1)
end on
on ui_control ($stereo_fx)
set_engine_par($ENGINE_PAR_STEREO, $stereo_fx, -1, $stereo_slot, 1)
set_control_par_str(get_ui_id($stereo_fx),$CONTROL_PAR_LABEL,get_engine_
par_disp($ENGINE_PAR_STEREO, -1, $stereo_slot, 1) & " %")
end on
on ui_control ($chorus_fx)
set_engine_par ($ENGINE_PAR_SEND_EFFECT_OUTPUT_GAIN, $chorus_fx, -1, $ch
orus_slot, 1)
set_control_par_str(get_ui_id($chorus_fx),$CONTROL_PAR_LABEL,get_engine_
par_disp($ENGINE_PAR_SEND_EFFECT_OUTPUT_GAIN, -1, $chorus_slot, 1) & " dB")
end on
on ui_control ($delay_fx)
set_engine_par ($ENGINE_PAR_SENDLEVEL_1, $delay_fx, -1, 7, 1)
set_control_par_str(get_ui_id($delay_fx),$CONTROL_PAR_LABEL,get_engine_p
ar_disp($ENGINE_PAR_SENDLEVEL_1, -1, 7, 1) & " dB")
end on
{*** END CONTROL GROUP "FX" UI_CONTROL CALLBACKS}
{*** CONTROL GROUP "BANDFX" UI_CONTROL CALLBACKS}
on ui_control ($rev_bandfx)
if ($rev_bandfx = 0)
$rev_bandfx := 1
else
$cab_bandfx := 0
$eq_bandfx := 0
$count := 5
while ($count < 9)
set_control_par(%bandfx_id[$count], $CONTROL_PAR_HIDE, $
HIDE_PART_BG)
set_control_par(%bandfx_id[$count+4], $CONTROL_PAR_HIDE,
$HIDE_WHOLE_CONTROL)
set_control_par(%bandfx_id[$count+8], $CONTROL_PAR_HIDE,
$HIDE_WHOLE_CONTROL)
inc($count)
end while
set_control_par(%bandfx_id[8], $CONTROL_PAR_HIDE, $HIDE_PART_NOT
HING)
set_control_par(%bandfx_id[17], $CONTROL_PAR_HIDE, $HIDE_PART_NO
THING)
set_control_par(%bandfx_id[30], $CONTROL_PAR_HIDE, $HIDE_PART_NO
THING)
set_control_par(%bandfx_id[32], $CONTROL_PAR_HIDE, $HIDE_PART_NO
THING)
set_control_par(%bandfx_id[18], $CONTROL_PAR_HIDE, $HIDE_WHOLE_C
ONTROL)
set_control_par(%bandfx_id[29], $CONTROL_PAR_HIDE, $HIDE_WHOLE_C
ONTROL)
set_control_par(%bandfx_id[19], $CONTROL_PAR_HIDE, $HIDE_WHOLE_C
ONTROL)
set_control_par(%bandfx_id[20], $CONTROL_PAR_HIDE, $HIDE_WHOLE_C
ONTROL)
set_control_par(%bandfx_id[21], $CONTROL_PAR_HIDE, $HIDE_WHOLE_C
ONTROL)
set_control_par(%bandfx_id[31], $CONTROL_PAR_HIDE, $HIDE_WHOLE_C
ONTROL)
set_control_par(%bandfx_id[0], $CONTROL_PAR_PICTURE_STATE, 0)
$count := 0
while ($count < 9)
if ($count = $category_reverb)
set_control_par(%subcat_menu_id[$count],$CONTROL
_PAR_HIDE,$HIDE_PART_NOTHING)
else
set_control_par(%subcat_menu_id[$count],$CONTROL
_PAR_HIDE,$HIDE_WHOLE_CONTROL)
end if
inc ($count)
end while
end if
end on
on ui_control ($cab_bandfx)
if ($cab_bandfx = 0)
$cab_bandfx := 1
else
$rev_bandfx := 0
$eq_bandfx := 0
$count := 5
while ($count < 9)
set_control_par(%bandfx_id[$count], $CONTROL_PAR_HIDE, $
HIDE_WHOLE_CONTROL)
set_control_par(%bandfx_id[$count+4], $CONTROL_PAR_HIDE,
$HIDE_PART_BG)
set_control_par(%bandfx_id[$count+8], $CONTROL_PAR_HIDE,
$HIDE_WHOLE_CONTROL)
inc($count)
end while
set_control_par(%bandfx_id[12], $CONTROL_PAR_HIDE, $HIDE_PART_NO
THING)
set_control_par(%bandfx_id[17], $CONTROL_PAR_HIDE, $HIDE_WHOLE_C
ONTROL)
set_control_par(%bandfx_id[30], $CONTROL_PAR_HIDE, $HIDE_WHOLE_C
ONTROL)
set_control_par(%bandfx_id[32], $CONTROL_PAR_HIDE, $HIDE_PART_NO
THING)
set_control_par(%bandfx_id[18], $CONTROL_PAR_HIDE, $HIDE_PART_NO
THING)
set_control_par(%bandfx_id[29], $CONTROL_PAR_HIDE, $HIDE_PART_NO
THING)
set_control_par(%bandfx_id[19], $CONTROL_PAR_HIDE, $HIDE_WHOLE_C
ONTROL)
set_control_par(%bandfx_id[20], $CONTROL_PAR_HIDE, $HIDE_WHOLE_C
ONTROL)
set_control_par(%bandfx_id[21], $CONTROL_PAR_HIDE, $HIDE_WHOLE_C
ONTROL)
set_control_par(%bandfx_id[31], $CONTROL_PAR_HIDE, $HIDE_WHOLE_C
ONTROL)
set_control_par(%bandfx_id[0], $CONTROL_PAR_PICTURE_STATE, 1)
$count := 0
while ($count < 9)
set_control_par(%subcat_menu_id[$count],$CONTROL_PAR_HID
E,$HIDE_WHOLE_CONTROL)
inc ($count)
end while
end if
end on
on ui_control ($eq_bandfx)
if ($eq_bandfx = 0)
$eq_bandfx := 1
else
$rev_bandfx := 0
$cab_bandfx := 0
$count := 5
while ($count < 9)
set_control_par(%bandfx_id[$count], $CONTROL_PAR_HIDE, $
HIDE_WHOLE_CONTROL)
set_control_par(%bandfx_id[$count+4], $CONTROL_PAR_HIDE,
$HIDE_WHOLE_CONTROL)
set_control_par(%bandfx_id[$count+8], $CONTROL_PAR_HIDE,
$HIDE_PART_BG)
inc($count)
end while
set_control_par(%bandfx_id[17], $CONTROL_PAR_HIDE, $HIDE_WHOLE_C
ONTROL)
set_control_par(%bandfx_id[30], $CONTROL_PAR_HIDE, $HIDE_WHOLE_C
ONTROL)
set_control_par(%bandfx_id[32], $CONTROL_PAR_HIDE, $HIDE_WHOLE_C
ONTROL)
set_control_par(%bandfx_id[18], $CONTROL_PAR_HIDE, $HIDE_WHOLE_C
ONTROL)
set_control_par(%bandfx_id[29], $CONTROL_PAR_HIDE, $HIDE_WHOLE_C
ONTROL)
set_control_par(%bandfx_id[19], $CONTROL_PAR_HIDE, $HIDE_PART_NO
THING)
set_control_par(%bandfx_id[20], $CONTROL_PAR_HIDE, $HIDE_PART_NO
THING)
set_control_par(%bandfx_id[21], $CONTROL_PAR_HIDE, $HIDE_PART_NO
THING)
set_control_par(%bandfx_id[31], $CONTROL_PAR_HIDE, $HIDE_PART_NO
THING)
set_control_par(%bandfx_id[0], $CONTROL_PAR_PICTURE_STATE, 2)
$count := 0
while ($count < 9)
set_control_par(%subcat_menu_id[$count],$CONTROL_PAR_HID
E,$HIDE_WHOLE_CONTROL)
inc ($count)
end while
end if
end on
{reverb functionality}
on ui_control ($rev_onoff_bandfx)
_set_engine_par($ENGINE_PAR_SEND_EFFECT_BYPASS, (($rev_onoff_bandfx + 1)
mod 2), -1, $reverb_slot, 0)
end on
on ui_control ($category_reverb)

$count := 0
while ($count < 9)
if ($count = $category_reverb)
set_control_par(%subcat_menu_id[$count],$CONTROL_PAR_HID
E,$HIDE_PART_NOTHING)
else
set_control_par(%subcat_menu_id[$count],$CONTROL_PAR_HID
E,$HIDE_WHOLE_CONTROL)
end if
inc ($count)
end while
set_control_par(get_ui_id($image_reverb),$CONTROL_PAR_PICTURE_STATE,$cat
egory_reverb)
_load_ir_sample(_get_folder($GET_FOLDER_FACTORY_DIR)&...
!ir_path[%offset_reverb[$category_reverb]+get_control_par...
(%subcat_menu_id[$category_reverb],$CONTROL_PAR_VALUE)],$reverb_slot,0)
{change 0 to 1 if reverb is on insert effect}
end on
on ui_control ($hall_reverb)
_load_ir_sample(_get_folder($GET_FOLDER_FACTORY_DIR)...
& !ir_path[$hall_reverb],$reverb_slot,0)
end on
on ui_control ($cathedral_reverb)
_load_ir_sample(_get_folder($GET_FOLDER_FACTORY_DIR)...
& !ir_path[$cathedral_reverb],$reverb_slot,0)
end on
on ui_control ($club_reverb)
_load_ir_sample(_get_folder($GET_FOLDER_FACTORY_DIR)...
& !ir_path[$club_reverb],$reverb_slot,0)
end on
on ui_control ($room_reverb)
_load_ir_sample(_get_folder($GET_FOLDER_FACTORY_DIR)...
& !ir_path[$room_reverb],$reverb_slot,0)
end on
on ui_control ($l300_reverb)
_load_ir_sample(_get_folder($GET_FOLDER_FACTORY_DIR)...
& !ir_path[$l300_reverb],$reverb_slot,0)
end on
on ui_control ($quadstick_reverb)
_load_ir_sample(_get_folder($GET_FOLDER_FACTORY_DIR)...
& !ir_path[$quadstick_reverb],$reverb_slot,0)
end on
on ui_control ($brt7_reverb)
_load_ir_sample(_get_folder($GET_FOLDER_FACTORY_DIR)...
& !ir_path[$brt7_reverb],$reverb_slot,0)
end on
on ui_control ($plate_reverb)
_load_ir_sample(_get_folder($GET_FOLDER_FACTORY_DIR)...
& !ir_path[$plate_reverb],$reverb_slot,0)
end on
on ui_control ($cabinet_reverb)
_load_ir_sample(_get_folder($GET_FOLDER_FACTORY_DIR)...
& !ir_path[$cabinet_reverb],$reverb_slot,0)
end on
on ui_control ($rev_amount_bandfx)
set_engine_par ($ENGINE_PAR_SENDLEVEL_0, $rev_amount_bandfx, -1, $sends_
slot, 1)
set_control_par_str(get_ui_id($rev_amount_bandfx),$CONTROL_PAR_LABEL,get
_engine_par_disp($ENGINE_PAR_SENDLEVEL_0, -1, $sends_slot, 1) & " dB")
end on
{cab functionality}
on ui_control ($cab_onoff_bandfx)
set_engine_par ($ENGINE_PAR_EFFECT_BYPASS, (($cab_onoff_bandfx + 1) mod
2), -1, $cab_slot, 1)
end on
on ui_control ($cab_type_bandfx)
set_engine_par($ENGINE_PAR_CABINET_TYPE, $cab_type_bandfx, -1, $cab_slot
, 1)
set_control_par(%bandfx_id[12], $CONTROL_PAR_PICTURE_STATE, $cab_type_ba
ndfx)
end on
on ui_control ($cab_air_bandfx)
set_engine_par ($ENGINE_PAR_CB_AIR,$cab_air_bandfx,-1,$cab_slot,1)
set_control_par_str(get_ui_id($cab_air_bandfx),$CONTROL_PAR_LABEL,get_en
gine_par_disp($ENGINE_PAR_CB_AIR, -1, $cab_slot, 1) & " %")
end on
{eq functionality}
on ui_control ($eq_onoff_bandfx)
set_engine_par ($ENGINE_PAR_EFFECT_BYPASS, (($eq_onoff_bandfx + 1) mod 2
), -1, $meq_slot, 1)
end on
on ui_control ($eq_lo_bandfx)
set_engine_par($ENGINE_PAR_GAIN1, $eq_lo_bandfx, -1, $meq_slot, 1)
set_control_par_str(get_ui_id($eq_lo_bandfx),$CONTROL_PAR_LABEL,get_engi
ne_par_disp($ENGINE_PAR_GAIN1, -1, $meq_slot, 1) & " dB")
end on
on ui_control ($eq_mid_bandfx)
set_engine_par($ENGINE_PAR_GAIN2, $eq_mid_bandfx, -1, $meq_slot, 1)
set_control_par_str(get_ui_id($eq_mid_bandfx),$CONTROL_PAR_LABEL,get_eng
ine_par_disp($ENGINE_PAR_GAIN2, -1, $meq_slot, 1) & " dB")
end on
on ui_control ($eq_hi_bandfx)
set_engine_par($ENGINE_PAR_GAIN3, $eq_hi_bandfx, -1, $meq_slot, 1)
set_control_par_str(get_ui_id($eq_hi_bandfx),$CONTROL_PAR_LABEL,get_engi
ne_par_disp($ENGINE_PAR_GAIN3, -1, $meq_slot, 1) & " dB")
end on
{*** END CONTROL GROUP "BANDFX" UI_CONTROL CALLBACKS}
{END OF SCRIPT}

S-ar putea să vă placă și