Release sample script for kontakt


#1
{ ----- Piano Book Pedal script --- v190507 by Anders Wall ---- }   

    { -- How to set this up with your instrument -- }
    { -- Create three (3) groups in kontakt -- }
    { -- In the first group - put your quiet samples -- }
    { -- In the second group - put your loud samples -- }
    { -- In the third group - put your release samples -- }

        on init

        end on

        on note
          disallow_group($ALL_GROUPS) { -- turn all groups off -- }
          allow_group(0)  { -- p group -- }
          allow_group(1)  { -- f group -- }
        end on


        on release
          disallow_group(0)
          disallow_group(1)
          allow_group(2)  { -- release trigger group -- }
           if (%CC[64] = 127) 
            play_note($EVENT_NOTE,20,0,-1) { -- The value of 20 is how loud the release samples will sound when the pedal is down -- }
              else if (%CC[64] = 0)
            play_note($EVENT_NOTE,100,0,-1) { -- The value of 100 is how loud the release samples will sound when the pedal is up -- }
              end if
           end if 
        end on

#2

Change the “20” in this line
—> play_note($EVENT_NOTE,20,0,-1)
for louder release samples when the pedal is down.

Cheers,

Anders


#3

Thanks, I will test this with Nordiska Piano and report back.


#4

Yes please do.

Remember if you think the release samples are to low in volume then change that twenty to one hundred
–> ($EVENT_NOTE, 20 ,0,-1)

I think you also can use ($EVENT_NOTE, $EVENT_VELOCITY ,0,-1)
That way the release samples will match the velocity you struck the key.

One upgrade to the script would be to get a lower release volume if you release the keys slow and vice versa.
But that’s above my paygrade :slight_smile:
Cheers,
Anders


#5

Actually, this works like a charm… well, almost :slight_smile: I had to modify the script for my sampled piano, because for some inexplicable reason I have created two release layers, a loud one and a quiet one. Also, I have replaced the fixed velocities at trigger release with “$EVENT_VELOCITY” (velocity modulates the release sample volume by around 60%, and this adds a lot of variety to the release samples, even if it’s incorrect).

{ ----- Piano Book Pedal script --- v190507 by Anders Wall ---- }
{ ----- Modified by Tamas Zsiros for separate release groups ---- }      

    { -- How to set this up with your instrument -- }
    { -- Create four groups in kontakt -- }
    { -- Group 0 (1/4) - put your quiet samples --         }
    { -- Group 1 (2/4) - put your quiet release samples -- }
    { -- Group 2 (3/4) - put your loud samples --          }
    { -- Group 2 (3/4) - put your loud release samples  -- }


        on init
           declare $pedal
        end on

        on note
          disallow_group($ALL_GROUPS) { -- turn all groups off -- }
          allow_group(0)  { -- allow p group -- }
          allow_group(2)  { -- allow f group -- }
        end on

        on release
          disallow_group(0)
          disallow_group(2)
          allow_group(1)  { -- release trigger group p -- }
          allow_group(3)  { -- release trigger group f -- }
           if (%CC[64] = 127) 
            play_note($EVENT_NOTE,$EVENT_VELOCITY,0,-1) { --  release samples triggered when the pedal is down -- }
              else if (%CC[64] = 0)
            play_note($EVENT_NOTE,$EVENT_VELOCITY,0,-1) { --  release samples triggered when the pedal is up -- }
              end if
           end if 
        end on

Last, but not least, I’ve set up a modulator for the release velocities, so they go quieter when the pedal up event triggers all active notes’ releases en masse.

Here is a downloadable test version of Nordiska Piano with the new script:
Nordiska Pedal Test #5

Huge thanks for putting this script together!


#6

Glad it worked!
Thanks for testing and improving the script.
Will have a look at your piano and mods later.
…deadlines and selling a house takes the best out of me…

Best,
Anders


#7

Hi WallofSound,

thanks for the great script!
Works well - but did someone ever manage to make the volume of the release sample lower as longer the key is pressed? As the note fades I want the release sound to get quieter as well.
Help highly appreciated…!

Cheers, Martin