SynthLab SDK
ksocore.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "synthbase.h"
4 #include "synthfunctions.h"
5 #include "exciter.h"
6 #include "resonator.h"
7 
8 // -----------------------------
9 // --- SynthLab SDK File --- //
10 // ----------------------------
18 // -----------------------------------------------------------------------------
19 namespace SynthLab
20 {
91  class KSOCore : public ModuleCore
92  {
93  public:
95  KSOCore(); /* C-TOR */
96 
98  virtual ~KSOCore() {} /* D-TOR */
99 
101  virtual bool reset(CoreProcData& processInfo) override;
102  virtual bool update(CoreProcData& processInfo) override;
103  virtual bool render(CoreProcData& processInfo) override;
104  virtual bool doNoteOn(CoreProcData& processInfo) override;
105  virtual bool doNoteOff(CoreProcData& processInfo) override;
106 
107  protected:
108  // --- local variables
109  double sampleRate = 0.0;
110  double midiPitch = 0.0;
111  double outputAmplitude = 1.0;
112  double panLeftGain = 0.707;
113  double panRightGain = 0.707;
114  uint32_t pluckPosition = 1;
115  double saturation = 1.0;
116 
119 
123 
126 
128  enum {kNylonGtr, kDistGtr, kBass, kSilent};
129  };
130 
131 } // namespace
132 
double midiPitch
the midi pitch
Definition: ksocore.h:110
virtual bool doNoteOff(CoreProcData &processInfo) override
Note-off handler for the ModuleCore.
Definition: ksocore.cpp:321
ParametricFilter bodyFilter
sinple parameteric filter for adding a resonant hump to th output
Definition: ksocore.h:125
double panRightGain
right channel gain
Definition: ksocore.h:113
virtual bool render(CoreProcData &processInfo) override
Renders the output of the module.
Definition: ksocore.cpp:209
Special purpose object for use as Karplus Strong resonator.
Definition: resonator.h:35
virtual bool reset(CoreProcData &processInfo) override
Resets object to initialized state.
Definition: ksocore.cpp:65
double sampleRate
sample rate
Definition: ksocore.h:109
HighShelfFilter highShelfFilter
filter for adding bite to exciter
Definition: ksocore.h:120
LP2Filter bassFilter
for bass guitar pickup simulation
Definition: ksocore.h:121
virtual ~KSOCore()
Definition: ksocore.h:98
Implementation of a high shelving filter.
Definition: synthbase.h:2594
See also Designing Software Synthesizers in C++ 2nd Ed. by Will Pirkle.
Implements a simple 2nd order LPF.
Definition: synthbase.h:2266
Implementation of a constant-Q parametric EQ filter.
Definition: synthbase.h:2671
Definition: addosccore.cpp:4
double saturation
for distortion control
Definition: ksocore.h:115
Resonator resonator
resonator for KS model
Definition: ksocore.h:118
virtual bool doNoteOn(CoreProcData &processInfo) override
Note-on handler for the ModuleCore.
Definition: ksocore.cpp:288
Special purpose object for use as Karplus Strong exciter.
Definition: exciter.h:99
double panLeftGain
left channel gain
Definition: ksocore.h:112
See also Designing Software Synthesizers in C++ 2nd Ed. by Will Pirkle.
double outputAmplitude
amplitude in dB
Definition: ksocore.h:111
PluckPosFilter pluckPosFilter
for simulating pluck position with comb filter
Definition: ksocore.h:124
Exciter exciter
exciter for KS model
Definition: ksocore.h:117
uint32_t pluckPosition
position: 0 = at nut, 1 = at center of string
Definition: ksocore.h:114
virtual bool update(CoreProcData &processInfo) override
Updates the object for the next block of audio processing.
Definition: ksocore.cpp:106
Implements three Karplus-Strong algorithms to generate.
Definition: ksocore.h:91
KSOCore()
Construction: Cores follow the same construction pattern.
Definition: ksocore.cpp:26
hard-coded arrays of FIR filter coefficients for the sample rate conversion objects (Interpolator and...
This structure holds all of the information needed to call functions on a ModuleCore object...
Definition: synthbase.h:1071
Comnination of three filters in one; note that the figure in the book does not show the variety of co...
Definition: synthbase.h:2862
Abstract base class that encapsulates functionality of a module core; used with the Module-Core parad...
Definition: synthbase.h:1516
LP2Filter distortionFilter
for soft clip distortion
Definition: ksocore.h:122
See also Designing Software Synthesizers in C++ 2nd Ed. by Will Pirkle.