I'm running into "parser stack overflow" errors in my script, which I assume is because my init callback is past the 5,000 line limit. (Or whatever the limit is for Kontakt 5.2.)
What's making the init callback so big are all the ui_menus that I have. I'm giving the user the ability to assign their own choice of drums, keyswitches and fills to each of the 88 keys on a keyboard. That's 88 keys times 98 choices = 8,624 add_menu_item lines. Each of the 88 keys' menus looks this:
Normally, I can be more efficient by assigning array id's, like this:
%Keyswitch_Assign_ID_Array[21] := $Keyswitch_Assign_21
Then do all my assignments in a while loop. But unlike $CONTROL_PAR_PICTURE or $CONTROL_PAR_FONT_TYPE, I don't see a way to add menu items in a set_control_par(...) command.
Any advice?
What's making the init callback so big are all the ui_menus that I have. I'm giving the user the ability to assign their own choice of drums, keyswitches and fills to each of the 88 keys on a keyboard. That's 88 keys times 98 choices = 8,624 add_menu_item lines. Each of the 88 keys' menus looks this:
Code:
declare ui_menu $Keyswitch_Assign_21
add_menu_item($Keyswitch_Assign_21,"Kick",1)
add_menu_item($Keyswitch_Assign_21,"Snare",2)
add_menu_item($Keyswitch_Assign_21,"SnareAlt",3)
add_menu_item($Keyswitch_Assign_21,"HHClosed",4)
...
add_menu_item($Keyswitch_Assign_21,"Fill 53",97)
add_menu_item($Keyswitch_Assign_21,"Fill 54",98)
Normally, I can be more efficient by assigning array id's, like this:
%Keyswitch_Assign_ID_Array[21] := $Keyswitch_Assign_21
Then do all my assignments in a while loop. But unlike $CONTROL_PAR_PICTURE or $CONTROL_PAR_FONT_TYPE, I don't see a way to add menu items in a set_control_par(...) command.
Any advice?