Comments on: Kontakt Scripting (KSP) :: Sublime Text – how to work with macros, tutorial https://blog.yummybeats.com/ksp-kontakt-scripting/kontakt-scripting-ksp-sublime-3-how-to-work-with-macros-tutorial/ Kontakt Scripting Tutorials (KSP), Free Massive Presets, Mixing Tips Fri, 17 Apr 2026 01:55:24 +0000 hourly 1 https://wordpress.org/?v=7.1.3 By: YummyBeats https://blog.yummybeats.com/ksp-kontakt-scripting/kontakt-scripting-ksp-sublime-3-how-to-work-with-macros-tutorial/comment-page-1/#comment-9319 Thu, 24 Oct 2024 03:32:19 +0000 https://blog.yummybeats.com/?p=3005#comment-9319 In reply to Patrick.

Thank you for the detailed instructions. I haven’t tried it myself yet, but it’s so comprehensive that it will certainly help some people!

]]>
By: Patrick https://blog.yummybeats.com/ksp-kontakt-scripting/kontakt-scripting-ksp-sublime-3-how-to-work-with-macros-tutorial/comment-page-1/#comment-9318 Thu, 24 Oct 2024 01:18:15 +0000 https://blog.yummybeats.com/?p=3005#comment-9318 In reply to Kael Alden.

Will this method work if I’ve used Creator Tools to setup my UI? I read somewhere that Creator Tools is not compatible with compact variables in Sublime.

Yes, it works well. Basically, using Creator Tools allows you to quiickly flesh out a UI (I do it in parts), and even make reusable stuff. But essentially, it takes care of the declarations of stuff, and settings of all the basics. Then to utilize it you do this:

on init
	{MODEL DECLARATIONS}
	declare			params[]	:= (330000, 0, 0, 585730, 0, 531860)
	declare const 	NUM_PARAMS := params.SIZE
	make_persistent(params)

	{ INIT SCRIPT }
	message("")
	set_script_title(_SLOT_1_SCRIPT_TITLE_)
	set_snapshot_type(3)
	
	// Import & Load the Performance View
	import_nckp("../performance_view/gui.nckp")
	load_performance_view("gui")
end on

which imports those declarations and allows you to then reference them in your script.

You do need Compact Variables OFF, and can do this:

{ #pragma compile_without compact_variables }

at the top of your code to ensure it. Remember, you have to use CMD-k to compile it.

Also, is there a way to “Apply from” a script inside the resources folder, or does it have to be copied and pasted manually with each edit? I can only get the “Apply from” to work if I save the script as a .txt file, but I imagine that won’t work with a compiled (compacted) script in Sublime.

Along those lines, if you use this:

{ #pragma save_compiled_source slot-1.txt }

your code will be compile to the file slot-1.txt in the same directory as your source.ksp file. If you have them in the resources/scripts direcotry, you can then use “Apply from…” in the script editor of Kontakt to LINK the .txt file. So, once you compile it will automatically be updated in Kontakt.
This allows you to use a .ksp file as a source and have Sublime auto set to KSP syntax, while compiling to the .txt file that Kontakt (stupidly) requires to see the file to link.

Hope this helps someone.

Patrick

]]>
By: YummyBeats https://blog.yummybeats.com/ksp-kontakt-scripting/kontakt-scripting-ksp-sublime-3-how-to-work-with-macros-tutorial/comment-page-1/#comment-9298 Thu, 19 Oct 2023 22:31:22 +0000 https://blog.yummybeats.com/?p=3005#comment-9298 In reply to Kael Alden.

No problem, we were all noobs once 🙂
In fact regarding the Creator Tools I’m a noob as well, to be honest. Becasue I never worked with them. For me (from a coder’s perspective), it makes life more complicated without giving me much benefit. At least as far as I know the Creator Tools.

But you can disable compact vars in Sublime Text and just work with your own variable names if this is the only issue with Creator Tools. To disable compact vars, go to Tools -> SublimeKSP and uncheck “Compact Variables”.

Yes you can “import” & execute external scripts stored in your resource container as txt file. Just read this tutorial: https://blog.yummybeats.com/ksp-kontakt-scripting/kontakt-scripting-ksp-basics-outsourcing-and-storing-script-files-into-the-resource-container/

Yes it works with compiled code as well. All the code you would put into the internal script tab works exactly the same. However you can’t use uncompiled SublimeKSP code of course. Because Kontakt simply does not understand it.

]]>
By: Kael Alden https://blog.yummybeats.com/ksp-kontakt-scripting/kontakt-scripting-ksp-sublime-3-how-to-work-with-macros-tutorial/comment-page-1/#comment-9296 Wed, 18 Oct 2023 23:01:37 +0000 https://blog.yummybeats.com/?p=3005#comment-9296 Will this method work if I’ve used Creator Tools to setup my UI? I read somewhere that Creator Tools is not compatible with compact variables in Sublime.

Also, is there a way to “Apply from” a script inside the resources folder, or does it have to be copied and pasted manually with each edit? I can only get the “Apply from” to work if I save the script as a .txt file, but I imagine that won’t work with a compiled (compacted) script in Sublime.

Sorry if these are basic questions… I’m a noob.

]]>