it seems like this is the kind of situation that [bag] was created for - if the incoming velocity is 0 when the sustain pedal is held, instead of sending that noteoff to the synth, add that note to the [bag] (like [64 1(). Then when the pedal is released [flush( the values from the [bag] and send them to a [pack f 0] before sending them to the destination. here's a little abstraction & help patch.
-seb
-----Original Message-----
From: alfonso santimone <alfonso.santimone@gmail.com>
To: pd-list@lists.iem.at <pd-list@lists.iem.at>
Sent: Wed, Jan 6, 2021 3:23 pm
Subject: Re: [PD] Polyphonic voice allocation and sustain pedal
Probably should cause a problem if a MIDI Note Number 0 is received.
Thanks again Hans for sharing this, it works just fine!
Probably there's a little "error" and i wonder why it work fine anyway at least at a quick test.
In the middle branch (the leftmost one of the pedal off case with the "bagoff const 0" message) after the [until] you took the reading index for "bagoff" array from the [+ 1] object.
So this way the index goes from 1 to 128. Shouldn't the index come from the [f ] object in the counter so the index goes from 0 to 127?
Here is a vanilla patch simulating a
sustain pedal. It stores the note-offs while the pedal is down and
releases them when the pedal is lifted.
best, Hans
On 1/3/21 7:55 PM, alfonso santimone
wrote:
Let's see...if any other Pure Data fellow will test
your [else\voices] and [else\suspedal] externals i guess we can
have more test cases and see what's going on.
In the meantime i'll still try to find the simplest way to
show my findings while testing this particular Else objects
;-)