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

Calling all programmers/script authors

Discussion in 'Scripting Workshop' started by Justin M, Nov 28, 2005.

Thread Status:
Not open for further replies.
  1. Justin M

    Justin M NI Product Owner

    Messages:
    76
    Im sure you have all seen VSLs new release. As far as I can tell everything can be done in Kontakt 2 (when the long awaited update actually lets me load my registered libraries!) apart from the speed switch.

    My question is: could somebody write a script that will automatically switch between patches/instruments depending on the speed of the passage?

    Heres hoping

    Justin
     
  2. dbudde

    dbudde NI Product Owner

    Messages:
    184
    I don't know why the speed control couldn't be implemented in kontakt. $NOTE_DURATION is a parameter that can be tested in KSP scripts.

    I just posted on the northern sounds board that the vienna instrument player might be based on kontakt engine with a new face. I don't know why they wouldn't do this given VSL's relationship with NI. But I'm just speculating.

    I expect you'll see attempts to emulate the Vienna Instrument player soon after it ships.
     
  3. mbncp

    mbncp Forum Member

    Messages:
    146
    > $NOTE_DURATION is a parameter that can be tested in KSP scripts

    The %NOTE_DURATION array tells you the elapsed time since a certain note started, but won't tell you when it ends.

    The only plugs, AFAIK, that can deal with note duration are Mfx and steinberg's VSTMA SDK.

    VST/VSTi always get the notes like they where played in real time. So you can decide that your note will play for 10 seconds, but there is no way to know the note duration when the note starts.

    A trick would be to move the track back by 1, 2 or more measures and add a delay on play back. But then it's a real pain when editing, visualizing and playing back your project.
     
  4. Justin M

    Justin M NI Product Owner

    Messages:
    76
    Any more ideas?
     
  5. dbudde

    dbudde NI Product Owner

    Messages:
    184
    Seems to me you could measure time between note events to determine the relative speed of the most recent note event. There is a global time function (I forget what it is called and don't have the manual in fromt of me at the moment).
     
  6. Big Bob

    Big Bob Forum Member

    Messages:
    606
    If I understand what you are hoping to do, I'm afraid that it will always come down to the fact that the script will be trying to predict the future. I assume that you want to do something like play a stacato patch when you play rapidly and a more legato, sustained patch when you play slowly, etc. The problem is that you need to select the patch before the first note of a new phrase sounds, and how would the script know that you were going to play a short or long note?

    The best you could hope to do would be to change to a stacato patch after sensing a closely spaced pair of notes. But by then, the first one or two notes have already been sounded, perhaps using the wrong patch. Similarly, when you change from a fast phrase to a slow one, the script would need to 'hear' the first couple of notes before it realized that it should switch to a legato patch, so the first note or two of your legato passage would still be played with the stacato patch.

    I'm afraid only you will know in advance what you intend to do next. I might ask at this point, what is so difficult about using a key switch or foot switch (or some such animal) to tell K2 when you want to change the patch? For example, if you don't like using a set of keys to select the patch, you could easily write a script that would cycle through your patches with each tap of a footswitch. Maybe if you would expound on why you want this function, I could suggest some other way to accomplish it.

    Bob
     
  7. mbncp

    mbncp Forum Member

    Messages:
    146
    It's funny, as the VST spec for MIDI do have a noteLength field, but to my knowledge, not a single host is filling it.

    Off course this wouldn't work in real time, but can add some life to your tracks after recording.

    If you have SX, you could use the logical editor to extract notes of certain lengths, and set a different channel for each set.

    If your host supports mfx plugs it would be easy to create a script that either triggers a key or changes the channel output base on notes length.
     
  8. Justin M

    Justin M NI Product Owner

    Messages:
    76
    Thanks for the reply Big Bob,
    I have no probs using keyswitches - I was just trying to emulate all the functions of the new VI. I think it may be a useful feature for mockups/sketches even though the command/keyswitch comes a note late. The keyswitch command could be added in the final master.

    Justin
     
  9. Big Bob

    Big Bob Forum Member

    Messages:
    606
    Hey Justin,

    Sorry for the delayed response, I totally forgot about this thread. Since I don't have access to the VSL I'm not in a position to run any experiments to see what they might be doing to sense playing speed. But, if they're able to do it in real time, then there must be some response latency.

    One very simple-minded way to do this sort of thing would be to have a time threshold setting and when two notes are separated by that amount or less it would be considered fast playing. This sort of thing could be done using the KSP by reading $ENGINE_UPTIME at the beginning of each note ('on note' callback) and taking the difference between the last two. A refinement of this would be to scale the time threshold with some function of the song's tempo.

    But again, I need to emphasize that there would be a delay in response such that the first two notes would likely play the wrong articulation. If anyone reading this thread has the VSL performance tool, how about running some tests and telling us what kind of latency you experience when alternating between slow and fast phrases?

    Bob
     
Thread Status:
Not open for further replies.