sfztools/sfizz

[Feature Request] Add option to kill oldest voices first when hitting max voice count

szbergeron opened this issue · 2 comments

For something like a piano font with extended sustain, 64 or 96 voices can be plenty if notes are layered.

In Kontakt, when a new voice starts and the voice limit is already reached it ends the oldest voice and starts the new one.
This behavior allows for layering with extended sustain, where the newer (and most noticeable/loudest) voices enter as the oldest ones are just lost in the background as they stop.

Sfizz appears to simply stop accepting new voices when the limit is reached, which means it sounds as though the player simply stopped playing until either older voices decay and end completely or sustain is released.

This behavior is observed with https://www.pianobook.co.uk/packs/the-experience-yamaha-s6/ as well as several other fonts.

I actually get this behavior with some free Kontakt instruments(!) :P It's horrible when it happens with a hammered dulcimer!

In a sfz I am creating, if I don't try and restrict polyphony in the markup, both SFIZZ and Sforzando appear to handle the instrument ok (no dead keys while old voices die off) but the voice count can really climb, as does the memory use.

Limiting the voices in SFIZZ, I have had joy with

note_polyphony=6 
note_selfmask=off 

See https://sfzformat.com/opcodes/note_selfmask.

The pattern, for my instrument, seems to be with note_selfmask on SFIZZ annoyingly drops new notes. with it off then Sforzando starts to drop new notes. So I am not sure which is handling this 'correctly'. But a lot of instruments are written with Sforzando as the test player, I imagine, so might be the reason.

@szbergeron what version are you using?