libfluidsynth  2.4.6
Effect - IIR Filter

Functions for configuring the built-in IIR filter effect. More...

Enumerations

enum  fluid_iir_filter_flags {
  FLUID_IIR_Q_LINEAR = 1 << 0 ,
  FLUID_IIR_Q_ZERO_OFF = 1 << 1 ,
  FLUID_IIR_NO_GAIN_AMP = 1 << 2 ,
  FLUID_IIR_BEANLAND = 1 << 3
}
 Specifies optional settings to use for the custom IIR filter. More...
 
enum  fluid_iir_filter_type {
  FLUID_IIR_DISABLED = 0 ,
  FLUID_IIR_LOWPASS ,
  FLUID_IIR_HIGHPASS ,
  FLUID_IIR_LAST
}
 Specifies the type of filter to use for the custom IIR filter. More...
 

Functions

int fluid_synth_set_custom_filter (fluid_synth_t *, int type, int flags)
 Configure a general-purpose IIR biquad filter. More...
 

Detailed Description

Functions for configuring the built-in IIR filter effect.

Enumeration Type Documentation

◆ fluid_iir_filter_flags

Specifies optional settings to use for the custom IIR filter.

Can be bitwise ORed.

Enumerator
FLUID_IIR_Q_LINEAR 

The Soundfont spec requires the filter Q to be interpreted in dB.

If this flag is set the filter Q is instead assumed to be in a linear range

FLUID_IIR_Q_ZERO_OFF 

If this flag the filter is switched off if Q == 0 (prior to any transformation)

FLUID_IIR_NO_GAIN_AMP 

The Soundfont spec requires to correct the gain of the filter depending on the filter's Q.

If this flag is set the filter gain will not be corrected.

FLUID_IIR_BEANLAND 

Setting this flag causes the custom filter's cutoff frequency (fc) to dynamically adjust to the notes played, so that it is possible to filter at the same spot relative to the sound of the sample playing.

In this sense, the filter fc honors the key and pitch of a note relative to the sample's root_key: if the key of a note is 2 semitones above the sample's root_key and additionally it's pitched up by 30 cents, the cutoff frequency would be automatically adjusted by +230 cents. E.g. for horns, one can add an emphasis on tones that would "stick to" the horn as it played different notes (provided that these notes use the same sample). The enum is named after Robin Beanland, who has used this technique in Conker's Bad Fur Day and (together with other composers) in Jet Force Gemini, implemented by Mike Currington on the N64.

◆ fluid_iir_filter_type

Specifies the type of filter to use for the custom IIR filter.

Enumerator
FLUID_IIR_DISABLED 

Custom IIR filter is not operating.

FLUID_IIR_LOWPASS 

Custom IIR filter is operating as low-pass filter.

FLUID_IIR_HIGHPASS 

Custom IIR filter is operating as high-pass filter.

Function Documentation

◆ fluid_synth_set_custom_filter()

int fluid_synth_set_custom_filter ( fluid_synth_t synth,
int  type,
int  flags 
)

Configure a general-purpose IIR biquad filter.

Parameters
synthFluidSynth instance
typeType of the IIR filter to use (see fluid_iir_filter_type)
flagsAdditional flags to customize this filter or zero to stay with the default (see fluid_iir_filter_flags)
Returns
FLUID_OK if the settings have been successfully applied, otherwise FLUID_FAILED

This is an optional, additional filter that operates independently from the default low-pass filter required by the Soundfont2 standard. By default this filter is off (FLUID_IIR_DISABLED).