• Register
  • Help
Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Topic: Nils Liberg's Kontakt scripting tools

Share/Bookmark
  1. #1

    Nils Liberg's Kontakt scripting tools

    Bill just posted this link in another thread:
    http://nilsliberg.se/ksp/

    It's a text editor with kontakt script highlighting + some additions to the scripting language. Unfortunately, I didn't find any docu on that.

    Here's a thread on it at NI Kontakt Forum:
    http://www.nativeinstruments.de/foru...ad.php?t=31760

    Does anybody have a working example of a Kontakt script programmed in Nils Liberg's Kotori language?

    Greetings
    Marc

  2. #2
    Senior Member Big Bob's Avatar
    Join Date
    Jun 2005
    Location
    Apple Valley, California
    Posts
    323

    Re: Nils Liberg's Kontakt scripting tools

    Does anybody have a working example of a Kontakt script programmed in Nils Liberg's Kotori language?

    Greetings
    Marc
    Hi Marc,

    Actually Nils is offering two different tools. The Editor (which is now almost fully functional at least for the Windows version) is distinct from the Kotori language compiler. The editor is used like you would use NotePad to type and edit K2 scripts. The language syntax is that of the KSP with some nice extensions and features.

    The Kotori Language Compiler requires that you first learn to program in a different language than that of the KSP. The compiler then converts your programs (written in Kotori) into K2 scripts. Since I haven't used this tool, I don't have any source examples that I could show you but I'm sure Nils does.

    As for examples of K2 scripts using the editor, I have several of them; but since their file format is simply .txt format, all you need to do to see an example is to load any K2 script (in .txt format) into the editor and you can then display or print it with syntax highlighting. Nils' editor will be a great tool for anyone who writes or plans to write K2 scripts. The K2 editor is very limited and quirky and is suitable only for minor edits or for typing very small scripts. Most of us who have written non-trivial scripts use an external editor and then copy and paste the script into the K2 editor.

    If you want to see what a KSP script looks like in Nils' editor, and you don't have any K2 scripts in .txt format, just load one of the KSP library scripts into K2 and use the clipboard to copy and paste the text to Nils' editor. His editor is very K2-Script friendly and I highly recommend you try using it instead of Notepad or some other generic editor.

    Bob
    Big Bob (aka Wonderful Bob)

  3. #3

    Re: Nils Liberg's Kontakt scripting tools

    Hello,
    thanks for your interest in my scripting tools. The Kotori language isn't ready for use just yet (documentation and 'select' missing).
    If anyone is curious you can look at this script written in the Kotori language and the corresponding Kscript code that's generated from it. It's a test script I wrote for alternating between VSL articulations based on note velocity (something possible with Vienna Instruments). Don't know if the script is very useful, but it serves as a demonstration here.
    The editor program seems to work fine on Mac OSX, but I'm having some troubles packaging it as an installer and am still looking for a solution, so there's only a PC version for now.

    Regarding the extension of the script syntax in the editor (to make it possible to define your own functions), I've put together a small introduction to it.

    Regards,
    Nils

  4. #4

    Re: Nils Liberg's Kontakt scripting tools

    Quote Originally Posted by kotori
    Hello,
    thanks for your interest in my scripting tools. The Kotori language isn't ready for use just yet (documentation and 'select' missing).
    If anyone is curious you can look at this script written in the Kotori language and the corresponding Kscript code that's generated from it.
    Thanks! That's what I've been looking for. Kotori looks interesting. I like typed programming languages much better, though. Do you really want to include a 'select'-type statement to your language (including fall-through)? OK, why not

    Regarding the extension of the script syntax in the editor (to make it possible to define your own functions), I've put together a small introduction to it.
    That's nice. Thank's again.

  5. #5

    Thumbs up Re: Nils Liberg's Kontakt scripting tools

    Nils,
    Thanks very, very much for the alternating articulation script. This is fantastic!

    Ned

  6. #6

    Re: Nils Liberg's Kontakt scripting tools

    ....And while I'm at it....Thanks to Big Bob, Fizbin, and Theo. The work you guys are sharing is greatly appreciated.

  7. #7

    Re: Nils Liberg's Kontakt scripting tools

    Quote Originally Posted by Mahal
    Thanks! That's what I've been looking for. Kotori looks interesting. I like typed programming languages much better, though. Do you really want to include a 'select'-type statement to your language (including fall-through)? OK, why not

    That's nice. Thank's again.
    [Some programmer "mumbo jumbo" - non-programmers please feel free skip this:]
    Hi Mahal,
    'typed' is a tricky word. Often it's used to mean 'statically styped' as opposed to 'dynamically typed', but both dynamically and statically typed languages can be 'strongly typed' and that's what's really important. Both the Kotori language and the K2 script language are strongly typed (=one will not get unexpected results by trying to run a script that uses data types in incorrect ways) and the Kotori language is also (partly) statically typed - every variable that's not of integer type has to be declared, and all variables not declared are assumed to be integers.
    I don't plan on any 'select' with fall-through like in C/C++ since it's very error-phrone. Also, the 'select' of the K2 script language is non-fall-through. It's possible to use if and else if as replacements for 'select', but it may involve a small (probably very small) performance penalty. Maybe I'll use 'if' and 'else if' in the Kotori language and output 'select' statements in cases when it's possible. I'll see when I find time to finish it. For the time being the slight extension to allow for user-defined functions in K2 scripts integrated in the editor takes one pretty far.
    NedK:
    Thanks, however I don't know if the velocity-based articulation switching script is really ready to use. For example, there are some "make_persistent"s missing, so settings might not be saved properly. If the script would be useful to you, I'll consider completing it. I wrote it mostly to explore what features might be useful in the Kotori language.
    And I agree, a big thanks to Big Bob, Fizbin, and Theo!

    Nils

  8. #8

    Re: Nils Liberg's Kontakt scripting tools

    ...some more "mumbo jumbo"
    Quote Originally Posted by kotori
    'typed' is a tricky word. Often it's used to mean 'statically styped' as opposed to 'dynamically typed', but both dynamically and statically typed languages can be 'strongly typed' and that's what's really important.
    You're right, I was unclear here. I should have written "explicitly typed". To me, the essence of software engineering is: Don't believe something is obvious to everybody, don't keep things implicit but make them as explicit as you can.
    Both the Kotori language and the K2 script language are strongly typed (=one will not get unexpected results by trying to run a script that uses data types in incorrect ways) and the Kotori language is also (partly) statically typed - every variable that's not of integer type has to be declared, and all variables not declared are assumed to be integers.
    So you're planning to do all type checking at compile time? That's how it should be
    I don't plan on any 'select' with fall-through like in C/C++ since it's very error-prone.
    Good move.
    For the time being the slight extension to allow for user-defined functions in K2 scripts integrated in the editor takes one pretty far.
    Yes, definitely.

    Greetings
    Marc

  9. #9

    Re: Nils Liberg's Kontakt scripting tools

    Quote Originally Posted by kotori
    Thanks, however I don't know if the velocity-based articulation switching script is really ready to use. For example, there are some "make_persistent"s missing, so settings might not be saved properly. If the script would be useful to you, I'll consider completing it. I wrote it mostly to explore what features might be useful in the Kotori language.
    And I agree, a big thanks to Big Bob, Fizbin, and Theo!

    Nils
    Hi there Nils,

    So.....what exactly does this script do?

  10. #10

    Re: Nils Liberg's Kontakt scripting tools

    Quote Originally Posted by frankvg
    Hi there Nils,

    So.....what exactly does this script do?
    Hi Frank,
    for example it lets you configure that notes pressed soft notes should be played legato, hard ones should be played staccato and really hard notes should be pizzicato. It's supposed to be used with the VSL string samples bundled with K2. The script lets you choose playing styles and velocity limits and automatically plays the keyswitches as needed. BTW, I updated the script above to support saving changes.

    Actually something that could be more useful and more like the new Vienna Instruments, would be if one were able to keyswitch between modwheel xfading and non-xfading and use automatic selection of articulations based on note velocity only in xfade mode. In non-xfade mode the hardness with which you strike notes would determine their loadness and keyswitches would determine articulation (as normal with VSL), in xfade mode the hardness with which you strike notes would determine the articulation and the modwheel would determine the loudness of the notes. That way one could first play a phrase with many fast staccato notes with velocity determined by how you play, and then one could switch to a slow phrase with more fine control over xfading and articulation switching. Any comments on this?

    Nils

Go Back to forum

Bookmarks

Posting Permissions

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