[Csnd] Dynamically loading fluidsynth samples
Date | 2020-02-12 18:45 |
From | Syl Morrison |
Subject | [Csnd] Dynamically loading fluidsynth samples |
Hi all, I understand this feature might not be provided in the fluidsynth library, but I'd like to work out a way to dynamically unload and load new individual samples in a soundfont loaded to RAM, (for example, say I want to reload the 40th sample, I'd assume somewhere they'd store an array of pointers to the samples, I'd basically want to change the pointer to point to new sample data), and reflect this in Csound. Do the csound opcodes provide access to that array under the hood? Or is this very much scary, out of my league, OR have I fundamentally misunderstood how Soundfonts work?
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
|
Date | 2020-02-12 19:41 |
From | Pete Goodeve |
Subject | Re: [Csnd] Dynamically loading fluidsynth samples |
Attachments | None |
Date | 2020-02-12 22:02 |
From | Syl Morrison |
Subject | Re: [Csnd] Dynamically loading fluidsynth samples |
Thanks for the link and info Pete, knew it sounded to simple, I was purely basing that on the way a C++ lib called SF2Cute lets you write soundfonts (essentially make an SFSample object, make zone for it, and add to preset, repeat) so at one point I have a vector of SampleZones with the sample data as part of them! On Wed, Feb 12, 2020 at 7:41 PM Pete Goodeve <pete.goodeve@computer.org> wrote: On Wed, Feb 12, 2020 at 06:45:01PM +0000, Syl Morrison wrote: |
Date | 2020-02-12 22:46 |
From | mskala@ANSUZ.SOOKE.BC.CA |
Subject | Re: [Csnd] Dynamically loading fluidsynth samples |
On Wed, 12 Feb 2020, Syl Morrison wrote: > Thanks for the link and info Pete, knew it sounded to simple, I was purely > basing that on the way a C++ lib called SF2Cute lets you write soundfonts What is your use case here? Do you have a set of samples that really are samples, and you want to play the samples on demand but sometimes change which ones are in use? In that case, it might make sense to load the samples into function tables, play them from there, and not use fluidsynth at all. Do you have sounds that are real soundfont sounds - that is, not necessarily samples as such, possibly more complicated - but you want to switch among them? In that case it might make sense to just *do* that: load all your soundfonts, and remap the instrument numbers in your own code (possibly through some kind of lookup table) to invoke whichever sounds you want when you want. It's probably a premature optimization to assume that you need to replace loaded samples with other samples and can't afford to load them all. Are you trying to create and edit soundfont files? In that case Csound may simply be the wrong tool. -- Matthew Skala mskala@ansuz.sooke.bc.ca People before tribes. https://ansuz.sooke.bc.ca/ Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here |
Date | 2020-02-12 23:14 |
From | Pete Goodeve |
Subject | Re: [Csnd] Dynamically loading fluidsynth samples |
Attachments | None |
Date | 2020-02-13 20:32 |
From | Syl Morrison |
Subject | Re: [Csnd] Dynamically loading fluidsynth samples |
So my use case for this is moreso that samples may be generated on the fly as the program runs, and I'd like them to be able to be accessed by the playback instrument in csound (the generation happens in c++). I think you might be right about it making more sense to essentially make a multisampler wherein the samples can be dynamically unloaded and reloaded, but yeah, it's not as much a lack of ram issue as a time issue, some samples we want might not be available at init time! On Wed, Feb 12, 2020 at 11:14 PM Pete Goodeve <pete.goodeve@computer.org> wrote: On Wed, Feb 12, 2020 at 10:02:39PM +0000, Syl Morrison wrote: |
Date | 2020-02-13 20:42 |
From | Syl Morrison |
Subject | Re: [Csnd] Dynamically loading fluidsynth samples |
And yeah, SF2Cute is absolutely class, using it for writing soundfonts based on dynamic inputs On Thu, Feb 13, 2020 at 8:32 PM Syl Morrison <honoonu@gmail.com> wrote:
|