SynthLab SDK
synthbase.h File Reference

See also Designing Software Synthesizers in C++ 2nd Ed. by Will Pirkle. More...

#include <cmath>
#include <random>
#include <string>
#include <sstream>
#include <vector>
#include <stdint.h>
#include <memory>
#include <algorithm>
#include <map>
#include "synthstructures.h"
#include "synthlabparams.h"

Go to the source code of this file.

Classes

struct  SynthLab::DMConfig
 
class  SynthLab::AudioBuffer
 Encapsulates the audio buffering requirements of any module that uses audio samples for input and/or output. More...
 
class  SynthLab::SynthClock
 Compact modulo counter with wrapping used as the timebase for all oscillators. More...
 
class  SynthLab::Timer
 Ultra compact timer object that is used for many different functionalities. More...
 
class  SynthLab::XFader
 Crossfades two values (from A to B) More...
 
class  SynthLab::XHoldFader
 Crossfades two values (from A to B) and then holds B for some amount of time. More...
 
class  SynthLab::SlewLimiter
 Implements a simple slew limiter using a one pole lowpass filter. More...
 
class  SynthLab::Synchronizer
 This is a very specialized object that performs the hard-sync operation using two SynthClocks. More...
 
class  SynthLab::RampModulator
 This is a tiny modulator object that produces an output that ramps up or down linearly between two values over a specified time in milliseconds. More...
 
class  SynthLab::GlideModulator
 Specialized version of the RampModulator, with nearly identically named functions to peform the portamento operation (aka glide modulation) More...
 
class  SynthLab::NoiseGenerator
 Simple object that generates white, gaussian white or pink noise. More...
 
class  SynthLab::IModulator
 Interface for modulator objects. More...
 
class  SynthLab::IWavetableSource
 Interface for wavetable sources. More...
 
class  SynthLab::IWavetableDatabase
 Interface for wavetable databases. More...
 
struct  SynthLab::PCMSampleOutput
 Holds the audio output samples from reading a PCM sample file. More...
 
class  SynthLab::IPCMSampleSource
 Interface for PCM sample sources. More...
 
class  SynthLab::IPCMSampleDatabase
 Interface for PCM sample databases. More...
 
class  SynthLab::IMidiInputData
 Interface for a MIDI input data object. More...
 
struct  SynthLab::FilterOutput
 Holds an array of filter output values; SynthLab filters can produce multiple outputs at once. For example, the 1st order VA filter produces 1st order LPF, HPF and APF output samples in the same render() function. More...
 
class  SynthLab::IFilterBase
 Simple interface for SynthLab filters. More...
 
struct  SynthLab::CoreProcData
 This structure holds all of the information needed to call functions on a ModuleCore object. This structure must contain datatypes that are basic C++ types or structures of them, and can not contain anything from the std:: library. More...
 
struct  SynthLab::SynthLabTableSet
 This structure defines a set of wavetables that are usually found in .h files and compiled into the synth. This structure is used specifically with wavetables that are made with RackAFX-TableMaker utility functions, that can encode tables in hex format for storage without needing fractional decimal representation. More...
 
struct  SynthLab::SynthLabBankSet
 This super-structure holds a set of SynthLabTableSet called a "bank" and used in the morphing wavetable core to register and install these tables with the database. More...
 
struct  SynthLab::StaticWavetable
 Structure for holding information about a static wavetable, that is read from a static location, either compiled into the synth as a resource, or from a binary data file at startup time. More...
 
struct  SynthLab::DynamicWavetable
 Structure for holding information about a static wavetable, that is read from a static location, either compiled into the synth as a resource, or from a binary data file at startup time. More...
 
struct  SynthLab::WavetableDatabase
 Object that acts as the wavetable database, as shared synth-wide resource. You should study this especially if you want to implement your own database with your own wavetable formats, etc... More...
 
struct  SynthLab::PCMSampleDatabase
 Object that acts as the PCM sample database, as shared synth-wide resource. You should study this especially if you want to implement your own database with your own PCM sample formats, etc... More...
 
class  SynthLab::SynthProcessInfo
 This structure holds all of the information needed to for the plugin framework to send MIDI information into the engine, and receive rendered audio samples that result. More...
 
class  SynthLab::MidiInputData
 Holds all MIDI input data values. More...
 
class  SynthLab::Modulators
 Implements a modulator object. More...
 
class  SynthLab::ModuleCore
 Abstract base class that encapsulates functionality of a module core; used with the Module-Core paradigm. More...
 
class  SynthLab::SynthModule
 Abstract base class that encapsulates functionality of a module; used with the Module-Core paradigm. More...
 
class  SynthLab::CircularBuffer< T >
 The CircularBuffer object implements a simple circular buffer. It uses a wrap mask to wrap the read or write index quickly. More...
 
class  SynthLab::DelayLine
 
struct  SynthLab::BQCoeffs
 Structure to hold the seven coeffieicents used in the AudioFilter object from Designing Audio Effects Plugins in C++ 2nd Ed. by Will Pirkle. More...
 
class  SynthLab::BQAudioFilter
 Simple version of the AudioFilter object from Designing Audio Effects Plugins in C++ 2nd Ed. by Will Pirkle that impelments a biquad audio filter. More...
 
class  SynthLab::FracDelayAPF
 Implements a first order APF that is used to generate a fractional delay for the physcial model of a string. More...
 
class  SynthLab::ResLoopFilter
 Implements a first order feedforward LPF with coefficients a0 = a1 = 0.5. More...
 
class  SynthLab::DCRemovalFilter
 Implements a first order HPF with fc = 2.0Hz. More...
 
class  SynthLab::TinyBPF
 Implements a simple 2nd order BPF. More...
 
class  SynthLab::LP2Filter
 Implements a simple 2nd order LPF. More...
 
class  SynthLab::HP2Filter
 Implements a simple 2nd order HPF. More...
 
class  SynthLab::TinyReson
 Minute implementation of a 2nd order resonator filter. More...
 
class  SynthLab::LowShelfFilter
 Implementation of a low shelving filter. More...
 
class  SynthLab::HighShelfFilter
 Implementation of a high shelving filter. More...
 
class  SynthLab::ParametricFilter
 Implementation of a constant-Q parametric EQ filter. More...
 
class  SynthLab::LP1PFilter
 Implementation of a one-pole LPF. More...
 
class  SynthLab::PluckPosFilter
 Comnination of three filters in one; note that the figure in the book does not show the variety of connection combinations and filter bypassing possible, nor the multiple output points. More...
 

Enumerations

enum  SynthLab::SampleLoopMode { loop, sustain, oneShot }
 
enum  {
  LPF1, LPF2, LPF3, LPF4,
  HPF1, HPF2, HPF3, HPF4,
  BPF2, BPF4, BSF2, BSF4,
  APF1, APF2, ANM_LPF1, ANM_LPF2,
  ANM_LPF3, ANM_LPF4, NUM_FILTER_OUTPUTS
}
 
enum  SynthLab::PluckFilterType {
  kPluck, kPluckAndBridge, kPickup, kPluckAndPickup,
  kBridge, kPluckPickupBridge
}
 

Functions

double SynthLab::doLinearInterp (double y1, double y2, double fractional_X)
 performs linear interpolation of fractional x distance between two adjacent (x,y) points; returns interpolated value More...
 

Variables

const uint32_t SynthLab::kDefaultWaveTableLength = 256
 
const double SynthLab::GUI_Q_MIN = 1.0
 
const double SynthLab::GUI_Q_MAX = 10.0
 
const double SynthLab::SVF_Q_SLOPE = (25.0 - 0.707) / (GUI_Q_MAX - GUI_Q_MIN)
 
const double SynthLab::KORG35_Q_SLOPE = (2.0 - 0.707) / (GUI_Q_MAX - GUI_Q_MIN)
 
const double SynthLab::MOOG_Q_SLOPE = (4.0 - 0.0) / (GUI_Q_MAX - GUI_Q_MIN)
 
const double SynthLab::DIODE_Q_SLOPE = (17.0 - 0.0) / (GUI_Q_MAX - GUI_Q_MIN)
 
const double SynthLab::HSYNC_MOD_SLOPE = 3.0
 

Detailed Description

See also Designing Software Synthesizers in C++ 2nd Ed. by Will Pirkle.

Author
Will Pirkle
Date
20-April-2021