fluid-dev
[Top][All Lists]
Advanced

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

Re: [fluid-dev] Proposal for a new feature: lazy-loading of SoundFonts


From: Marcus Weseloh
Subject: Re: [fluid-dev] Proposal for a new feature: lazy-loading of SoundFonts
Date: Wed, 18 Apr 2018 14:11:13 +0200

Hi sqweek,

2018-04-18 11:10 GMT+02:00 sqweek <address@hidden>:
> ie. there's a hard realtime requirement here in some usages - is it still possible to meet that requirement with the samples being loaded/unloaded?

No, with samples being loaded and unloaded on demand, requirements like guaranteed immediate availability of selected presets are not possible, of course. That is actually partly a feature of this idea. Distributing the time it takes to load the whole Soundfont and shifting it back to the point when a preset is actually selected. And yes, that is not useful or even harmful in many situations. But in some situations, it's just what will make users happy. :-)
Please understand that the dynamic sample loading is an optional feature and is disabled by default. So for "hard realtime" requirements, you simply don't switch on the feature.

> I'm not a midi expert so please forgive the vagueness of the question. From what you've written I guess the performer can setup presets for all required instruments and then switch between them without any loading having to take place? That seems ok to me, but is perhaps still surprising to a performer who is used to everything being available once the soundfont is loaded.

Actually, the current implementation in the dynamic-sample-loading branch always unloads samples if a preset is not used on any channel anymore.

But we've been discussing an additional feature that would scan a MIDI file, look for program change events and then preload all presets in those events before starting playback. So we would need to add a "preload" function anyway. If we expose this function via the Fluidsynth shell and add a "--sticky" argument (which would keep the samples in memory until the Soundfont is completely unloaded), we basically have the best of both worlds. Musicians could use that command to do exactly what you propose: preload all required presets before the performance and still have the advantage of lower memory consumption.

Either that, or have two modes for dynamic-sample-loading: "fully dynamic" (load and unload on demand) or "lazy load" (load on demand but only unload when Soundfont is unloaded).

Cheers,

    Marcus

reply via email to

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