SOUnd TEmplate Library - C++ template library for sound generation and processing.
Currently available headers are:
addosc.h
Additive oscillator with up to 256 harmonicsallpass.h
Delay based allpass filterbiquad.h
Second order filters (lowpass, hipass, bandpass, bandreject, allpass, lowshelf, hishelf, peak)blosc.h
Band limited multishape oscillatorchebyshev.h
Chebyshev polynomials based waveshapercomb.h
Delay based comb filter (feedforward and feedback)cryptoverb.h
Allpass and comb filters based reverberationdelay.h
Delay with sample interpolationdescriptors.h
Audio descriptorsdistortions.h
A collection of distortions and overdrive algorithmsecaosc.h
Oscillator based on elementary cellular automatainterp.h
Interpolation algorithmslorenz.h
Lorenz attractor based oscillatorpdosc.h
Phase distortion oscillatorpulsar.h
Pulsar oscillatorrandsig.h
Random signal generator with controllable frequencyroessler.h
Rössler attractor based oscillatorsimpleosc.h
Simple non bandlimited multishape oscillatorsoutel.h
Utility header file that includes all the single modulesutils.h
Miscellaneous utility functions, such as unit conversion, zero padding, etc.window_functions.h
A series of window functionswtosc.h
Wavetable oscillator
To use the classes from this library, simply include the corresponding file(s). For example, let's create a bandlimited oscillator and filter its output using a lowpass filter.
First, include the necessary files and import the namespace:
#include "blosc.h"
#include "biquad.h"
using namespace soutel;
Next, instantiate the classes, providing optional arguments as needed:
BLOsc<double> oscillator(44100.0, 440.0); // Arguments: sample rate and frequency
Biquad<double> filter(44100.0, 880.0, 2.0, 1.0, BQFilters::lowpass); // Arguments: sample rate, cutoff frequency, Q factor, gain (for shelving filters), filter type
Finally, call the run()
function. For the bandlimited oscillator, which can produce different waveforms, you can either specify the desired waveform or pass variables to capture all the available shapes:
oscillator.run(); // Alternatively, pass four variables to run() to store the sine, triangle, saw, and square wave outputs
double filtered_sample = filter.run(oscillator.get_saw());
A more detailed tutorial is coming sometime soon. In the meanwhile, you can check how many of these classes are implemented in Max/MSP objects in my open source package sonus.