Scriplet to hold note and send note off

I’m trying to do cymbal roll in a live performance setting by simply pressing a note, let it ring (autmatically hold the note), use my expression pedal to increase the swell, and to send a note off when the volume of the swell reaches max (127).

I need some guidance/advice on how to create this scriptlet. The swell is controlled by the sample library - hence I just need a scriptlet to hold a note and then send a note off when volume reaches 127.

Thanks so much! I’m still very much a noob on scripting… :frowning: