fluid-dev
[Top][All Lists]
Advanced

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

Re: [fluid-dev] No reverb, no chorus with 2.1.0


From: midi-pascal
Subject: Re: [fluid-dev] No reverb, no chorus with 2.1.0
Date: Sun, 16 Feb 2020 10:58:15 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1

On 2020-02-16 3:08 a.m., Tom M. via fluid-dev wrote:
I use an audio driver based on the fluidsynth_fx sample program
How exactly does your callback function look like? The fluidsynth_fx
example is slightly outdated. Since 2.0.0 it won't work for effects.
I'll update it. But unless you've adjusted the callback, it does not
really explain why 2.0.2 works for you.

Also, pls. which audio driver does fluidsynth use?



Tom

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

Hi Tom,

Here is my callback function (based on fluidsynth_fx.c sample program):

int ProcessBuffer(void *data, int len, int nfx, float **fx, int nout, float **out)
{
  fx_data_t* fx_data = (fx_data_t*) data;
  float *out_i;
  // Call the synthesizer to fill the output buffers with its audio output.
  fluid_synth_process(fx_data->synth, len, nfx, fx, nout, out);
  fx_data->fMeterValue[0] = 0.0f;
  fx_data->fMeterValue[1] = 0.0f;
  // Apply our effects here.
  for(int i = 0; i < nout; i++) {
    out_i = out[i];
    for(int j = 0; j < len; j++) {
      // Find the peak level for this buffer run.
      const float fValue = out_i[j];
      if (fx_data->fMeterValue[i & 1] < fValue)
        fx_data->fMeterValue[i & 1] = fValue;
    }
  }
  return FLUID_OK;
}

While debugging I see that nfx is always 0 and fx is NULL.

I read carefully the fluid_synth_process() documentation and the sample code in fluidsynth_process.c, so I did a small change in my callback by adding:

  nfx = nout;
  fx = out;

just before the call to fluid_synth_process() and the reverb works now (no chorus but my app does not use it anyway). I am not sure if my fix is the right way to go, but it works (half).

With 2.0.2, the reverb worked once but I could not reproduce afterwards probably because my code is under construction and changes a lot.

The audio driver I use is pulseaudio.

Regards,

Pascal




reply via email to

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