#include <stdio.h>
#include <stdlib.h>
#include <fluidsynth.h>
struct fx_data_t
{
float gain;
} fx_data_t;
int fx_function(void *data, int len,
int nfx, float **fx,
int nout, float **out)
{
struct fx_data_t *fx_data = (struct fx_data_t *) data;
int i, k;
if(fx == 0)
{
{
}
}
else
{
{
}
}
for(i = 0; i < nout; i++)
{
float *out_i = out[i];
for(k = 0; k < len; k++)
{
out_i[k] *= fx_data->gain;
}
}
for(i = 0; i < nfx; i++)
{
float *fx_i = fx[i];
for(k = 0; k < len; k++)
{
fx_i[k] *= fx_data->gain;
}
}
}
int main(int argc, char **argv)
{
int err = 0;
struct fx_data_t fx_data;
if(argc != 3)
{
fprintf(stderr, "Usage: fluidsynth_simple [soundfont] [gain]\n");
return 1;
}
if(settings == NULL)
{
fprintf(stderr, "Failed to create the settings\n");
err = 2;
goto cleanup;
}
if(synth == NULL)
{
fprintf(stderr, "Failed to create the synthesizer\n");
err = 3;
goto cleanup;
}
{
fprintf(stderr, "Failed to load the SoundFont\n");
err = 4;
goto cleanup;
}
fx_data.synth = synth;
fx_data.gain = atof(argv[2]);
if(adriver == NULL)
{
fprintf(stderr, "Failed to create the audio driver\n");
err = 5;
goto cleanup;
}
printf("Press \"Enter\" to stop: ");
fgetc(stdin);
printf("done\n");
cleanup:
if(adriver)
{
}
if(synth)
{
}
if(settings)
{
}
return err;
}