With dynamic voice allocation on a synthesizer is normally NOT meaned calling memory allocation. This can be solved very different and efficient without any memory allocations ...Urs wrote:Dynamic voice allocation is a really bad thing. Both the render thread and the midi thread are typically interrupt level threads where any sort of malloc() or new() are not exactly a good idea.
I have that vision of someone who's got a hanging note... he hits the keyboard with his forearm to get rid of it... but he doesn't... no vocie limit... instead, 100MB of his RAM are now used for voices he'll never play...
Also, reasonable optimzation might require to *know* how the memory is layed out. My plugins do a single malloc to allocate all resources required for realtime operation. This allows me to do cache friendly memory accesses which IMHO brings a huge speed boost...
Cheers,
Urs
In my opinion, dynamic voice allocation on synthesizers means especially, that the user is able to adjust the maximum of voices to be played without restarting or initializing the plugin (even dynamically). Kinda voice limiting.
That is in fact implemented on most professional products already (i.e. Kontakt, Albino, Vanguard, only to name some few, which comes to my mind ...)
And this adjusting even requires a decent note stealing algorithm ...
.