Linn134
GUI Designer
Hi guys!
I'm back with a head scratching question today.
For a non commercial NKI I'm trying to control 2 bus filters : Filter A & Filter B (Bus 1 Filter, Bus 2 Filter) based on the shrinked example in KSP Ref Manual 6.
So I'm with my two cursors, that's perfect but I'm wondering how to write the callback functions.
Here is the WIP code :
As you can see I'm trying to tell the event processor to use $CONTROL_PAR_AUTOMATION_ID (+number) to define the value of each function. I know it's a pretty basic thing but I can't find the way to do it reading KSP Ref3 or KSP Ref6.
Kontakt tell me
ERROR (line 53): variable "$CONTROL_PAR_AUTOMATION_ID_3" was not declared
So I assume it will be the same for the three others... But also it's not a good idea to use this as a variable...
Someone to explain me how to get this working ?
Thanks a lot.
I'm back with a head scratching question today.
For a non commercial NKI I'm trying to control 2 bus filters : Filter A & Filter B (Bus 1 Filter, Bus 2 Filter) based on the shrinked example in KSP Ref Manual 6.
So I'm with my two cursors, that's perfect but I'm wondering how to write the callback functions.
Here is the WIP code :
on init
{basic initialization}
message("")
make_perfview
set_ui_color(9ddddddh)
set_ui_height_px(350)
{create an XY pad with 2 cursors}
declare ui_xy ?myXY[4]
{store the UI ID of the XY pad}
declare $xyID
$xyID := get_ui_id(?myXY)
{skinning the cursors}
set_control_par_str_arr($xyID, $CONTROL_PAR_CURSOR_PICTURE, ...
"Picture1", 0)
set_control_par_str_arr($xyID, $CONTROL_PAR_CURSOR_PICTURE, ...
"Picture2", 2)
{set automation IDs and names}
set_control_par_arr($xyID, $CONTROL_PAR_AUTOMATION_ID, 0, 0)
set_control_par_arr($xyID, $CONTROL_PAR_AUTOMATION_ID, 1, 1)
set_control_par_arr($xyID, $CONTROL_PAR_AUTOMATION_ID, 2, 2)
set_control_par_arr($xyID, $CONTROL_PAR_AUTOMATION_ID, 3, 3)
set_control_par_str_arr($xyID, $CONTROL_PAR_AUTOMATION_NAME, ...
"Cutoff A", 0)
set_control_par_str_arr($xyID, $CONTROL_PAR_AUTOMATION_NAME, ...
"Resonance A", 1)
set_control_par_str_arr($xyID, $CONTROL_PAR_AUTOMATION_NAME, ...
"Cutoff B", 2)
set_control_par_str_arr($xyID, $CONTROL_PAR_AUTOMATION_NAME, ...
"Resonance B", 3)
{define the mouse behaviour}
set_control_par($xyID, $CONTROL_PAR_MOUSE_MODE, 0)
set_control_par($xyID, $CONTROL_PAR_MOUSE_BEHAVIOUR_X, 1000)
set_control_par($xyID, $CONTROL_PAR_MOUSE_BEHAVIOUR_Y, 1000)
{position and size}
set_control_par($xyID, $CONTROL_PAR_POS_X, 50)
set_control_par($xyID, $CONTROL_PAR_POS_Y, 50)
set_control_par($xyID, $CONTROL_PAR_WIDTH, 200)
set_control_par($xyID, $CONTROL_PAR_HEIGHT, 200)
{move the cursors to the center of the XY pad}
?myXY[0] := 0.5 {1st cursor, X axis}
?myXY[1] := 0.5 {1st cursor, Y axis}
?myXY[2] := 0.5 {2nd cursor, X axis}
?myXY[3] := 0.5 {2nd cursor, Y axis}
end on
function XYCrossfade()
set_engine_par($ENGINE_PAR_CUTOFF, $CONTROL_PAR_AUTOMATION_ID_0, -1, 0, $NI_BUS_OFFSET+0)
set_engine_par($ENGINE_PAR_CUTOFF, $CONTROL_PAR_AUTOMATION_ID_1, -1, 0, $NI_BUS_OFFSET+0)
set_engine_par($ENGINE_PAR_CUTOFF, $CONTROL_PAR_AUTOMATION_ID_2, -1, 0, $NI_BUS_OFFSET+1)
set_engine_par($ENGINE_PAR_CUTOFF, $CONTROL_PAR_AUTOMATION_ID_3, -1, 0, $NI_BUS_OFFSET+1)
end function
As you can see I'm trying to tell the event processor to use $CONTROL_PAR_AUTOMATION_ID (+number) to define the value of each function. I know it's a pretty basic thing but I can't find the way to do it reading KSP Ref3 or KSP Ref6.
Kontakt tell me
ERROR (line 53): variable "$CONTROL_PAR_AUTOMATION_ID_3" was not declared
So I assume it will be the same for the three others... But also it's not a good idea to use this as a variable...
Someone to explain me how to get this working ?
Thanks a lot.