PDA

View Full Version : New version of Kontakt script editor/compiler


kotori
04-11-2006, 12:04 PM
I have now completed a new version (http://www.nilsliberg.se/ksp/) of my Kontakt script editor. For those who haven't heard of my Kontakt script editor before please check out this screenshot (http://nilsliberg.se/ksp/screenshot.png) and read more about its features on the web page.

The latest version (0.96) fixes a number of bugs and adds a completely new compiler. This compiler makes it possible to extend the script syntax in a number of ways. Compiling (by pressing F5) will translate code using the extended syntax to ordinary Kontakt script code. The reason for using the extended syntax is that it makes it easier for humans to write scripts. Features of the new compiler and extended script syntax (here's a chart (http://nilsliberg.se/ksp/img/kscript_editor_0_96.jpg)):
Variables don't have to be prefixed with $ and % which makes scripts clearer to read and easier to type.
For-loop - you can write "for i := 0 to 10".
Else if - no more nested if-statements, you can write "else if note = 24".
Parenthesis around if/select/while conditions are optional. You can write "if x = 10".
User-defined functions - you can define your own functions to avoid repeating yourself and to make larger scripts managable.
Local variables in functions. A variable which is declared inside a function is local to that function. Eg. if two functions both contain the line "declare x" then they will each get their own x variable. Changing the value of one will not affect the other. This facilitates further modularization and make functions more reusable.
Common errors are reported when you compile.Usage of the extended syntax is completely optional - you decide yourself if you want to use it or not. The new editor also provides instant HTML export with syntax highlighting. This is useful for printing or publishing on the net (here's a sample (http://nilsliberg.se/ksp/scripts/partmaker_source.html) of what it can look like). You can download the program from my web page (http://www.nilsliberg.se/ksp/) where both a windows and an OSX version is freely available.
Please post any comments and/or questions you might have in this thread.

Best,
Nils

(this announcement was posted on the NI Forums as well - link (http://www.nativeinstruments.de/forum_us/showthread.php?p=218256))

Rich Pell
04-11-2006, 02:06 PM
Great work Nils !! Best, Rich

Thonex
04-11-2006, 09:33 PM
Wow!!!!!

This is fantastic Nils!!!

I Look forward to using it. I already love your old compiler.

Thanks for sharing this.

Cheers,

AK

kotori
04-12-2006, 04:26 AM
Thanks for the encouraging words Rich and AK! :)
If you have any questions about the new compiler or find any problems, please post it here.

I could just add some details about the extended syntax. By request from Big Bob it's possible to use a certain step (default step is 1) in for loops. Here are some examples:for i := 0 to 10
for i := 0 to 100 step 5
for i := 10 downto 0
for i := 100 downto 0 step 5
The only exception to the variable prefixes ($ and %) being optional is the new prefixes (! and @) for string variables likely to be introduced in the K2.1 update. For these one has to use the prefixes on the declaration line. But from then on it's ok to skip them, eg:declare !string_array[3] := ("Violin", "Viola", "Cello")
declare @one_string
one_string := string_array[0] { no prefixes needed here }
Cheers,
Nils

Big Bob
04-13-2006, 02:35 AM
Isn't this guy something else?

God Bless you Nils,

Bob

drjohnny79
04-13-2006, 07:21 AM
OT:

I thought Nils was from Sweden. Like me! :p A swedish sounding name.