The DSP processsing in SwankyAmp is managed by the PushPullAmp
class which is included in this repository.
That class depends on classes which are auto-generated by FAUST using the faust DSP files included in this repository.
The repository also contains two scripts needed to build the FAUST generated classes,
and to calibrate the loudness of the overall PushPullAmp
.
- Python >= 3.5
- FAUST
- numpy
- scipy
- matplotlib
- faust2hpp
To build the headers, run python build-all.py dsp/
.
The headers will be generated in headers/
and can be copied directly into SwankyAmp's code base: cp headers/* ${SWANKY_AMP_ROOT}/Source/dsp
.
You can also create diagnostic plots during building by adding the --plot_dir=plots/
argument when running the build-all.py
script.
Those plots show transients during startup for the individual amp components, as well as their FFT response.
Calibration is a somewhat manual process. The steps are as follows:
- In
PushPullAmp::process
, setpreAmpScale
to1.0f
and comment out everything after thescaleBuffer
call following thetoneStack.process
call. - Run
python calibrate.py
- Copy the resulgint "pre amp sweep" values into the
PushPullAmp::preAmpSweepScales
array. - Revert the changes in
PushPullAmp::process
. - In
PushPullAmp::process
setpowerAmpScale
to1.0f
. - Run
python calibrate.py
- Copy the resulgint "power amp sweep" values into the
PushPullAmp::powerAmpSweepScales
array. - Revert the changes in
PushPullAmp::process
.
In effet this is enforcing that the signal doesn't change in RMS from the input to the output of the tone stack; and from the tone stack to the output of the power amp.
If you run python calibrate.py
after the calibration process,
you should find that the signal ratio remains near unity for all pre amp and power amp drive settings.
This is not perfect however since pre amp drive settings away from centre will compress the signal such that the power amp calibration is no longer correct.
Likewise playing with a very loud or quiet input signal will affect the calibration.