Skip to content

Commit

Permalink
fc -= 500
Browse files Browse the repository at this point in the history
  • Loading branch information
derselbst committed Sep 21, 2024
1 parent 203fa46 commit 016d5de
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/synth/fluid_synth.c
Original file line number Diff line number Diff line change
Expand Up @@ -7661,6 +7661,9 @@ calc_awe32_filter_q(int data, fluid_real_t* fc)

// linearly interpolate between high and low Q
return 10 * /* cB */ (tab->q_lo * (1.0f - alpha) + tab->q_hi * alpha);

// alternatively: log interpolation
// return 10 * /* cB */ FLUID_POW(tab->q_hi, alpha) * FLUID_POW(tab->q_lo, 1.0f - alpha);
}

/**
Expand Down Expand Up @@ -7830,10 +7833,12 @@ static void fluid_synth_process_awe32_nrpn_LOCAL(fluid_synth_t *synth, int chan,
coef = synth->channel[chan]->awe32_filter_coeff;
if(sf2_gen == GEN_FILTERFC)
{
// The cutoff at fc seems to be very steep for SoundBlaster! hardware. Listening tests have shown that lowering the cutoff frequency by 500Hz gives a closer signal to the SB! hardware filter...
converted_sf2_generator_value -= 500;
if(coef != -1)
{
q = calc_awe32_filter_q(coef, &converted_sf2_generator_value);
FLUID_LOG(FLUID_INFO, "AWE32 IIR Fc (fixed): %f cents", converted_sf2_generator_value);
FLUID_LOG(FLUID_INFO, "AWE32 IIR Fc (fixed): %f Hz", converted_sf2_generator_value);
FLUID_LOG(FLUID_INFO, "AWE32 IIR Q: %f cB", q);

converted_sf2_generator_value = fluid_hz2ct(converted_sf2_generator_value /* Hz */);
Expand Down

0 comments on commit 016d5de

Please sign in to comment.