Here's a dumb example: let's say you have a basic instrument with one group and a filter loaded in Group FX slot 1. Here's how we do this, script-side:
Code: Select all
on init
make_perfview
declare ui_knob $Cutoff (0, 1000000, 1)
declare ui_knob $Res (0, 1000000, 1)
set_knob_unit($Cutoff, $KNOB_UNIT_HZ)
set_knob_unit($Res, $KNOB_UNIT_PERCENT)
make_persistent($Cutoff)
make_persistent($Res)
{ THIS IS THE IMPORTANT PART! }
set_control_par(get_ui_id($Cutoff), $CONTROL_PAR_AUTOMATION_ID, 0)
set_control_par(get_ui_id($Res), $CONTROL_PAR_AUTOMATION_ID, 1)
{ END OF IMPORTANT PART! }
message("")
end on
on persistence_changed
set_knob_label($Cutoff, get_engine_par_disp($ENGINE_PAR_CUTOFF, 0, 0, -1))
set_knob_label($Res, get_engine_par_disp($ENGINE_PAR_RESONANCE, 0, 0, -1))
end on
on ui_control ($Cutoff)
set_engine_par($ENGINE_PAR_CUTOFF, $Cutoff, 0, 0, -1)
set_knob_label($Cutoff, get_engine_par_disp($ENGINE_PAR_CUTOFF, 0, 0, -1))
end on
on ui_control ($Res)
set_engine_par($ENGINE_PAR_RESONANCE, $Res, 0, 0, -1)
set_knob_label($Res, get_engine_par_disp($ENGINE_PAR_RESONANCE, 0, 0, -1))
end on
