SynthLab SDK
SynthLab::Resonator Class Reference

Special purpose object for use as Karplus Strong resonator. More...

#include <resonator.h>

Public Member Functions

 Resonator ()
 empty constructor
 
virtual ~Resonator ()
 empty constructor
 
bool reset (double _sampleRate)
 Reset resonator for another run. More...
 
double process (double xn)
 Process an exciter signal (or 0.0) through the resonator. More...
 
double setParameters (double frequency, double _decay)
 set the resonator frequency and decay time More...
 
void flushDelays ()
 flush delay lines, and clear filter state registers.
 

Protected Attributes

double sampleRate = 0.0
 sample rate
 
double decay = 0.0
 feedback coefficient controls rate
 
DelayLine delayLine
 delay line for KD
 
FracDelayAPF fracDelayAPF
 APF for fractional daley.
 
ResLoopFilter loopFilter
 1st order 1/2 sample delay LPF
 

Detailed Description

Special purpose object for use as Karplus Strong resonator.

  • implements single delay-line version of KS algorithm
  • initial state of delay is EMPTY and the exciter feeds the delay free path directly
Author
Will Pirkle http://www.willpirkle.com
Remarks
This object is included and described in further detail in Designing Software Synthesizer Plugins in C++ 2nd Ed. by Will Pirkle
Version
Revision : 1.0
Date
Date : 2021 / 04 / 26

Member Function Documentation

◆ process()

double SynthLab::Resonator::process ( double  xn)

Process an exciter signal (or 0.0) through the resonator.

Parameters
xninput sample
Returns
output sample for resonator

◆ reset()

bool SynthLab::Resonator::reset ( double  _sampleRate)

Reset resonator for another run.

Similar functions as SynthModule

Parameters
_sampleRatenew sample rate
Returns
true if successful

◆ setParameters()

double SynthLab::Resonator::setParameters ( double  frequency,
double  _decay 
)

set the resonator frequency and decay time

Parameters
frequencycurrent frequency of the resonator
_decaycurrent decay value (from GUI most likely)
Returns
the delay time in samples (fractional)

The documentation for this class was generated from the following files: