• Register
  • Help
Results 1 to 6 of 6

Topic: New version of Kontakt script editor/compiler

  1. #1

    New version of Script Editor/Compiler

    I have now completed a new version of my Kontakt script editor. For those who haven't heard of my Kontakt script editor before please check out this screenshot 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):
    • 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 of what it can look like). You can download the program from my web page where both a windows and an OSX version is freely available.
    Please post any comments and/or questions you might have in this thread.


    (this announcement was posted on the NI Forums as well - link)

  2. #2

    Re: New version of Kontakt script editor/compiler

    Great work Nils !! Best, Rich

  3. #3

    Re: New version of Kontakt script editor/compiler


    This is fantastic Nils!!!

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

    Thanks for sharing this.



  4. #4

    Re: New version of Kontakt script editor/compiler

    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 }

  5. #5
    Senior Member Big Bob's Avatar
    Join Date
    Jun 2005
    Apple Valley, California

    Re: New version of Kontakt script editor/compiler

    Isn't this guy something else?

    God Bless you Nils,

    Big Bob (aka Wonderful Bob)

  6. #6

    Re: New version of Kontakt script editor/compiler


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

Go Back to forum


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts