the C* Audio Plugin Suite
Version 0.9.16 · August 2013
The C* Audio Plugin Suite comprises a range of classic sound effects and a few more basic audio DSP units, signal and noise generators. The suite's aim is to provide impeccable sound quality, computational efficiency and no perceptible latency.
The discerning digital guitarist finds in CAPS a selection of processors recreating key aspects of the formation of tone in traditional electronic instrument amplification.
CAPS is developed by Tim Goetze, except for the ToneStack plugin by David T. Yeh. Ideas, tools, concepts, examples and suggestions from numerous sources have been vital to the project; for a comprehensive list see the references.
Being a LADSPA[ladspa]wp library, CAPS is concerned with audio manipulation only and does not offer any sort of user interface. Thus, it is in principle not bound to a particular operating system or architecture. However, most compatible host applications will be found on Linux systems.
Some features of CAPS are designed to make use of vector arithmetic. When compiled for a CPU without hardware acceleration, the resulting binary is often found to be slower than equivalent code explicitly designed for scalar arithmetic.
CAPS for Electric Guitar
To produce a workable digital audio stream from an electric guitar, it is essential that the instrument is connected through a high-quality high-impedance input device.
The simplest recommended virtual amplification setup consists of
If sound quality suffers from poor shielding, the NoiseGate plugin may help.
CPU load depends slightly on the character of the input signal but will occasionally vary greatly with parameter choices. For example, doubling the oversampling ratio implies doubling the computational load of a major part of the total arithmetic performed.
Oversampled plugins have a latency roughly equivalent to the number of filter taps divided by the oversampling ratio. For example, 4x oversampling with 32-tap filters results in 8 samples of latency.
All other plugins have a latency of zero unless noted otherwise.
The CAPS plugins can be run – and should sound roughly the same, except where noted – at any sample rate up to 192 kHz. The recommended range of operation however is at 44.1 or 48 kHz.
To prevent 'zipper' noise, some control inputs are smoothened by sweeping internal parameters. The duration of this sweep will vary with the audio system setup. For realtime use in most host applications it is equal to the audio processing block size (the 'frames per period' in jackd[jackd] terms). As a consequence, control adjustments recorded with a sequencer can result in subtle sound differences when played back with a different block size.
All plugins are extensively tested to verify that no denormal numbers are produced. Naturally, these tests cannot exhaust all possible plugin parameter combinations. While regarded as unlikely, it is not impossible that an unfortunate combination of parameters or circumstances may still give rise to denormals.
#define LADSPA_PORT_GROUP 16
on LADSPA_PortDescriptor to denote ports which start a logical group.
Where applicable, units are appended to the respective control labels in parentheses following a single space character, for example "gain (dB)". Host applications might think it favourable to strip the unit from the control's label and attach it to the representation of its value instead, e.g. "gain: -6 dB".
CAPS Version Query
Regrettably, any part or feature of CAPS may change in new releases, sometimes even change drastically or be removed entirely, for the greater good of readily realisable improvements. In particular, it would be unwise to expect port ordering and naming to be consistent between releases.
Since version 0.9, applications relying on a particular release can query:
void * h = dlopen ("/path/to/caps.so", RTLD_LAZY); /* assuming h is valid */ const short * caps = (const short *) dlsym (h, "CAPS_version"); if (caps) printf ("found caps version %hd.%hd.%hd\n", caps, caps, caps);
Host applications are encouraged to use this information to form a persistent plugin identifier, should one be needed.
If you think you have found a bug in CAPS, or if you want to make a related or unrelated remark or inquiry please write to firstname.lastname@example.org.
Please do not send patches without asking first. By submitting a patch, you claim sole authorship and agree that your submission becomes mine to use in any way I see fit, in exchange for no obligation on my part except attribution in the CAPS documentation.
Attenuate hum and noise
This plugin aims to reduce undesirable background noise and hum in otherwise silent passages.
When the signal's instantaneous amplitude exceeds the opening threshold, the gate is opened. The time it takes until the gate is fully open can be set with the attack control. As soon as the signal's RMS power level drops below the closing threshold, the gate closes. This takes a fixed time of 20 ms; closed gate attenuation is 60 dB.
To cope with powerline hum as often present in signals from electric guitars, a notch filter can be activated by setting the mains frequency control to a non-zero value. The filter will prevent this frequency from contributing to the signal power measurement. This allows a low closing threshold setting without mains hum keeping the gate open unduly. The default mains setting is 50 Hz.
Compressor and saturating limiter
Frequency response, default settings, fs=48 kHz
This compressor has been designed primarily to create natural-sounding sustain for the electric guitar without sacrificing its brightly percussive character. However, it appears to apply well to a variety of other sound sources, and with CompressX2 a stereo version is available as well.
To be able produce strong compression and still maintain a natural sound, the design catches (attack-phase) power spikes with a soft saturation circuit, converting them into additional harmonic content and enforcing a strict limit on the output level. Saturating operation is the default setting of the mode control. Three anti-aliasing options are available, 2x oversampling with 32-tap filters and 4x with 64 and 128 taps.
The measure control select which indicator of loudness to base calculations on: peak – instantaneous amplitude – measurement allows the unit to react very quickly, while rms – root mean square power – is of a gentler kind.
Compression amount is controlled through the strength knob, from 0 effectively disabling the effect, up to a maximum ratio of 16:1. The attack and release controls map higher values to slower reactions.
Stereo compressor and saturating limiter
This stereo version of Compress applies uniform compression to both channels in proportion to their combined power.
Classic amplifier tone stack emulation
This emulation of the tone stack of a traditional Fender-design instrument amplifier has been devised and implemented by David T. Yeh[yeh06], with subsequent expansion to include more models by Tim Goetze.
Due to the nature of the original circuit, the bass, mid and treble controls are not operating independently as in a modern three-way equaliser.
All but the last model are using the procedural implementation with continuously updated direct form II filters and sample rate independency. It must be noted that the "DC 30" preset has been included despite the slight difference in topology between the British original and the Fender circuit.
The "5F6-A LT" model is using the lattice filter implementation mentioned in [yeh06], operating on precomputed simulation data for 44.1 kHz.
Idealised guitar amplification
Frequency response with default settings
Output for 250 Hz sine wave input, default settingsSpectrum of the sine wave output
Tracing the stages of a typical tube amplifier circuit, this plugin aims to recreate those features of traditional guitar amplification electronics that have proved musically useful, and to provide them with the most musical rather than the most authentic ranges of adjustment and character. CabinetIV provides matching recreations of loudspeaker cabinets.
The processor consists – with some interconnections – of a configurable lowcut input filter, a ToneStack circuit of the procedural variant, a saturating 'preamp' stage with adjustable gain and variable distortion asymmetry followed by the bright filter, compression characteristics determined by the attack and squash controls and finally a 'power amp' stage with the amount of saturation depending on both gain and power settings.
Sound quality and computational load can be balanced with the over control affording a choice of 2x or 4x oversampling with 32-tap filters, or 8x with 64 taps. Lower quality settings will sound slightly grittier and less transparent, and at high gain aliasing may become audible.
Idealised loudspeaker cabinet
Sample impulse responseSpectrum at fs=44.1 kHz
This plugin applies an acoustic instrument body modeling technique[bank07] to recreate the timbre-shaping of an electric instrument amplifier's speaker cabinet. Nonlinear effects occurring in physical speakers under high load[yeh08] are not emulated.
A selection of several hundred response shapes automatically created in the likeness of classic cabinets has been narrowed down to a handful of idealised tones. As with AmpVTS, which provides a matching recreation of traditional guitar amplification, the design and selection process has been ruled by musicality over fidelity.
The filter banks implemented are 64 2nd order IIR and one 128-tap FIR in parallel. Their parameter presets are shared between the 44.1 and 48 kHz sample rates, the higher rate implying that timbre brightens up. Higher sample rates produce the same tones by rate conversion, up to 192 kHz.
Despite the complexity, computational load is very modest thanks to vector arithmetic if a hardware implementation is available – if not, however, the load will be easily an order of magnitude higher, and possibly found to be prohibitive on less powerful hardware.
Versatile plate reverb
Impulse response mixed to mono
This reverb processor is an adaptation of the design discussed in [dat97a]. Tuned for a soft attack and smooth ambience, it consists of a network of twelve delay lines of varying length. At its heart, two of these are modulated very subtly, in a chorus-like fashion.
The bandwidth control reduces high-frequency content before it enters the 'tank', while damping controls how quickly the reverberating tail darkens.
Versatile plate reverb, stereo inputs
This version of the Plate reverberator comes with stereo inputs.
Various overdrive models, 8x oversampled
Output for 250 Hz sine wave input at 24 dB gain and bias 0.3Spectrum of the above
Please note that this plugin embodies a very basic building block of audio DSP, not an elaborate effect that will be pleasing to hear right away. To turn saturation into a musically useful effect it is usually combined with some sort of filtering and dynamics modulation.
The mode control chooses from a selection of clipping functions of varying character. Even-order harmonics can be added with the bias setting. Towards the maximum, sound will start to get scratchy and eventually starve away.
The plugin is 8x oversampled with 64-tap polyphase filters, effectively suppressing aliasing noise for most musical applications. Changes to the bias control induce short-lived energy at DC in the output. In order to reduce the computational load incurred when evaluating transcendental functions at eight times the nominal sample rate, these are approximated roughly, using Chebyshev polynomials whose coefficients depend on the amplitude's floating point representation exponent.
Not an exciter
Harmonic synthesis for mixed 100 and 150 Hz sine input, note the appearance of the fundamental at 50 Hz
This effect plugin is useful when more bass register definition or more treble presence is called for and generic equalisation does not work without noticeably raising the signal or noise level. A common application is refreshing of material that has been subjected to low-quality analog transmission.
Bass and treble portions of the signal are isolated using two 24 dB/octave Linkwitz-Riley crossover networks[lr76] to ensure a flat frequency response at zero effect intensity (controlled through the .gain settings). After compression, a polynomial waveshaper synthesises the first three overtones of the bass register. This enhances the perception of the fundamental frequency, being the difference tone of these harmonics. Treble band processing applies analog-style saturation with only simplistic antialiasing. Synthesised harmonic content is shaped through bandpass and highpass filters and mixed back into the crossover sum signal.
A stereo version is available as SpiceX2.
Not an exciter either
A standard mono chorus with optional feedback. The parameter range suits subtle effects as well as all-out flanging.
Modifying the delay time t when feedback is active will cause audible 'zipper' noise.
This take on the classic effect features two modulation choices, traditional sine-based periodicity or smoothened fractal oscillation.
Very high resonance settings can cause self-oscillation peaking in excess of 0 dB.
Modulated filter cascade
A versatile selection of filters of varying character in band- and lowpass configuration. The cutoff frequency can be modulated by both the input signal envelope and by a fractal oscillator. The default settings provide some sort of an automatic wah effect.
The extent of filter modulation is set through the range parameter. The shape of the modulation is mixed from the attractor and the envelope according to the lfo/env balance.
Filter stage gain can be used to add inter-stage saturation. To prevent this from causing audible aliasing, the plugin can be run in oversampled mode, at ratios selectable through the over control.
At very high Q and f combined, the filter stability may become compromised. Computational load varies greatly with the over and filter settings.
Stereo delay with chromatic resonances
A stereo delay with resonant filters and fractally modulated panning.
The delay times are set through the bpm control and the divider adjustment. Triplet and sixteenth settings create a dotted rhythm. With every beat, the filter resonance frequencies are retuned to random steps on an equal-tempered chromatic scale, to the reference set through the tune control.
A classic octave-band biquad-filter design, basically a direct digital translation of the analog original. There's also a stereo version (Eq10X2).
Frequency bands centered above Nyquist are automatically disabled.
Stereo 10-band equaliser
The controls of this stereo version of Eq apply to both channels.
4-band parametric equaliser
a.f=240 a.Q=.9 a.gain=-4 b.Q=.8 b.gain=24 c.f=900 c.Q=.99 c.gain=-24 d.gain=24
Four adjustable biquad filters in series, in a vector arithmetic implementation. The default setup is an identity filter with a mode configuration of lowshelve, band, band, hishelve, all at zero gain.
The Q control value maps non-linearly to actual filter Q: a zero control value results in filter Q of ½, a value of 0.3 corresponds to a Butterworth-equivalent Q of ½√2, and the maximum control setting of 1 results in a filter Q of 50.
Parallelisation of the serial filter topology causes its response to lag by three samples.
Control response is smoothened by crossfading between two filter banks.
Stereo image synthesis
Left and right output channels at maximum width
In addition to provoding a basic panorama control, a perception of stereo width is created using complementary filters on the two output channels.
The output channels always sum to a flat frequency response.
The design of this plugin owes to the Orban 245F Stereo Synthesizer[orban93].
Stereo image width reduction
This plugin reduces the width of a stereophonic signal. Its primary use is for preventing fatigue from listening to 'creatively panned' music on headphones.
Mid/side processing tends to sound more transparent for moderate strength settings. However, it will more strongly attenuate signals that are panned to the far sides of the stereo image (rarely encountered in contemporary music production anymore but quite common, for example, on early Beatles recordings or others from that time).
Sine wave generator
The old friend, indispensable for testing and tuning.
Mostly white pseudonoise, mixed and filtered from the output of two Dattorro multibit generators[dat02].
Audio stream from deterministic chaos
lorenz, only x (y similar)lorenz, only zlorenz, default parametersroessler, only x (y similar)roessler, only zroessler, default parameters
This plugin turns the oscillating state of a fractal attractor into an audio stream. The result is something that most would without much hesitation classify as noise.
The Rössler system[roessler76] is similar but contains only one non-linearity.
The x, y and z controls set the amplitude of the respective variables of the attractor state in the output audio signal.
The attractor state variables are scaled and translated to stay mostly within the [-1,1] range and not contain a DC offset. Nevertheless, due to the unpredictable nature of the systems, peak limits cannot be guaranteed. In addition, some energy near DC may be produced; therefore a configurable high-pass filter is part of the circuit. It can be turned off by setting the hp parameter to zero.
The output signal varies with the sample rate.
Spectrum of default clickbeep model
A sample-accurate metronome. Two simplistic modal synthesis models are available for the click: box is a small wooden box struck with a soft wooden mallet, stick a scratchy stick hit. In addition, there's also a very synthetic beep, and finally dirac, a very nasty single-sample pulse of 0 dB amplitude and little immediate musical use.
All click sounds are synthesised once when the plugin is loaded and then played back from memory.
Chief Executive Oscillator
The Chief Executive Oscillator forever calls for more profit.
Sound data created with the flite[flite] application.
CAPS comes with no guarantees, in particular no guarantee of fitness for a particular purpose.
The library is available here in source code, under the terms of the
GNU Public License,
To build from source code, a modern UNIX environment with the GNU C++ compiler[gcc] is required.
$ tar xfj caps_0.9.16.tar.bz2 $ cd caps-0.9.16 $ ./configure.py $ make $ sudo make install
On compatible Linux systems, configure.py enables the use of SSE instructions to provide hardware acceleration for vector arithmetic.OSX builds are configured to contain both 32- and 64-bit code.
0.9.16 * NoiseGate simplified, sped up, gain lowpassed, click bug eliminated * Sin smoothened, defaults updated * PhaserII defaults updated * Fractal defaults updated * documentation polish 0.9.15 * no-vector-arithmetic compilation fixed 0.9.14 * AutoFilter x/y parameter eliminated * Fractal hp changed to be configurable, attractors recalibrated * documentation polish 0.9.13 * Eq4p softens drastic parameter changes by crossfading static filters * Eq4p employing single v4f filter, slightly quicker * Eq4p 'off' filter mode * documentation and interface polish
References and Acknowledgements
Tim Goetze would like to express his gratitude to David T. Yeh for the ToneStack contribution and related discussion, to Sampo Savolainen, Klaus Tenner, Fons Adriaensen, Pete Leigh, Paul Davis, Paul Winkler, Damon Chaplin, Jonathan Liles and Niclas Wretström for discussion, and to:
"Direct Design of Parallel Second-Order Filters for Instrument Body Modeling",
Jon Dattorro, "Effect Design Part III: Oscillators: Sinusoidal and Pseudonoise",
Jon Dattorro, "Effect Design Part I: Reverberator and Other Filters",
Jon Dattorro, "Effect Design Part II: Delay-Line Modulation and Chorus",
"flite: a small simple speech synthesizer",
Richard Stallman and contributors,
Thomas Williams, Colin Kelley and many others,
Steve Hollasch, "IEEE Standard 754 Floating Point Numbers", 2005
Paul Davis and contributors,
Richard W.E. Furse, Paul Barton-Davis, Stefan Westerfeld,
Edward N. Lorenz, "Deterministic Nonperiodic Flow",
Siegfried Linkwitz, "Active Crossover Networks for Noncoincident Drivers",
John W. Eaton and contributors,
Guido van Rossum and collaborators,
Robert Bristow-Johnson, "Cookbook formulae for audio EQ biquad filter coefficients"
O.E. Rössler, "An Equation for Continuous Chaos",
Sean Eron Anderson, "Bit Twiddling Hacks",
Laurence W. Nagel and D.O. Pederson,
"SPICE (Simulation Program with Integrated Circuit Emphasis)",
Perry R. Cook and Gary P. Scavone,
Steve W. Harris,
D.T. Yeh and J.O. Smith,
"Discretization of the '59 Fender Bassman Tone Stack",
D.T. Yeh, B. Bank, and M. Karjalainen,
"Nonlinear modeling of a guitar loudspeaker cabinet",