Audio DSP plugs ported to new API, with new and better EQ

I’m now done porting all the older audio plugs to a new approach which uses presets (kinda like shaders). Also changed the volume plugin (redundant now with volume option in RGUI) to a panning plugin which allows you to configure a stereo channel matrix. (E.g. stereo to mono, channel flipping, volume, Stereo to Mono + Difference and back, etc.

Obviously, the presets can combine multiple DSPs. See the respective “default” .dsp plugs for help on which parameters are supported by the individual dsps. DSPs can be configured per-name, or per index (if multiple instances of same DSP is used).

E.g. BassBoost.dsp.


filters = 2
filter0 = iir
filter1 = panning

iir_gain = 10.0
iir_type = BBOOST
iir_frequency = 200.0

# Avoids clipping.
panning_left_mix = "0.3 0.0"
panning_right_mix = "0.0 0.3"

The biggest change for the plugins is the EQ plugin. In the older implementation it had a fixed number of bands and the filter generation was rather inflexible. The new approach allows the filter to be designed directly in the frequency domain with arbitrarely many “bands”. To verify the response of the EQ, the full impulse response can be dumped to a file as well and studied in something like Octave or Matlab.

For example:


filters = 1
filter0 = eq

eq_frequencies = "0 500 1000 2000 5000"
eq_gains = "6 0 -10 0 10"
eq_impulse_response_output = "/tmp/eq_impulse.txt"

6 dB gain at 0 Hz, 0 dB at 500 Hz, etc … The response between these sampling points are simply interpolated.

Using Octave or Matlab to plot response:


f = fopen('/tmp/eq_impulse.txt');
l = textscan(f, '%f');
res = l{1};
freqz(res, 1, 4096);

(Nyquist is 16 kHz since I tested on FCEUmm).

The response won’t exactly match up due to a windowing that happens after inverse fourier transform in order to avoid tons of ripple. This behavior can be finetuned if desired though if accuracy or less ripple is desired. Alternatively a larger block size can be used, but I don’t recommend that.

Due to the extreme flexibility DSP plugs tend to require in configuration, direct support for that won’t be added to RGUI. All major DSP plugin APIs let plugins create and run their own GUIs in separate windows, which is way out there for something like RGUI which has to be able to run in something bare-bones like KMS or consoles.

Very nice, I can’t wait to play around with these, escpecially the eq as it now does exactly what I needed it to do instead of before where I had one eq plugin compiled with the frequency & configs for arcade games and another compiled for consoles.