_
___| | _____ _ __
/ __| |/ / __| '_ \
| (__| <\__ \ |_) |
\___|_|\_\___/ .__/
|_|
The CKSP Compiler is a preprocessing compiler that extends the Kontakt Script Processor (KSP), the scripting language used in Native Instruments Kontakt. Despite its industry adoption, vanilla KSP lacks modern programming abstractions and has remained largely unchanged.
CKSP retrofits these missing abstractions by introducing a higher-level language layer that compiles down to vanilla KSP. This enables developers to write structured, maintainable code while preserving full compatibility with the existing Kontakt runtime.
We describe the most significant improvements over KSP in our GPCE'25 paper Retrofitting a Virtual Instrument DSL with Programming Abstractions, published in the ACM Digital Library.
Learn more in the documentation.
KSP was not designed for large-scale software development. As Kontakt projects grow, scripts become increasingly difficult to maintain due to (not exhaustive):
- Global variable management
- Lack of modularity
- Missing abstraction mechanisms
CKSP addresses these limitations by adding features like:
- Lexical scoping: introduces local variables and replaces global-only variable handling
- Functions with parameters and return values: enable modular code
- Recursive data structures: allow expressive data modeling
- Optional typing: TypScript-like type annotations improve reliability without sacrificing flexibility
- Support for vanilla-KSP: Compiles existing
.kspor.txtfiles in the vanilla KSP dialect. - Preprocessor functions are adjusted for simplified migration from the Sublime KSP syntax. Implemented features include: macros, defines, line incrementors, iterate_macro, literate_macro.
All features are compiled to standard KSP, requiring no changes to the Kontakt runtime. The above list is not comprehensive when compared to vanilla KSP syntax. For more completeness, please refer to the Syntax chapter of the online documentation.
Compile a cksp file:
cksp input.cksp -o output.txt
Refer to the Installation chapter for detailed installation instructions. With the CKSP Tools extension for Visual Studio Code, you can compile your CKSP/KSP files directly from the editor. The extension will automatically download the latest version of the compiler executable and use it to compile your files. The compiler is in active development, but the latest version of the CLI executable can be downloaded from Releases.
Contributions to the CKSP Compiler are welcome! If you have an idea for a new feature, improvement, or bug fix, please open an issue or submit a pull request on GitHub.
To deploy a new release, follow these steps:
- Make sure to be on branch
development. - Update the version number in
CMakeLists.txt. - Run
./run_tests.sh --with-kontaktto ensure all tests pass. - Run
./scripts/write_changelog.shto generate the raw changelog notes for the new version. The notes will be generated based on the commit messages since the last release and written intoCHANGELOG.mdin the project root. - Formulate a proper changelog entry from the notes into
CHANGELOG.md. - Commit all changes to git and push to the
developmentbranch. - Merge
developmentintomasterand push. This will trigger the GitHub Actions workflow to build macOS arm64, macOS x86_64, and Windows releases, commit the changelog snapshot tochangelogs/, create the release tag, and publish the GitHub release in this repository.
For a local release from the current machine, run ./scripts/publish_latest_release.sh. This builds the compiler locally, updates the current platform's binary under _Releases/<version>, keeps any existing binaries for other platforms in that directory, zips the full version directory, and publishes it to this repository's GitHub releases.