Polybeats style "note length" gate on front end of synth

I’m trying to work on a gate for midi notes that works the same way as the polybeats “note length” parameter. Tried using makenote keeping things simple, but with a mono synth, this creates a problem where notes played in quick succession (faster than the duration in [makenote]) have inconsistent lengths (because makenote keeps counting the duration from where the previous note left off, rather than resetting).

Polybeats “note length” is a bit complex for a pd noob like myself, so I’m wondering if anyone might have suggestions on what parts I might need to take, and how to use them on the front end of a mono-synth. Or if there are simpler solutions maybe. Ultimately I want to make this into a standalone orac module as well. Thanks in advance!