[Csnd] problem using Soundfonts

(i still can't use Nabble, so i have to reply via heanet, there is no reply option)

few days ago i filed an issue as i seem to have lost the ability to use the Flyuidsynth opcodes as well.
Here is the link: trouble playing Fluid opcodes · Issue #1424 · csound/csound · GitHub
and your problem look a lot like mine.

It might have to do with a change in the API of Fluidsynth 2. But i am not a developer.

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        Issues · csound/csound · GitHub
Discussions of bugs and features can be posted here

There was a minor but breaking change in the FluidSynth API with version 2. The difference is shown in this code from opcodes/fluidOpcodes.cpp:

#if (FLUIDSYNTH_VERSION_MAJOR >= 2)
// TODO: Change -1 to a configurable FX group?
fluid_synth_chorus_on(fluidSynth, -1, chorusEnabled);
fluid_synth_reverb_on(fluidSynth, -1, reverbEnabled);
#else
fluid_synth_set_chorus_on(fluidSynth, chorusEnabled);
fluid_synth_set_reverb_on(fluidSynth, reverbEnabled);
#endif

I have not been able to figure out how to get the Csound build to detect the FluidSynth version. Perhaps somebody else can do that. In the meantime, you can do a local build with the correct function for your version of FluidSynth. Just edit fluidOpcodes to use the correct FluidSynth API or version, for example if you have version 2:

#define FLUIDSYNTH_VERSION_MAJOR 2
#if (FLUIDSYNTH_VERSION_MAJOR >= 2)
// TODO: Change -1 to a configurable FX group?
fluid_synth_chorus_on(fluidSynth, -1, chorusEnabled);
fluid_synth_reverb_on(fluidSynth, -1, reverbEnabled);
#else
fluid_synth_set_chorus_on(fluidSynth, chorusEnabled);
fluid_synth_set_reverb_on(fluidSynth, reverbEnabled);
#endif

If you don’t want to build Csound yourself, then uninstall FluidSynth and find an earlier version of FluidSynth to reinstall.

Hope this helps,
Mike

thanks all,

at Menno:
thanks for confirming i'm not a total idiot!
(and for your work on manual).

at Michael:

i tried your suggestion but bulding Csound i get this:

/home/fra/csound/Opcodes/fluidOpcodes/fluidOpcodes.cpp: In member function 'int32_t FluidEngine::init(CSOUND*)':
/home/fra/csound/Opcodes/fluidOpcodes/fluidOpcodes.cpp:123:3: error: 'fluid_synth_chorus_on' was not declared in this scope; did you mean 'fluid_synth_set_chorus_on'?
123 | fluid_synth_chorus_on(fluidSynth, -1, chorusEnabled);
> ^~~~~~~~~~~~~~~~~~~~~
> fluid_synth_set_chorus_on
/home/fra/csound/Opcodes/fluidOpcodes/fluidOpcodes.cpp:124:3: error: 'fluid_synth_reverb_on' was not declared in this scope; did you mean 'fluid_synth_set_reverb_on'?
124 | fluid_synth_reverb_on(fluidSynth, -1, reverbEnabled);
> ^~~~~~~~~~~~~~~~~~~~~
> fluid_synth_set_reverb_on

at John:

--Csound version 6.15 (double samples) Feb 1 2021
[commit: d6a7e152488cb42dab47eb31396fa917d5af2f81]

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        Issues · csound/csound · GitHub
Discussions of bugs and features can be posted here

Hello again,

so i have installed fluidsynth version 1.1.11 from source (changing library path to /usr/local/lib instead of /usr/local/lib64) and then rebuild Csound and it seems that fluidsynth opcodes are working.

Now i have to verify if i have broken some other software using libfluidsynth ...

Anyway,

Thanks all,

ciao,

francesco.

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        Issues · csound/csound · GitHub
Discussions of bugs and features can be posted here

In my tree I have /usr/include/fluidsynth/version.h
which includesthe definitions

#define FLUIDSYNTH_VERSION "1.1.11" /**< String constant of libf
luidsynth version. */
#define FLUIDSYNTH_VERSION_MAJOR 1 /**< libfluidsynth major version integer
constant. */
#define FLUIDSYNTH_VERSION_MINOR 1 /**< libfluidsynth minor version integer
constant. */
#define FLUIDSYNTH_VERSION_MICRO 11 /**< libfluidsynth micro version integer
  constant. */

Are they not also in fluidsynth2?

They are, I think, but this was not enough for the conditional compilation to succeed.