Script 1
Script 1
make_perfview
set_script_title("FRONT PANEL")
set_ui_height_px(350)
message("")
declare $count
declare $group_count :=1
declare $contamination_count :=1
declare $random
declare $random2
declare $newnote
declare $newnote2
declare $offset
declare $new_id
declare $old_velocity
pgs_create_key(GLITCH_ACTIVATED,1)
pgs_set_key_val(GLITCH_ACTIVATED,0,0)
declare $wave_shape_1
declare $wave_shape_2
declare $wave_shape_3
declare $coarse_pitch_1
declare $coarse_pitch_2
declare $coarse_pitch_3
declare $fine_pitch_1
declare $fine_pitch_2
declare $fine_pitch_3
declare $hpf_1
declare $hpf_2
declare $hpf_3
declare $drive_1
declare $drive_2
declare $drive_3
make_persistent ($wave_shape_1)
make_persistent ($wave_shape_2)
make_persistent ($wave_shape_3)
make_persistent ($coarse_pitch_1)
make_persistent ($coarse_pitch_2)
make_persistent ($coarse_pitch_3)
make_persistent ($fine_pitch_1)
make_persistent ($fine_pitch_2)
make_persistent ($fine_pitch_3)
make_persistent ($hpf_1)
make_persistent ($hpf_2)
make_persistent ($hpf_3)
make_persistent ($drive_1)
make_persistent ($drive_2)
make_persistent ($drive_3)
declare $attack_1
declare $attack_2
declare $attack_3
declare $decay_1
declare $decay_2
declare $decay_3
declare $sustain_1
declare $sustain_2
declare $sustain_3
declare $release_1
declare $release_2
declare $release_3
declare $amp_lfo_speed_1
declare $amp_lfo_speed_2
declare $amp_lfo_speed_3
declare $amp_lfo_depth_1
declare $amp_lfo_depth_2
declare $amp_lfo_depth_3
make_persistent ($attack_1)
make_persistent ($attack_2)
make_persistent ($attack_3)
make_persistent ($decay_1)
make_persistent ($decay_2)
make_persistent ($decay_3)
make_persistent ($sustain_1)
make_persistent ($sustain_2)
make_persistent ($sustain_3)
make_persistent ($release_1)
make_persistent ($release_2)
make_persistent ($release_3)
make_persistent ($amp_lfo_speed_1)
make_persistent ($amp_lfo_speed_2)
make_persistent ($amp_lfo_speed_3)
make_persistent ($amp_lfo_depth_1)
make_persistent ($amp_lfo_depth_2)
make_persistent ($amp_lfo_depth_3)
{=================================BLUE PANEL
CONTROLS==========================================}
{=================COARSE PITCH====================}
{=================FINE PITCH====================}
{=================HPF====================}
{=================DRIVE====================}
{==================================WAVE SELECTOR
BUTTONS=======================================}
{========================================AMP
ENVELOPE==========================================}
{========================================MIXER
BLOCK===========================================}
{=======================FILTER
SECTION=========================================================}
{====================================GLITCH
BUTTON==========================================}
{====================UPDATING THE UI on
launch==============================================}
read_persistent_var ($wave_shape_1)
read_persistent_var ($wave_shape_2)
read_persistent_var ($wave_shape_3)
read_persistent_var ($coarse_pitch_1)
read_persistent_var ($coarse_pitch_2)
read_persistent_var ($coarse_pitch_3)
read_persistent_var ($fine_pitch_1)
read_persistent_var ($fine_pitch_2)
read_persistent_var ($fine_pitch_3)
read_persistent_var ($hpf_1)
read_persistent_var ($hpf_2)
read_persistent_var ($hpf_3)
read_persistent_var ($drive_1)
read_persistent_var ($drive_2)
read_persistent_var ($drive_3)
read_persistent_var ($wave_1_active)
read_persistent_var ($wave_2_active)
read_persistent_var ($wave_3_active)
read_persistent_var ($attack_1)
read_persistent_var ($attack_2)
read_persistent_var ($attack_3)
read_persistent_var ($decay_1)
read_persistent_var ($decay_2)
read_persistent_var ($decay_3)
read_persistent_var ($sustain_1)
read_persistent_var ($sustain_2)
read_persistent_var ($sustain_3)
read_persistent_var ($release_1)
read_persistent_var ($release_2)
read_persistent_var ($release_3)
read_persistent_var ($amp_lfo_speed_1)
read_persistent_var ($amp_lfo_speed_2)
read_persistent_var ($amp_lfo_speed_3)
read_persistent_var ($amp_lfo_depth_1)
read_persistent_var ($amp_lfo_depth_2)
read_persistent_var ($amp_lfo_depth_3)
if ($wave_1_active =1)
$wave_shape_display := $wave_shape_1
$coarse_pitch_display := $coarse_pitch_1
$fine_pitch_display := $fine_pitch_1
$hpf_display := $hpf_1
$drive_display := $drive_1
$amp_attack := $attack_1
$amp_decay := $decay_1
$amp_sustain := $sustain_1
$amp_release := $release_1
$amp_lfo_rate := $amp_lfo_speed_1
$amp_lfo_depth := $amp_lfo_depth_1
end if
if ($wave_2_active =1)
$wave_shape_display := $wave_shape_2
$coarse_pitch_display := $coarse_pitch_2
$fine_pitch_display := $fine_pitch_2
$hpf_display := $hpf_2
$drive_display := $drive_2
$amp_attack := $attack_2
$amp_decay := $decay_2
$amp_sustain := $sustain_2
$amp_release := $release_2
$amp_lfo_rate := $amp_lfo_speed_2
$amp_lfo_depth := $amp_lfo_depth_2
end if
if ($wave_3_active =1)
$wave_shape_display := $wave_shape_3
$coarse_pitch_display := $coarse_pitch_3
$fine_pitch_display := $fine_pitch_3
$hpf_display := $hpf_3
$drive_display := $drive_3
$amp_attack := $attack_3
$amp_decay := $decay_3
$amp_sustain := $sustain_3
$amp_release := $release_3
$amp_lfo_rate := $amp_lfo_speed_3
$amp_lfo_depth := $amp_lfo_depth_3
end if
end on
{==================================================================================
===========
===================================================================================
===========
===================================================================================
===========
=================================
====================================
================================= CALLBACKS
====================================
=================================
====================================
===================================================================================
===========
===================================================================================
===========
===================================================================================
==========}
on ui_control ($glitch)
{=============================IMPLEMENTING THE
GLITCH====================================}
$count :=1
while ($count <33)
set_engine_par ($ENGINE_PAR_TUNE,(500000 + ($fine_pitch_1*50)),$count,-
1,-1)
inc ($count)
end while
$count :=33
while ($count <65)
set_engine_par ($ENGINE_PAR_TUNE,(500000 + ($fine_pitch_2*50)),$count,-
1,-1)
inc ($count)
end while
$count :=65
while ($count <97)
set_engine_par ($ENGINE_PAR_TUNE,(500000 + ($fine_pitch_3*50)),$count,-
1,-1)
inc ($count)
end while
$count :=1
while ($count <33)
set_engine_par($ENGINE_PAR_CUTOFF,($hpf_1*8000),$count,0,-
1)
inc ($count)
end while
$count :=33
while ($count <65)
set_engine_par($ENGINE_PAR_CUTOFF,($hpf_2*8000),$count,0,-
1)
inc ($count)
end while
$count :=65
while ($count <97)
set_engine_par($ENGINE_PAR_CUTOFF,($hpf_3*8000),$count,0,-
1)
inc ($count)
end while
$count :=1
while ($count < 33)
set_engine_par($ENGINE_PAR_DRIVE,($drive_1*10000),
$count,3,1)
inc ($count)
end while
$count :=33
while ($count < 65)
set_engine_par($ENGINE_PAR_DRIVE,($drive_2*10000),
$count,3,1)
inc ($count)
end while
$count :=65
while ($count < 97)
set_engine_par($ENGINE_PAR_DRIVE,($drive_3*10000),
$count,3,1)
inc ($count)
end while
$count :=1
while ($count <33)
set_engine_par($ENGINE_PAR_ATTACK,$attack_1,$count,
(find_mod($count,"AMP_ENVELOPE")),-1)
inc ($count)
end while
set_engine_par($ENGINE_PAR_ATTACK,$attack_1,97,
(find_mod($count,"AMP_ENVELOPE")),-1)
$count :=33
while ($count <65)
set_engine_par($ENGINE_PAR_ATTACK,$attack_2,$count,
(find_mod($count,"AMP_ENVELOPE")),-1)
inc ($count)
end while
set_engine_par($ENGINE_PAR_ATTACK,$attack_2,98,
(find_mod($count,"AMP_ENVELOPE")),-1)
$count :=65
while ($count <97)
set_engine_par($ENGINE_PAR_ATTACK,$attack_3,$count,
(find_mod($count,"AMP_ENVELOPE")),-1)
inc ($count)
end while
$count :=1
while ($count <33)
set_engine_par($ENGINE_PAR_DECAY,$decay_1,$count,
(find_mod($count,"AMP_ENVELOPE")),-1)
inc ($count)
end while
set_engine_par($ENGINE_PAR_DECAY,$decay_1,97,
(find_mod($count,"AMP_ENVELOPE")),-1)
$count :=33
while ($count <65)
set_engine_par($ENGINE_PAR_DECAY,$decay_2,$count,
(find_mod($count,"AMP_ENVELOPE")),-1)
inc ($count)
end while
set_engine_par($ENGINE_PAR_DECAY,$decay_2,98,
(find_mod($count,"AMP_ENVELOPE")),-1)
$count :=65
while ($count <97)
set_engine_par($ENGINE_PAR_DECAY,$decay_3,$count,
(find_mod($count,"AMP_ENVELOPE")),-1)
inc ($count)
end while
$count :=1
while ($count <33)
set_engine_par($ENGINE_PAR_SUSTAIN,$sustain_1,$count,
(find_mod($count,"AMP_ENVELOPE")),-1)
inc ($count)
end while
set_engine_par($ENGINE_PAR_SUSTAIN,$sustain_1,97,
(find_mod($count,"AMP_ENVELOPE")),-1)
$count :=33
while ($count <65)
set_engine_par($ENGINE_PAR_SUSTAIN,$sustain_2,$count,
(find_mod($count,"AMP_ENVELOPE")),-1)
inc ($count)
end while
set_engine_par($ENGINE_PAR_SUSTAIN,$sustain_2,98,
(find_mod($count,"AMP_ENVELOPE")),-1)
$count :=65
while ($count <97)
set_engine_par($ENGINE_PAR_SUSTAIN,$sustain_3,$count,
(find_mod($count,"AMP_ENVELOPE")),-1)
inc ($count)
end while
$count :=1
while ($count <33)
set_engine_par($ENGINE_PAR_RELEASE,$release_1,$count,
(find_mod($count,"AMP_ENVELOPE")),-1)
inc ($count)
end while
set_engine_par($ENGINE_PAR_RELEASE,$release_1,97,
(find_mod($count,"AMP_ENVELOPE")),-1)
$count :=33
while ($count <65)
set_engine_par($ENGINE_PAR_RELEASE,$release_2,$count,
(find_mod($count,"AMP_ENVELOPE")),-1)
inc ($count)
end while
set_engine_par($ENGINE_PAR_RELEASE,$release_2,98,
(find_mod($count,"AMP_ENVELOPE")),-1)
$count :=65
while ($count <97)
set_engine_par($ENGINE_PAR_RELEASE,$release_3,$count,
(find_mod($count,"AMP_ENVELOPE")),-1)
inc ($count)
end while
$count :=1
while ($count <33)
_set_engine_par ($ENGINE_PAR_INTMOD_FREQUENCY,
$amp_lfo_speed_1,$count,(find_mod ($count,"AMP_LFO")),-1)
inc ($count)
end while
$count :=33
while ($count <65)
_set_engine_par ($ENGINE_PAR_INTMOD_FREQUENCY,
$amp_lfo_speed_2,$count,(find_mod ($count,"AMP_LFO")),-1)
inc ($count)
end while
_set_engine_par ($ENGINE_PAR_INTMOD_FREQUENCY,
$amp_lfo_speed_2,98,(find_mod (98,"AMP_LFO")),-1)
$count :=65
while ($count <97)
_set_engine_par ($ENGINE_PAR_INTMOD_FREQUENCY,
$amp_lfo_speed_3,$count,(find_mod ($count,"AMP_LFO")),-1)
inc ($count)
end while
$count :=1
while ($count <33)
_set_engine_par($ENGINE_PAR_MOD_TARGET_INTENSITY,
$amp_lfo_depth_1,$count,(find_mod($count,"AMP_LFO")),-1)
inc ($count)
end while
$count :=33
while ($count <65)
_set_engine_par($ENGINE_PAR_MOD_TARGET_INTENSITY,
$amp_lfo_depth_2,$count,(find_mod($count,"AMP_LFO")),-1)
inc ($count)
end while
_set_engine_par($ENGINE_PAR_MOD_TARGET_INTENSITY,
$amp_lfo_depth_2,98,(find_mod(98,"AMP_LFO")),-1)
$count :=65
while ($count <97)
_set_engine_par($ENGINE_PAR_MOD_TARGET_INTENSITY,
$amp_lfo_depth_3,$count,(find_mod($count,"AMP_LFO")),-1)
inc ($count)
end while
if ($4pole_led = 0)
$count :=1
while ($count <99)
_set_engine_par($ENGINE_PAR_EFFECT_BYPASS,
0,$count,1,-1)
_set_engine_par($ENGINE_PAR_EFFECT_BYPASS,
1,$count,2,-1)
inc ($count)
end while
else
$count :=1
while ($count <99)
_set_engine_par($ENGINE_PAR_EFFECT_BYPASS,
1,$count,1,-1)
_set_engine_par($ENGINE_PAR_EFFECT_BYPASS,
0,$count,2,-1)
inc ($count)
end while
end if
$count :=1
while ($count <99)
set_engine_par($ENGINE_PAR_CUTOFF,$cutoff,$count,1,-1)
set_engine_par($ENGINE_PAR_CUTOFF,$cutoff,$count,2,-1)
inc ($count)
end while
$count :=1
while ($count <99)
set_engine_par($ENGINE_PAR_RESONANCE,$resonance,$count,1,-1)
set_engine_par($ENGINE_PAR_RESONANCE,$resonance,$count,2,-1)
inc ($count)
end while
$count :=1
while ($count <99)
_set_engine_par($ENGINE_PAR_MOD_TARGET_INTENSITY,$filter_env_depth,
$count,(find_mod($count,"FILTER_ENVELOPE")),-1)
_set_engine_par($ENGINE_PAR_MOD_TARGET_INTENSITY,$filter_env_depth,
$count,(find_mod($count,"ENV_AHDSR")),-1)
inc ($count)
end while
$count :=1
while ($count <99)
_set_engine_par($ENGINE_PAR_MOD_TARGET_INTENSITY,$filter_lfo_depth,
$count,(find_mod($count,"LFO_SINE")),-1)
_set_engine_par($ENGINE_PAR_MOD_TARGET_INTENSITY,$filter_lfo_depth,
$count,(find_mod($count,"LFO_TRI")),-1)
inc ($count)
end while
$count :=1
while ($count <99)
_set_engine_par ($ENGINE_PAR_INTMOD_FREQUENCY,$filter_lfo_rate,$count,
(find_mod ($count,"LFO_SINE")),-1)
_set_engine_par ($ENGINE_PAR_INTMOD_FREQUENCY,$filter_lfo_rate,$count,
(find_mod ($count,"LFO_TRI")),-1)
inc ($count)
end while
$count :=1
while ($count <99)
set_engine_par($ENGINE_PAR_ATTACK,$filter_attack,$count,
(find_mod($count,"ENV_AHDSR")),-1)
set_engine_par($ENGINE_PAR_ATTACK,$filter_attack,$count,
(find_mod($count,"FILTER_ENVELOPE")),-1)
inc ($count)
end while
$count :=1
while ($count <99)
set_engine_par($ENGINE_PAR_DECAY,$filter_decay,$count,
(find_mod($count,"ENV_AHDSR")),-1)
set_engine_par($ENGINE_PAR_DECAY,$filter_decay,$count,
(find_mod($count,"FILTER_ENVELOPE")),-1)
inc ($count)
end while
$count :=1
while ($count <99)
set_engine_par($ENGINE_PAR_SUSTAIN,$filter_sustain,$count,
(find_mod($count,"ENV_AHDSR")),-1)
set_engine_par($ENGINE_PAR_SUSTAIN,$filter_sustain,$count,
(find_mod($count,"FILTER_ENVELOPE")),-1)
inc ($count)
end while
$count :=1
while ($count <99)
set_engine_par($ENGINE_PAR_RELEASE,$filter_release,$count,
(find_mod($count,"ENV_AHDSR")),-1)
set_engine_par($ENGINE_PAR_RELEASE,$filter_release,$count,
(find_mod($count,"FILTER_ENVELOPE")),-1)
inc ($count)
end while
$count := 1
while ($count <33)
set_engine_par ($ENGINE_PAR_VOLUME,$wave_1_amount,$count,-1,-1)
inc ($count)
end while
$count := 33
while ($count <65)
set_engine_par ($ENGINE_PAR_VOLUME,$wave_2_amount,$count,-1,-1)
inc ($count)
end while
$count := 65
while ($count <97)
set_engine_par ($ENGINE_PAR_VOLUME,$wave_3_amount,$count,-1,-1)
inc ($count)
end while
set_engine_par ($ENGINE_PAR_VOLUME,$sub_amount,97,-1,-1)
set_engine_par ($ENGINE_PAR_VOLUME,$noise_amount,98,-1,-1)
{====================UPDATING THE UI on
glitch====================================}
if ($4pole_led =1)
set_control_par_str(get_ui_id($4pole_led), $CONTROL_PAR_PICTURE,
"sq_led_on")
else
set_control_par_str(get_ui_id($4pole_led), $CONTROL_PAR_PICTURE,
"sq_led_off")
end if
if ($2pole_led =1)
set_control_par_str(get_ui_id($2pole_led), $CONTROL_PAR_PICTURE,
"sq_led_on")
else
set_control_par_str(get_ui_id($2pole_led), $CONTROL_PAR_PICTURE,
"sq_led_off")
end if
if ($wave_1_led =1)
$wave_shape_display := $wave_shape_1
$coarse_pitch_display := $coarse_pitch_1
$fine_pitch_display := $fine_pitch_1
$hpf_display := $hpf_1
$drive_display := $drive_1
$alpha_dial := $wave_shape_display
$coarse_pitch_knob := $coarse_pitch_display
$fine_pitch_knob := $fine_pitch_display
$hpf_knob := $hpf_display
$drive_knob := $drive_display
$amp_attack := $attack_1
$amp_decay := $decay_1
$amp_sustain := $sustain_1
$amp_release := $release_1
$amp_lfo_rate := $amp_lfo_speed_1
$amp_lfo_depth := $amp_lfo_depth_1
end if
if ($wave_2_led =1)
$wave_shape_display := $wave_shape_2
$coarse_pitch_display := $coarse_pitch_2
$fine_pitch_display := $fine_pitch_2
$hpf_display := $hpf_2
$drive_display := $drive_2
$alpha_dial := $wave_shape_display
$coarse_pitch_knob := $coarse_pitch_display
$fine_pitch_knob := $fine_pitch_display
$hpf_knob := $hpf_display
$drive_knob := $drive_display
$amp_attack := $attack_2
$amp_decay := $decay_2
$amp_sustain := $sustain_2
$amp_release := $release_2
$amp_lfo_rate := $amp_lfo_speed_2
$amp_lfo_depth := $amp_lfo_depth_2
end if
if ($wave_3_led =1)
$wave_shape_display := $wave_shape_3
$coarse_pitch_display := $coarse_pitch_3
$fine_pitch_display := $fine_pitch_3
$hpf_display := $hpf_3
$drive_display := $drive_3
$alpha_dial := $wave_shape_display
$coarse_pitch_knob := $coarse_pitch_display
$fine_pitch_knob := $fine_pitch_display
$hpf_knob := $hpf_display
$drive_knob := $drive_display
$amp_attack := $attack_3
$amp_decay := $decay_3
$amp_sustain := $sustain_3
$amp_release := $release_3
$amp_lfo_rate := $amp_lfo_speed_3
$amp_lfo_depth := $amp_lfo_depth_3
end if
end on
{=================================WAVE SELECTION
CALLBACKS===================================}
on ui_control ($wave_1_active)
$wave_shape_display := $wave_shape_1
$coarse_pitch_display := $coarse_pitch_1 {=============== WAVE 1
================}
$fine_pitch_display := $fine_pitch_1
$hpf_display := $hpf_1
$drive_display := $drive_1
$alpha_dial := $wave_shape_display
$coarse_pitch_knob := $coarse_pitch_display
$fine_pitch_knob := $fine_pitch_display
$hpf_knob := $hpf_display
$drive_knob := $drive_display
$amp_attack := $attack_1
$amp_decay := $decay_1
$amp_sustain := $sustain_1
$amp_release := $release_1
$amp_lfo_rate := $amp_lfo_speed_1
$amp_lfo_depth := $amp_lfo_depth_1
$wave_1_led := 1
set_control_par_str(get_ui_id($wave_1_led), $CONTROL_PAR_PICTURE,
"sq_led_on")
$wave_2_led := 0
set_control_par_str(get_ui_id($wave_2_led), $CONTROL_PAR_PICTURE,
"sq_led_off")
$wave_3_led := 0
set_control_par_str(get_ui_id($wave_3_led), $CONTROL_PAR_PICTURE,
"sq_led_off")
end on
on ui_control ($wave_2_active)
$wave_shape_display := $wave_shape_2
$coarse_pitch_display := $coarse_pitch_2 {=========== WAVE 2
=================}
$fine_pitch_display := $fine_pitch_2
$hpf_display := $hpf_2
$drive_display := $drive_2
$alpha_dial := $wave_shape_display
$coarse_pitch_knob := $coarse_pitch_display
$fine_pitch_knob := $fine_pitch_display
$hpf_knob := $hpf_display
$drive_knob := $drive_display
$amp_attack := $attack_2
$amp_decay := $decay_2
$amp_sustain := $sustain_2
$amp_release := $release_2
$amp_lfo_rate := $amp_lfo_speed_2
$amp_lfo_depth := $amp_lfo_depth_2
$wave_2_led := 1
set_control_par_str(get_ui_id($wave_2_led), $CONTROL_PAR_PICTURE,
"sq_led_on")
$wave_1_led := 0
set_control_par_str(get_ui_id($wave_1_led), $CONTROL_PAR_PICTURE,
"sq_led_off")
$wave_3_led := 0
set_control_par_str(get_ui_id($wave_3_led), $CONTROL_PAR_PICTURE,
"sq_led_off")
end on
on ui_control ($wave_3_active)
$wave_shape_display := $wave_shape_3
$coarse_pitch_display := $coarse_pitch_3 {============== WAVE 3
================}
$fine_pitch_display := $fine_pitch_3
$hpf_display := $hpf_3
$drive_display := $drive_3
$alpha_dial := $wave_shape_display
$coarse_pitch_knob := $coarse_pitch_display
$fine_pitch_knob := $fine_pitch_display
$hpf_knob := $hpf_display
$drive_knob := $drive_display
$amp_attack := $attack_3
$amp_decay := $decay_3
$amp_sustain := $sustain_3
$amp_release := $release_3
$amp_lfo_rate := $amp_lfo_speed_3
$amp_lfo_depth := $amp_lfo_depth_3
$wave_3_led := 1
set_control_par_str(get_ui_id($wave_3_led), $CONTROL_PAR_PICTURE,
"sq_led_on")
$wave_1_led := 0
set_control_par_str(get_ui_id($wave_1_led), $CONTROL_PAR_PICTURE,
"sq_led_off")
$wave_2_led := 0
set_control_par_str(get_ui_id($wave_2_led), $CONTROL_PAR_PICTURE,
"sq_led_off")
end on
on ui_control ($alpha_dial)
if ($wave_1_led =1)
$wave_shape_display := $alpha_dial
$wave_shape_1 := $wave_shape_display
end if
if ($wave_2_led =1)
$wave_shape_display := $alpha_dial
$wave_shape_2 := $wave_shape_display
end if
if ($wave_3_led =1)
$wave_shape_display := $alpha_dial
$wave_shape_3 := $wave_shape_display
end if
end on
on ui_control ($coarse_pitch_knob)
if ($wave_1_led =1)
$coarse_pitch_display := $coarse_pitch_knob
$coarse_pitch_1 := $coarse_pitch_display
end if
if ($wave_2_led =1)
$coarse_pitch_display := $coarse_pitch_knob
$coarse_pitch_2 := $coarse_pitch_display
end if
if ($wave_3_led =1)
$coarse_pitch_display := $coarse_pitch_knob
$coarse_pitch_3 := $coarse_pitch_display
end if
end on
on ui_control ($fine_pitch_knob)
if ($wave_1_led =1)
$fine_pitch_display := $fine_pitch_knob
$fine_pitch_1 := $fine_pitch_display
end if
if ($wave_2_led =1)
$fine_pitch_display := $fine_pitch_knob
$fine_pitch_2 := $fine_pitch_display
end if
if ($wave_3_led =1)
$fine_pitch_display := $fine_pitch_knob
$fine_pitch_3 := $fine_pitch_display
end if
$count :=1
while ($count <33)
set_engine_par ($ENGINE_PAR_TUNE,(500000 + ($fine_pitch_1*50)),$count,-
1,-1)
inc ($count)
end while
$count :=33
while ($count <65)
set_engine_par ($ENGINE_PAR_TUNE,(500000 + ($fine_pitch_2*50)),$count,-
1,-1)
inc ($count)
end while
$count :=65
while ($count <97)
set_engine_par ($ENGINE_PAR_TUNE,(500000 + ($fine_pitch_3*50)),$count,-
1,-1)
inc ($count)
end while
end on
on ui_control ($hpf_knob)
if ($wave_1_led =1)
$hpf_display := $hpf_knob
$hpf_1 := $hpf_display
$count :=1
while ($count <33)
set_engine_par($ENGINE_PAR_CUTOFF,($hpf_1*8000),$count,0,-
1)
inc ($count)
end while
end if
if ($wave_2_led =1)
$hpf_display := $hpf_knob
$hpf_2 := $hpf_display
$count :=33
while ($count <65)
set_engine_par($ENGINE_PAR_CUTOFF,($hpf_2*8000),$count,0,-
1)
inc ($count)
end while
end if
if ($wave_3_led =1)
$hpf_display := $hpf_knob
$hpf_3 := $hpf_display
$count :=65
while ($count <97)
set_engine_par($ENGINE_PAR_CUTOFF,($hpf_3*8000),$count,0,-
1)
inc ($count)
end while
end if
end on
on ui_control ($drive_knob)
if ($wave_1_led =1)
$drive_display := $drive_knob
$drive_1 := $drive_display
$count :=1
while ($count < 33)
set_engine_par($ENGINE_PAR_DRIVE,($drive_1*10000),
$count,3,1)
inc ($count)
end while
end if
if ($wave_2_led =1)
$drive_display := $drive_knob
$drive_2 := $drive_display
$count :=33
while ($count < 65)
set_engine_par($ENGINE_PAR_DRIVE,($drive_2*10000),
$count,3,1)
inc ($count)
end while
end if
if ($wave_3_led =1)
$drive_display := $drive_knob
$drive_3 := $drive_display
$count :=65
while ($count < 97)
set_engine_par($ENGINE_PAR_DRIVE,($drive_3*10000),
$count,3,1)
inc ($count)
end while
end if
end on
on ui_control ($amp_decay)
if ($wave_1_led =1)
$decay_1 := $amp_decay
$count :=1
while ($count <33)
set_engine_par($ENGINE_PAR_DECAY,$decay_1,$count,
(find_mod($count,"AMP_ENVELOPE")),-1)
inc ($count)
end while
set_engine_par($ENGINE_PAR_DECAY,$decay_1,97,
(find_mod($count,"AMP_ENVELOPE")),-1)
end if
if ($wave_2_led =1)
$decay_2 := $amp_decay
$count :=33
while ($count <65)
set_engine_par($ENGINE_PAR_DECAY,$decay_2,$count,
(find_mod($count,"AMP_ENVELOPE")),-1)
inc ($count)
end while
set_engine_par($ENGINE_PAR_DECAY,$decay_2,98,
(find_mod($count,"AMP_ENVELOPE")),-1)
end if
if ($wave_3_led =1)
$decay_3 := $amp_decay
$count :=65
while ($count <97)
set_engine_par($ENGINE_PAR_DECAY,$decay_3,$count,
(find_mod($count,"AMP_ENVELOPE")),-1)
inc ($count)
end while
end if
end on
on ui_control ($amp_sustain)
if ($wave_1_led =1)
$sustain_1 := $amp_sustain
$count :=1
while ($count <33)
set_engine_par($ENGINE_PAR_SUSTAIN,$sustain_1,$count,
(find_mod($count,"AMP_ENVELOPE")),-1)
inc ($count)
end while
set_engine_par($ENGINE_PAR_SUSTAIN,$sustain_1,97,
(find_mod($count,"AMP_ENVELOPE")),-1)
end if
if ($wave_2_led =1)
$sustain_2 := $amp_sustain
$count :=33
while ($count <65)
set_engine_par($ENGINE_PAR_SUSTAIN,$sustain_2,$count,
(find_mod($count,"AMP_ENVELOPE")),-1)
inc ($count)
end while
set_engine_par($ENGINE_PAR_SUSTAIN,$sustain_2,98,
(find_mod($count,"AMP_ENVELOPE")),-1)
end if
if ($wave_3_led =1)
$sustain_3 := $amp_sustain
$count :=65
while ($count <97)
set_engine_par($ENGINE_PAR_SUSTAIN,$sustain_3,$count,
(find_mod($count,"AMP_ENVELOPE")),-1)
inc ($count)
end while
end if
end on
on ui_control ($amp_release)
if ($wave_1_led =1)
$release_1 := $amp_release
$count :=1
while ($count <33)
set_engine_par($ENGINE_PAR_RELEASE,$release_1,$count,
(find_mod($count,"AMP_ENVELOPE")),-1)
inc ($count)
end while
set_engine_par($ENGINE_PAR_RELEASE,$release_1,97,
(find_mod($count,"AMP_ENVELOPE")),-1)
end if
if ($wave_2_led =1)
$release_2 := $amp_release
$count :=33
while ($count <65)
set_engine_par($ENGINE_PAR_RELEASE,$release_2,$count,
(find_mod($count,"AMP_ENVELOPE")),-1)
inc ($count)
end while
set_engine_par($ENGINE_PAR_RELEASE,$release_2,98,
(find_mod($count,"AMP_ENVELOPE")),-1)
end if
if ($wave_3_led =1)
$release_3 := $amp_release
$count :=65
while ($count <97)
set_engine_par($ENGINE_PAR_RELEASE,$release_3,$count,
(find_mod($count,"AMP_ENVELOPE")),-1)
inc ($count)
end while
end if
end on
on ui_control ($amp_lfo_rate)
if ($wave_1_led =1)
$amp_lfo_speed_1 := $amp_lfo_rate
$count :=1
while ($count <33)
_set_engine_par ($ENGINE_PAR_INTMOD_FREQUENCY,
$amp_lfo_rate,$count,(find_mod ($count,"AMP_LFO")),-1)
inc ($count)
end while
end if
if ($wave_2_led =1)
$amp_lfo_speed_2 := $amp_lfo_rate
$count :=33
while ($count <65)
_set_engine_par ($ENGINE_PAR_INTMOD_FREQUENCY,
$amp_lfo_rate,$count,(find_mod ($count,"AMP_LFO")),-1)
inc ($count)
end while
_set_engine_par ($ENGINE_PAR_INTMOD_FREQUENCY,
$amp_lfo_rate,98,(find_mod (98,"AMP_LFO")),-1)
end if
if ($wave_3_led =1)
$amp_lfo_speed_3 := $amp_lfo_rate
$count :=65
while ($count <97)
_set_engine_par ($ENGINE_PAR_INTMOD_FREQUENCY,
$amp_lfo_rate,$count,(find_mod ($count,"AMP_LFO")),-1)
inc ($count)
end while
end if
end on
on ui_control ($amp_lfo_depth)
if ($wave_1_led =1)
$amp_lfo_depth_1 := $amp_lfo_depth
$count :=1
while ($count <33)
_set_engine_par($ENGINE_PAR_MOD_TARGET_INTENSITY,
$amp_lfo_depth,$count,(find_mod($count,"AMP_LFO")),-1)
inc ($count)
end while
end if
if ($wave_2_led =1)
$amp_lfo_depth_2 := $amp_lfo_depth
$count :=33
while ($count <65)
_set_engine_par($ENGINE_PAR_MOD_TARGET_INTENSITY,
$amp_lfo_depth,$count,(find_mod($count,"AMP_LFO")),-1)
inc ($count)
end while
_set_engine_par($ENGINE_PAR_MOD_TARGET_INTENSITY,
$amp_lfo_depth,98,(find_mod(98,"AMP_LFO")),-1)
end if
if ($wave_3_led =1)
$amp_lfo_depth_3 := $amp_lfo_depth
$count :=65
while ($count <97)
_set_engine_par($ENGINE_PAR_MOD_TARGET_INTENSITY,
$amp_lfo_depth,$count,(find_mod($count,"AMP_LFO")),-1)
inc ($count)
end while
end if
end on
{========================================FILTER SECTION
CALLBACKS============================}
on ui_control ($filter_mode)
if ($4pole_led =1) {switching to 2-pole mode}
$4pole_led := 0
set_control_par_str(get_ui_id($4pole_led), $CONTROL_PAR_PICTURE,
"sq_led_off")
$2pole_led :=1
set_control_par_str(get_ui_id($2pole_led), $CONTROL_PAR_PICTURE,
"sq_led_on")
$count :=1
while ($count <99)
_set_engine_par($ENGINE_PAR_EFFECT_BYPASS,
0,$count,1,-1)
_set_engine_par($ENGINE_PAR_EFFECT_BYPASS,
1,$count,2,-1)
inc ($count)
end while
else
$4pole_led := 1 {switching to 4-pole mode}
set_control_par_str(get_ui_id($4pole_led), $CONTROL_PAR_PICTURE,
"sq_led_on")
$2pole_led :=0
set_control_par_str(get_ui_id($2pole_led), $CONTROL_PAR_PICTURE,
"sq_led_off")
$count :=1
while ($count <99)
_set_engine_par($ENGINE_PAR_EFFECT_BYPASS,
1,$count,1,-1)
_set_engine_par($ENGINE_PAR_EFFECT_BYPASS,
0,$count,2,-1)
inc ($count)
end while
end if
end on
on ui_control ($cutoff)
$count :=1
while ($count <99)
set_engine_par($ENGINE_PAR_CUTOFF,$cutoff,$count,1,-1)
set_engine_par($ENGINE_PAR_CUTOFF,$cutoff,$count,2,-1)
inc ($count)
end while
end on
on ui_control ($resonance)
$count :=1
while ($count <99)
set_engine_par($ENGINE_PAR_RESONANCE,$resonance,$count,1,-1)
set_engine_par($ENGINE_PAR_RESONANCE,$resonance,$count,2,-1)
inc ($count)
end while
end on
on ui_control ($filter_env_depth)
$count :=1
while ($count <99)
_set_engine_par($ENGINE_PAR_MOD_TARGET_INTENSITY,$filter_env_depth,
$count,(find_mod($count,"FILTER_ENVELOPE")),-1)
_set_engine_par($ENGINE_PAR_MOD_TARGET_INTENSITY,$filter_env_depth,
$count,(find_mod($count,"ENV_AHDSR")),-1)
inc ($count)
end while
end on
on ui_control ($filter_lfo_depth)
$count :=1
while ($count <99)
_set_engine_par($ENGINE_PAR_MOD_TARGET_INTENSITY,$filter_lfo_depth,
$count,(find_mod($count,"LFO_SINE")),-1)
_set_engine_par($ENGINE_PAR_MOD_TARGET_INTENSITY,$filter_lfo_depth,
$count,(find_mod($count,"LFO_TRI")),-1)
inc ($count)
end while
end on
on ui_control ($filter_lfo_rate)
$count :=1
while ($count <99)
_set_engine_par ($ENGINE_PAR_INTMOD_FREQUENCY,$filter_lfo_rate,$count,
(find_mod ($count,"LFO_SINE")),-1)
_set_engine_par ($ENGINE_PAR_INTMOD_FREQUENCY,$filter_lfo_rate,$count,
(find_mod ($count,"LFO_TRI")),-1)
inc ($count)
end while
end on
on ui_control ($filter_decay)
$count :=1
while ($count <99)
set_engine_par($ENGINE_PAR_DECAY,$filter_decay,$count,
(find_mod($count,"ENV_AHDSR")),-1)
set_engine_par($ENGINE_PAR_DECAY,$filter_decay,$count,
(find_mod($count,"FILTER_ENVELOPE")),-1)
inc ($count)
end while
end on
on ui_control ($filter_sustain)
$count :=1
while ($count <99)
set_engine_par($ENGINE_PAR_SUSTAIN,$filter_sustain,$count,
(find_mod($count,"ENV_AHDSR")),-1)
set_engine_par($ENGINE_PAR_SUSTAIN,$filter_sustain,$count,
(find_mod($count,"FILTER_ENVELOPE")),-1)
inc ($count)
end while
end on
on ui_control ($filter_release)
$count :=1
while ($count <99)
set_engine_par($ENGINE_PAR_RELEASE,$filter_release,$count,
(find_mod($count,"ENV_AHDSR")),-1)
set_engine_par($ENGINE_PAR_RELEASE,$filter_release,$count,
(find_mod($count,"FILTER_ENVELOPE")),-1)
inc ($count)
end while
end on
{==============================MIXER LEVELS
CALLBACKS=========================================}
on ui_control ($wave_1_amount)
$count := 1
while ($count <33)
set_engine_par ($ENGINE_PAR_VOLUME,$wave_1_amount,$count,-1,-1)
inc ($count)
end while
end on
on ui_control ($wave_2_amount)
$count := 33
while ($count <65)
set_engine_par ($ENGINE_PAR_VOLUME,$wave_2_amount,$count,-1,-1)
inc ($count)
end while
end on
on ui_control ($wave_3_amount)
$count := 65
while ($count <97)
set_engine_par ($ENGINE_PAR_VOLUME,$wave_3_amount,$count,-1,-1)
inc ($count)
end while
end on
on ui_control ($sub_amount)
set_engine_par ($ENGINE_PAR_VOLUME,$sub_amount,97,-1,-1)
end on
on ui_control ($noise_amount)
set_engine_par ($ENGINE_PAR_VOLUME,$noise_amount,98,-1,-1)
end on
{==================================================================================
============
=================================== ON NOTE CALLBACKS
=========================================
===================================================================================
===========}
on note
disallow_group ($ALL_GROUPS)
end on