This script achieves a simple yet very useful function I’ve long been searching for: holding the pads while the sustain pedal is down. For a while, I just set the pedal to toggle event blocking for NoteOn and NoteOff, but I had to be very intentional about how I played. It would only hold notes I played when the pedal was up.
The solution was to create a script that blocks all the NoteOn/NoteOff
MIDI messages while the sustain pedal is down. It also keeps track of the notes played, including their timing and velocity. When the pedal is released, any notes played within the timing threshold (default: half a second) will be triggered. This allows me to play as I would naturally with the sustain pedal, while still catching the chords played just before the pedal goes up and back down.
You’re welcome, at some point I’ll probably do an update on this script. Currently it keeps arrays with all the note information while the pedal is down which could get really big. When I get a chance to work on it again I’ll add some garbage collection to keep them in check.
Correct. What I’m using it for is to sustain and prevent new notes for some pads that I’m layering while playing the piano. I’m not running the piano through the script, just the pads so the piano plays regularly and just the pads “hold” with the sustain pedal
Thanks! I already have something that I am going to change in the code to make it function even more naturally. But I’ll give it a few weeks of using it to flesh all of the details out. If you run into anything that does work as expected when you’re using it please let me know.
Thanks for this, I think it will be a useful addition for me too as im always using multiple pads/textures, whilst having polyphony anxiety as I overplay the piano part!!
I also used it at church this weekened for the first time on stage and it made a big difference in the way I was able to play. Before I’d be really consious about playing higher accent notes with the strings in the mix but now I’m able to play a fill in more piano between the chord changes without creating a “wall of sound” with the pads/strings.