[PD] fluid~ shared soundfonts

Larry Troxler lt at westnet.com
Sat Apr 10 00:14:09 CEST 2004


Just thought I'd post a quick update - I haven't posted my work yet because 
the fluidsynth API needs an addition - the problem is that there is no way to 
remove a soundfont object from a synth without the synth freeing its memory.
An update to fluidsynth is being considered to address this, but I don't know 
when this will happen. 

However, if someone doesn't mind patching fluidsynth, I do have an interim 
workaround, so if anyone wants to use it I could email the fluid~ source file 
and a simple patch to the fluidsynth library.

The approach I took, BTW, is simply to keep track of the filenames by which 
sounfonts are loaded into fluid~'s, and if they are the same string, the font 
is shared rather than being reloaded. This approach isn't perfect, since 
different filenames can refer to the same soundfont, but that's the only 
drawback I can see. And before you say that this will prevent reloading an 
updated soundfont file, consider that there is no way to unload a soundfont 
in fluid~ yet. So as is, you would anyway have to erase all the fluid~'s that 
use the font an recreate them. And once the usage count goes to zero, I erase 
the shared soundfont, so the sounfont will get reloaded in this case.

Larry Troxler







More information about the Pd-list mailing list