iiwusynth-devel
[Top][All Lists]
Advanced

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

Re: [iiwusynth-devel] Re: Libsoundfont version of iiwusynth


From: Peter Hanappe
Subject: Re: [iiwusynth-devel] Re: Libsoundfont version of iiwusynth
Date: 07 Mar 2002 01:49:13 +0100

On Wed, 2002-03-06 at 19:29, Josh Green wrote:
> On Wed, 2002-03-06 at 07:21, Peter Hanappe wrote:
> > Now here comes the big part of my mail. This morning I made the changes
> > I had in mind to support soundfont loaders. It's quite a big change. I
> > haven't commited it yet because I'd like your opinion first. I attached
> > the new iiwusynth.h header file to this mail. The important part is the
> > section on SoundFont plugins starting at line 342.
> > 
> > Basically, you can dynamically add new SoundFont loaders. I changed the
> > current code so that the existing soundfont loader is added as the
> > default one. 
> > 
> > You can change the default loader by adding a new soundfont loader based
> > on libsoundfont. 
> > 
> > It would be useful to write an other "soundfont" loader, based on
> > libsoundfile that can load soundfiles and assigns them to key 60.
> > 
> > I defined a number of "interfaces" or structures with callback functions
> > for the interaction between the synthesizer and the soundfont
> > structures. The synthesizer needs to access a soundfont to get a preset.
> > It needs to access a preset to handle a note on event.
> > 
> > When a noteon event arrives the preset has to allocate a voice (or
> > voices) and set the generator values of the voice. I provided api
> > functions for that.
> > 
> > The use of the structures with function callback introduces a layer of
> > indirection. This should not introduce any performance penalty except
> > perhaps for the noteon event. 
> > 
> > The real data structures that are used to implement a soundfont are
> > completely opaque to the synthesizer. This means that Swami can use any
> > internal bookkeeping it likes, including editing the soundfont. 
> > 
> > Take a look at the header. I hope you like it. Give me a signal and I
> > can commit everything so you can see the full implementation.
> > 
> 
> Awesome! This is totally cool. 

I'm glad you like it!

> Makes me feel better about trotting all
> over your current sound font loading code, now that it is no longer
> necessary to do so.

The old soundfont code was a messy mixture duplicating your code with my
structures! I will probably do a some cleaning of that part.

> It leaves the handling of the SoundFonts up to my
> plugin interface as well which means I don't have to worry about using
> libswami. By all means, I'd like to start using it. I guess this could
> have been done before without bringing libsoundfont about, but perhaps
> somebody will be able to use it in their program :)

I commited the changes. The files iiwu_sfont.{c,h} moved to
iiwu_defsfont.{c,h}, which stands for default sfont loader. It's a good
starting example of the new WaveLoader Plugin API (c) !

> Are there any other steps necessary to get this sound font loading
> plugin architecture working within iiwusynth?

Take a look at iiwu_defsfont.c. The top of the file has the sfont
interface code. You might also want to check the defpreset_noteon
function. With those examples, I think you'll have libsoundfont plugged
quite quickly.

Note that the API is not complete yet. It lacks the removal of a sfont
loader (tricky since all presets and sample data has to be removed). It
also doesn't handle modulators yet.

Lates!
Peter

> > Cheers!
> > 
> > Peter
> > 
> 
> I must say again, totally awesome! :) I'm going to grab CVS right now
> and add your new iiwusynth.h file to it. Crossing my fingers..
>       Josh Green
> 
> 
> _______________________________________________
> iiwusynth-devel mailing list
> address@hidden
> http://mail.freesoftware.fsf.org/mailman/listinfo/iiwusynth-devel
> 





reply via email to

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