Introduction to Scripting in Kontakt 6
Scripting in Kontakt 6
Scripting is done with the KSP editor that's built directly into Kontakt. To access the editor, you first click on the wrench icon in the top corn of the instrument display. Several tabs become visible, including the Script Editor Tab.
By clicking on this tab, 5 script slot are revealed along with a scrolling text window with the script from the currently selected script tab. The script can be edited directly from this text window.
- To push the script update, you justpush the Apply button at the top left of the script text window.
When you are done creating an instrument, it can be saved by clicking the folder icon in the dock at the top of the Kontakt window. By clicking the option to save the instrument as a "Monolith" file, all of the samples and assets are neatly combined into a single .nki file. This makes it easy to keep samples linked to their respective instruments.
- My first instrument focused on three basic callbacks...
"on init", "on key", and "on release"
- callbacks create a kind of container where instructions are placed. the callback container is closed with "end on". These callbacks are built in, and provide an event that cues a command to be executed.
- "set_script_title" and "message" are the 2 commands that were used with the callbacks. Set script title allows a title for the script to appear in the individual script tab. Message, displays a string of text in the lower left corner of the Kontakt window, which is especially useful when debugging. My final code for this introductory instrument looks as follows:
on init
set_script_title("My First Script")
message("Hello Josh!!!")
end on
on note
message("A note is playing")
end on
on release
message("The magic is gone!")
end on
Attribution:
Thanks to Toby Pitman who shared a series of Kontakt tutorials on nativeinstruments.com (back on 12 October, 2012) for the online community. I saved this tutorial as a pdf many years ago, and just recently found it while organized some old hard drives. Thus, I'm unable to provide a link to the original source, but I humbly provide the reference below to the best of my ability.
Comments
Post a Comment