iiwusynth-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[iiwusynth-devel] Unloading soundfonts


From: M. Nentwig
Subject: [iiwusynth-devel] Unloading soundfonts
Date: Thu, 21 Nov 2002 16:36:15 +0200

Hello,

some thoughts about unloading sound fonts, This has been on my mind now
for a while.

- The unload routine has to wait, until the DSP loop in the DSP thread
has run through one buffer. Otherwise there is no way to stop a voice,
which uses the soundfont in question and is just in the middle of a
buffer.
- The unload routine could terminate all voices using the soundfont, and
block until the DSP thread has finished the current block. Don't like
that. Not at all.

The best I came up with so far:
- The unload routine flags the sound font as unloaded, so that no new
voice processes may use it.
Then we keep the old soundfont in memory and only unload it when the
next sound font is loaded (triggered by the 'load' function), assuming
that all voices have finished in the meantime.

A really impressive feature of fluidsynth is, that programs can be
changed, while voices are running. The old voices are unaffected, only
new note-on events use the new voice. Now let's extend that to sound
fonts as well! (My own UI is already capable to make use of that
feature.)
The downside is, that there will be overlap, when unloading the old
soundfont and voices are still on. But that's the nature of the problem.
If there is a need to deallocate the memory as soon as possible, we
could add an iiwu_idle(synth) function, to be called regularly.
But I don't think that it's necessary.

Cheers

Markus





reply via email to

[Prev in Thread] Current Thread [Next in Thread]