fluid-dev
[Top][All Lists]
Advanced

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

Re: [fluid-dev] Instrument names, selection etc. through the API


From: Element Green
Subject: Re: [fluid-dev] Instrument names, selection etc. through the API
Date: Sun, 3 Aug 2014 18:26:25 -0600

Hello,

I haven't used FluidSynth much myself for introspecting a SoundFont.  I wrote libInstPatch and Swami for this purpose,  which uses FluidSynth for synthesis, but does its own instrument handling.  libInstPatch in particular is a library designed for reading/writing/editing SoundFont and some other instrument type files.  You could use Swami too, to load up a SoundFont and browse it using a GUI, to answer some of your questions about what is in the SoundFont files you are looking at.

However, I did some poking around in the FluidSynth code, in particular I looked at the fluid_handle_inst() function in src/bindings/fluid_cmd.c (which is the command for displaying the presets in a SoundFont).  It looks like some of the functions are in public headers, but not all of them.  For example fluid_sfont_iteration_next() is defined in the private header at src/sfloader/fluid_sfont.h.  Its a simple macro though, which could theoretically be done from ones own code, although this seems pretty hackish to me.  But it would work.  Not sure why these weren't put in public headers to begin with, since they seem downright useful.

Best regards,

Element Green




On Sun, Aug 3, 2014 at 1:27 PM, Nikhil Nair <address@hidden> wrote:
Hi again,

Apologies, it looks like I didn't read enough of the documentation.  I've
got a solution by selecting the instrument, then using
fluid_synth_get_channel_info(), and looking at the name element of the info
structure.

I thought I'd now cracked it - until I found that, while this works with
fluid-soundfont-gm, all the names are blanbk when I do the same with
fluid-soundfont-gs.  Do I take it that names are simply missing from that
file?  Presumably I can't just assume that the same names apply to teh
corresponding program number in both...

Cheers,

Nikhil.



On Sun, 3 Aug 2014, Nikhil Nair wrote:

Hi,

I'm very new to both FluidSynth and MIDI in general, and I'm working out
how to do the basics (play notes, change instruments etc.).  The playing
notes part is fine, as it's well described in the documentation as well as
in the example program that comes with libfluidsynth-dev.

I've installed (on Ubuntu) fluid-soundfont-gm, and have found the SF2 file
in /usr/share/sounds/sf2/.  I presume I just pass that full pathname to
fluid_synth_sfload() - that's fine.

When it comes to changing instrument, I presume I use
fluid_synth_program_change().  However, there seem to be a few facilities
missing: for instance, is there no way to find out the text name of an
instrument, given its number - and hence no way to search for an instrument
with a given name, without first knowing its number?  Even leaving aside
doing this through the API, there's nothing I can find in the Ubuntu
package in terms of a list of instrument names.

Do I assume all such SF2 files define all instruments in the range 0-127?
There doesn't seem to be a function to get the maximum instrument number in
a bank.  Or do I just assume the call to fluid_synth_program_change() will
return FLUID_FAILED if that particular instrument number isn't defined?

Am I missing something major here - or even a whole number of things?

Thanks,

Nikhil.

_______________________________________________
fluid-dev mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/fluid-dev


_______________________________________________
fluid-dev mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/fluid-dev


reply via email to

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