Page 1 of 1

Multiple Release Samples Triggered By Sustain Length

Posted: Wed Jul 15, 2020 5:37 pm
by pgcrowe
Hello All,

I'm new to LinuxSampler, and excited for all of the wonderful possibilities of this software!

After reading documentation on GIG, SFZ, and NSKP, I'm wondering if there is a way to trigger separate WAV release samples (staccato and sustain) based on the held sustain length?

Example:
Note Held for 350 MS or Less --Triggers-- WAV Release Sample A
Note Held for 351 MS or Longer --Triggers-- WAV Release Sample B

Any examples of how I might go about this would be much appreciated.

Thanks!

Re: Multiple Release Samples Triggered By Sustain Length

Posted: Thu Jul 16, 2020 5:38 pm
by cuse
Yes, that's possible.

Not sure if there was an easy way with SFZ itself, but you can always write an NKSP script to handle that in any precise way you might imagine.

To capture the current time (e.g. when a note is triggered) you would read the built-in NKSP variable $ENGINE_UPTIME. Then when the note is released, you read that variable again, calculate the difference and then decide what to do, e.g. playing a different sample by calling built-in NKSP function play_note().