SynthLab SDK
resonator.h
Go to the documentation of this file.
1 #ifndef __rezonator_h__
2 #define __rezonator_h__
3 
4 #include "synthbase.h"
5 #include "synthfunctions.h"
6 
7 // -----------------------------
8 // --- SynthLab SDK File --- //
9 // ----------------------------
17 // -----------------------------------------------------------------------------
18 namespace SynthLab
19 {
35  class Resonator
36  {
37  public:
38  Resonator() {}
39  virtual ~Resonator() {}
40 
41  public:
43  bool reset(double _sampleRate);
44  double process(double xn);
45  double setParameters(double frequency, double _decay);
46 
47  // --- flush out delay
48  void flushDelays();
49 
50  protected:
51  // --- sample rate
52  double sampleRate = 0.0;
53  double decay = 0.0;
57  };
58 
59 
60 } // namespace
61 #endif /* defined(__rezonator_h__) */
Implements a first order APF that is used to generate a fractional delay for the physcial model of a ...
Definition: synthbase.h:2019
Special purpose object for use as Karplus Strong resonator.
Definition: resonator.h:35
double process(double xn)
Process an exciter signal (or 0.0) through the resonator.
Definition: resonator.cpp:99
ResLoopFilter loopFilter
1st order 1/2 sample delay LPF
Definition: resonator.h:56
double setParameters(double frequency, double _decay)
set the resonator frequency and decay time
Definition: resonator.cpp:57
Definition: addosccore.cpp:4
virtual ~Resonator()
empty constructor
Definition: resonator.h:39
void flushDelays()
flush delay lines, and clear filter state registers.
Definition: resonator.cpp:41
Implements a first order feedforward LPF with coefficients a0 = a1 = 0.5.
Definition: synthbase.h:2074
double sampleRate
sample rate
Definition: resonator.h:52
Resonator()
empty constructor
Definition: resonator.h:38
FracDelayAPF fracDelayAPF
APF for fractional daley.
Definition: resonator.h:55
bool reset(double _sampleRate)
Reset resonator for another run.
Definition: resonator.cpp:25
Definition: synthbase.h:1855
double decay
feedback coefficient controls rate
Definition: resonator.h:53
hard-coded arrays of FIR filter coefficients for the sample rate conversion objects (Interpolator and...
DelayLine delayLine
delay line for KD
Definition: resonator.h:54
See also Designing Software Synthesizers in C++ 2nd Ed. by Will Pirkle.