SynthLab SDK
fourierwtcore.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "synthbase.h"
4 #include "synthfunctions.h"
5 #include "sinetablesource.h"
6 #include "dynamictablesource.h"
7 
8 // -----------------------------
9 // --- SynthLab SDK File --- //
10 // ----------------------------
18 // -----------------------------------------------------------------------------
19 namespace SynthLab
20 {
87  class FourierWTCore : public ModuleCore
88  {
89  public:
91  FourierWTCore(); /* C-TOR */
92 
94  virtual ~FourierWTCore() {} /* D-TOR */
95 
97  virtual bool reset(CoreProcData& processInfo) override;
98  virtual bool update(CoreProcData& processInfo) override;
99  virtual bool render(CoreProcData& processInfo) override;
100  virtual bool doNoteOn(CoreProcData& processInfo) override;
101  virtual bool doNoteOff(CoreProcData& processInfo) override;
102 
104  double renderSample(SynthClock& clock, double shape = 0.5);
105  double renderHardSyncSample(SynthClock& clock, double shape);
106 
108  bool createTables(double sampleRate = 44100.0);
109 
110  protected:
111  // --- basic variables
112  double sampleRate = 0.0;
113  double currentTableRate = 0.0;
114  double midiPitch = 0.0;
115  double outputAmplitude = 1.0;
116  double panLeftGain = 0.707;
117  double panRightGain = 0.707;
118  double hardSyncRatio = 1.0;
119  int32_t currentWaveIndex = -1;
120 
121  // --- timebase
123 
124  // --- table source
126 
127  // -- hard sync helper
129 
132  };
133 
134 } // namespace
135 
SineTableSource sineTableSource
sine table for very high frequney notes that have only one harmonic (the fundamental) ...
Definition: fourierwtcore.h:130
See also Designing Software Synthesizers in C++ 2nd Ed. by Will Pirkle.
Compact modulo counter with wrapping used as the timebase for all oscillators.
Definition: synthbase.h:137
virtual bool doNoteOn(CoreProcData &processInfo) override
Note-on handler for the ModuleCore.
Definition: fourierwtcore.cpp:367
double outputAmplitude
amplitude in dB
Definition: fourierwtcore.h:115
Interface for wavetable sources.
Definition: synthbase.h:609
double panLeftGain
left channel gain
Definition: fourierwtcore.h:116
See also Designing Software Synthesizers in C++ 2nd Ed. by Will Pirkle.
virtual bool render(CoreProcData &processInfo) override
Renders the output of the module.
Definition: fourierwtcore.cpp:306
virtual bool doNoteOff(CoreProcData &processInfo) override
Note-off handler for the ModuleCore.
Definition: fourierwtcore.cpp:397
virtual bool reset(CoreProcData &processInfo) override
Resets object to initialized state.
Definition: fourierwtcore.cpp:72
double currentTableRate
sample rate
Definition: fourierwtcore.h:113
Storage for one static sinusoidal table source; stores a single sine table that is used for all notes...
Definition: sinetablesource.h:39
Definition: addosccore.cpp:4
double renderHardSyncSample(SynthClock &clock, double shape)
Renders one hard-synced sample from the wavetable Core Specific:
Definition: fourierwtcore.cpp:259
int32_t currentWaveIndex
to minimize dictionary (map) lookup iterating
Definition: fourierwtcore.h:119
virtual bool update(CoreProcData &processInfo) override
Updates the object for the next block of audio processing.
Definition: fourierwtcore.cpp:134
IWavetableSource * selectedTableSource
selected dynamic table
Definition: fourierwtcore.h:125
double hardSyncRatio
for hard sync
Definition: fourierwtcore.h:118
double panRightGain
right channel gain
Definition: fourierwtcore.h:117
virtual ~FourierWTCore()
Definition: fourierwtcore.h:94
double midiPitch
the midi pitch
Definition: fourierwtcore.h:114
FourierWTCore()
Construction: Cores follow the same construction pattern.
Definition: fourierwtcore.cpp:34
SynthClock oscClock
timebase
Definition: fourierwtcore.h:122
double renderSample(SynthClock &clock, double shape=0.5)
Renders one sample out of the wavetable Core Specific:
Definition: fourierwtcore.cpp:238
This is a very specialized object that performs the hard-sync operation using two SynthClocks...
Definition: synthbase.h:365
bool createTables(double sampleRate=44100.0)
Table Creation funciont.
Definition: fourierwtcore.cpp:411
Synchronizer hardSyncronizer
hard sync helper
Definition: fourierwtcore.h:128
DynamicTableSource dynamicTableSource
dynamic tables come out of this source
Definition: fourierwtcore.h:131
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
Storage for one dynamic table source; a wavetable that is created dynamically at load time...
Definition: dynamictablesource.h:38
Abstract base class that encapsulates functionality of a module core; used with the Module-Core parad...
Definition: synthbase.h:1516
double sampleRate
sample rate
Definition: fourierwtcore.h:112
See also Designing Software Synthesizers in C++ 2nd Ed. by Will Pirkle.
Fourier wavetable oscillator with sine and parabola waveforms.
Definition: fourierwtcore.h:87