Hallo Larry, Larry Troxler hat gesagt: // Larry Troxler wrote:
The problem I had with fluid~ was this: I wanted to load a large piano soundfont, but be able to process different voices (piano tones) seperately. For example, I might want to apply a filter envelope to each piano tone seperately.
Then I thought of using multiple fluid~ objects, with incoming notes routed to different fluid~'s using some algorithm to split up the voices. However, because of the size of the soundfont I wanted to use, it wouldn't be practical to load a copy of the sounfont in to each of the fluid~'s.
So, what I have done is modify fluid~ so that if you send a "[ load sounfont.sf2 share (", it uses the fluid API to load a single instance of the sounfont, and then add that one object to all the active fluid~'s. Naturally, this API could be refined, but the concept seems to work so far.
So, if anyone is interested in this kind of application, I could post the modifactions to fluid/main.cpp. I would do this now, except that it's probable that nobody but me has an application for this feature, and also because I'd want to hear ideas about the PD client interface - certainly it would be nicer to have something better than a message that blindly adds a sounfont to all of the active fluid~'s - but maybe this is fine after all.
I am *very* interested in this, because I tend to do things similar to your use case, which also would profit from shared soundfont-memory.
I have another idea in regard to the API. Would it be apt, to make the sharing explicit in a second creation argument to fluid. I'm thinking of the way, that the "pool" external make a shared data space that is named by creation argument or changed through a "set somepool" message.
A similar case would be the table family like [tabread tablename] which get the name of a shared array as creation arg, or with "set".
This would look so, that [fluid~ /soundfonts/nskit.sf2 DRUMS] will share its data with another [fluid~ /soundfonts/nskit.sf2 DRUMS] instance, but not with [fluid~ /soundfonts/fluid.sf2 PIANO]
A message "load /soundfonts/tb303.sf2" to the "DRUMS"-tagged fluid~s will change them all, but not the "PIANO"-tagged. Doing a "set DRUMS" to the PIANO-fluid~ could set the soundfont of that one to tb303.sf2.
Does this make sense?
Frank Barknecht _ ______footils.org__