1. IMPORTANT:
    We launched a new online community and this space is now closed. This community will be available as a read-only resources until further notice.
    JOIN US HERE

Script development tools

Discussion in 'Scripting Workshop' started by kotori, May 14, 2008.

  1. kotori

    kotori NI Product Owner

    Messages:
    1,153
    I made a couple of fixes, so there is now a new version, KScript Editor 1.3.5, available for download for Mac and PC (the changes are explained here).

    I also added a note at the end of the online manual about the new pragma directive that I introduced.
     
  2. SeerXillion

    SeerXillion Forum Member

    Messages:
    28
  3. Xill

    Xill Forum Member

    Messages:
    55
    Hi Nils,
    I've just implemented your Legato script in my setup and it works great.

    Thousands thanks!

    However, I've been trying to combine that script with he partmaker script but it seems to create some errors no matter in which order I arrange the scripts...

    Do you know if there is a solution for this problem?

    Many thanks again!

    Best,

    Xill
     
  4. kotori

    kotori NI Product Owner

    Messages:
    1,153
    Hi Xill

    You must be referring to Big Bob's legato script. I merely host it.
    The problem unfortunately requires quite some work to solve. The legato script needs to know what notes to connect but it's confused if you load the partmaker script first since that script outputs multiple notes for each incoming note. If you on the other hand load the part maker in a script slot after the legato script then the part maker script will regenerate notes based on the incoming notes and the tuning and volume information will be lost.

    I once proposed a scripting feature that would let a script that generates notes connect parameters like volume and tuning to the original note, so that the child note would inherit changes made to the parent note. Having such a system would make it much easier.

    Unfortunately my time is limited at the moment, but if someone else is willing to extend the Part Maker script in order to make it works with SIPS, then please feel free to do so. The source code is free to use and extend.
     
  5. Xill

    Xill Forum Member

    Messages:
    55
    Hi Nils, sorry for the confusion! The problem is exactly in the nature of what I excepted. I may try to take a look at it this summer, but the only solution seems to be a grand script that includes Round robin (using the one from xsample for repetitions, also incompatible with Big Bob's legato script), legato and ideally the partmaker.

    Anyway, I've found a solution which will take less time than program the scripts: it consist of simply making a new version of my instruments pitch shifted and remap them (which is the same thing the script did automatically).

    All the best and thanks!

    Xill
     
  6. TechLo

    TechLo NI Product Owner

    Messages:
    187
    Scripting is impossible without Nils' editor, trust me! Learn it and love it.
     
  7. kotori

    kotori NI Product Owner

    Messages:
    1,153
    Thanks for the kind words TechLo.

    I have now loaded a new version of KScript Editor. I posted an example on the VI-Control forum showing how one can now easily choose between inlining functions or using the new "call" keyboard in Kontakt 4.

    The advantage with inlining is that you can pass parameters (and it's possible to get result values back by passing in variables that the function changes). The disadvantage is obviously that the size of the final script increases. So both ways to invoke a function have their merits.
     
  8. kotori

    kotori NI Product Owner

    Messages:
    1,153
    There is now a new 1.5.0 version of my program. It has support for all new Kontakt 5 KSP features and includes a couple of bug fixes (see the change log for more detailed information).

    >>Download<<
     
  9. Wahed

    Wahed New Member

    Messages:
    12
    Oups! Crash !

    Hello again,

    I can't use the new version; crash at startup (OsX, 10.6.8) :

    Code:
    07/04/12 20:19:40	com.apple.launchd.peruser.501[172]	([0x0-0x4f54f5].org.pythonmac.unspecified.NilsLiberg'sKScriptEditor[7892]) Exited with exit code: 255
    Too bad, I erased the last version which worked.

    Thanks,

    Wahed

    P.S: By the way, what exactly is this new "Task Control Module"; Iread everything, but since I'm not a real programmer, I don't understand very well what it is...
     
  10. kotori

    kotori NI Product Owner

    Messages:
    1,153
    Hi Wahed,

    there seems to be a problem with the underlying GUI library that I use on OSX (in Windows everything works fine). I'll try to fix this as soon as I find the time. If you experience problems you can take the download URL and replace the version number with an earlier version number in order to download an earlier version (I leave the older installation files on my web server).

    Code:
    P.S: By the way, what exactly is this new "Task Control Module"; Iread everything, but since I'm not a real programmer, I don't understand very well what it is...
    Simply put it provides these two extensions to standard KSP:
    1. when you invoke a function using the "call" keyword you can use parameters and a return value.
    2. let's say that you declare a variable called $i and use this in your "on note" callback (NCB). Now let's say that your NCB is triggered by a note, $i is set to 2 and the wait(...) function is then invoked. During the wait another note is triggered and the NCB is triggered once again for this new note. The value of $i is now changed to 3. When control returns to the first NCB the value of $i will be 3, but your code may be reflying on it to have remained 2 - the value set within the first NCB. The Task Control Module provides a way to avoid clashes like this. It's a bit similar to what polyphonic variables do, but more flexible since it can be used in other types of callbacks than those for note-on and note-off.

    I hope that explains it.
     
  11. Wahed

    Wahed New Member

    Messages:
    12
    Thanks Nils !

    Your help is very useful... as always.

    Wahed.
    ---
    I tried some of the examples and I can't get work with KSE.
    TCM seems too complicated for me...

    Too bad since I experienced problem with polyphony and wait() in a single script.

    Thanks anyway.

    Wahed.
     
  12. haiiiner

    haiiiner Forum Member

    Messages:
    58
    Hi Kotori,
    I sent you a private message but I guess since you have to be logged in to even notice private messages you won't have seen it. Maybe you have an email notification for this thread though - I hope so.

    What I wrote was:

    Hi Nils,
    please allow me a question concerning your "speed control" script that caught my interest.

    Does it react to the speed set in the host or to the speed of the notes played?

    If the latter is the case I assume that setting a speed of 200 with the knob "speed" would relate to quarter notes played at 200, right? So that if set a speed range of e.g. 180 to 220 in speed control it would detect quarter notes at 200 bpm but also 16ths at 50 bpm and so on?


    Thanks,
    Heiner
     
  13. EvilDragon

    EvilDragon Well-Known Member

    Messages:
    19,938
  14. haiiiner

    haiiiner Forum Member

    Messages:
    58
    Yes, thanks, Mario - I got it!

    Heiner
     
  15. djnyce

    djnyce Forum Member

    Messages:
    146
    Nils, does this support K5?
     
  16. EvilDragon

    EvilDragon Well-Known Member

    Messages:
    19,938
    It does.
     
  17. wehkah

    wehkah Guest

    Hej Folks,

    i like the KScript editor but i like to use Notepad++ too. For now im about to implement autocompletion and syntax highlighting. Has anyone some experience in using UDL2.0 for code folding and Kontakt script? I dont get the "on inti" "end on" a like parts folded.

    cheers
    T
     
  18. Phil Pendlebury

    Phil Pendlebury NI Product Owner

    Messages:
    69
    Excellent thank you for this Nils.
     
  19. wehkah

    wehkah Guest

  20. gsalvadi

    gsalvadi New Member

    Messages:
    18
    Hello,

    I am a coder myself. Just wanted to know where can I reach the basics on frame work & syntax. May be I am bit quick to post this question, not sure. I have always been thinking of writing my first script and not getting started. Where the formal literature specific to Kontakt scripting available?

    Thanks in advance
    Gs
     
    Last edited: Jan 22, 2014