iiwusynth-devel
[Top][All Lists]
Advanced

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

Re: [iiwusynth-devel] Improved SoundFont API


From: Josh Green
Subject: Re: [iiwusynth-devel] Improved SoundFont API
Date: 20 Dec 2002 10:38:41 -0800

On Fri, 2002-12-20 at 02:41, Peter Hanappe wrote:
> 
> Hi all,
> 
> I'd like to propose some changes to the soundfont API. This concerns
> mainly Josh and Antoine. The current API is, to be honest, ugly.
> I'd like to simplify things a bit.
> 
> First, the iiwu_sfloader_t, iiwu_sfont_t, and iiwu_preset_t types are
> made completely opaque, so soundfont developers can cast any structure
> to it.
> 
> Second, the soundfont loader registers the interface functions to the
> the synthesizer only once. There's no longer a need to allocate a
> iiwu_preset_t structure for every preset as is currently the
> case. This registration is like registering three classes and a loader
> instance. Details below.
> 
> Does this seems like a worthy improvement?
> 

Yes it does, and was something that occured to me as well (as far as
having to create an interface for every preset).

One thing that I think could still be improved is relating to iterating
over presets. I currently have this disabled, because it requires that I
keep a variable internally for every SoundFont/FluidSynth instance. I
could just go ahead and do this, but it might be nicer to have the
caller (FluidSynth in this case) keep track of its own position in a
preset iteration.

>    /** Start the iteration of the presets */
>    void (*iteration_start)(iiwu_sfont_t* sfont);
> 
>    /* return 0 when no more presets are available, 1 otherwise */
>    int (*iteration_next)(iiwu_sfont_t* sfont, iiwu_preset_t* preset);

Do you think this could be just the "iteration_next" function but like
this:

int (*iteration_next)(iiwu_sfont_t* sfont, iiwu_preset_t** preset);

An iteration could be started by calling this function with NULL in the
preset field. Subsequent calls should have this field set to the preset
to get the next preset of (an input/output parameter). Since there is a
user defined variable in the preset, it makes it easy on my end of
things.

> Cheers,
> Peter
> 

Lates..
        Josh Green




reply via email to

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