Re: [fluid-dev] Possible approach to preloading samples / presets

2020-10-26 Thread Marcus Weseloh
Hi, there is a first RFC pull-request here: https://github.com/FluidSynth/fluidsynth/pull/698 It implements the fluid_synth_pin_preset and fluid_synt_unpin_presets by hooking into the preset notify callbacks that are already used by the dynamic-sample-loading to load and unload the preset. Advant

Re: [fluid-dev] Possible approach to preloading samples / presets

2020-10-26 Thread Tom M. via fluid-dev
> there is no thread-safe way of retrieving and using those pointers for external applications (outside of the synthesis thread) Valid point, indeed. > What do you think about: > fluid_synth_pin_preset(synth, sfont_id, bank, program) Ok for me. Looking forward to it :) Tom ___

Re: [fluid-dev] Possible approach to preloading samples / presets

2020-10-26 Thread Marcus Weseloh
Hi, Am So., 25. Okt. 2020 um 11:34 Uhr schrieb Tom M. via fluid-dev : > So, my preference of implementing this is to use the pinning approach. > I'm thinking of a function like > fluid_synth_pin_preset(synth, fluid_preset_t*) Yes, sounds good. And quite similar to the approach I used in the earli

Re: [fluid-dev] Possible approach to preloading samples / presets

2020-10-26 Thread Marcus Weseloh
Hm, looking at the code and thinking about this some more... You suggested something like fluid_synth_pin_preset(synth, fluid_preset_t*) The problem here is the fluid_preset_t pointer. Exposing a public API that consumes fluid_preset_t pointers will introduce some problems, as there is no threa

Re: [fluid-dev] Possible approach to preloading samples / presets

2020-10-25 Thread Tom M. via fluid-dev
Ok, I see. So, my preference of implementing this is to use the pinning approach. I'm thinking of a function like fluid_synth_pin_preset(synth, fluid_preset_t*) The function will attempt to pin all samples of the given preset and load them into memory, if they are currently unloaded. "to pin" i

Re: [fluid-dev] Possible approach to preloading samples / presets

2020-10-24 Thread Marcus Weseloh
Am Fr., 23. Okt. 2020 um 21:17 Uhr schrieb Tom M. via fluid-dev : > Why do you *need* to use (or support) "huge soundfonts" on a device that > apparently has memory constraints? Wouldn't a smaller SF that entirely > fits into memory do as well? First let me clarify: I'm not hugely memory constrain

Re: [fluid-dev] Possible approach to preloading samples / presets

2020-10-24 Thread Ceresa Jean-Jacques
Hi,   >Well, I do have a real need for preloading presets (or rather samples) now.   I understand your need and I'am not surprised you need this now because you are using a memory constrained system. Having a way to preload sample is also useful when preparing a set of presets that doesnt' b

Re: [fluid-dev] Possible approach to preloading samples / presets

2020-10-23 Thread Tom M. via fluid-dev
Understood. Yes, it would be nice to hear at least one other person who has a similar use case. I also have a preference of implementing this. But before, allow me to ask the following questions: > You could say that I shouldn't use dynamic sample loading in that case Why do you *need* to use (o

[fluid-dev] Possible approach to preloading samples / presets

2020-10-20 Thread Marcus Weseloh
Hi all, When we implemented the dynamic sample loading, we also discussed if it would be good to provide a way to preload samples. Back then it was mainly meant as a way to preload all presets from a MIDI file, so that loading the samples dynamically wouldn't stall the playback. We decided that it