SynthLab SDK
sfxwtcore.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "synthbase.h"
4 #include "synthfunctions.h"
5 #include "synthlabwtsource.h"
6 
7 // -----------------------------
8 // --- SynthLab SDK File --- //
9 // ----------------------------
17 // -----------------------------------------------------------------------------
18 namespace SynthLab
19 {
85  class SFXWTCore : public ModuleCore
86  {
87  public:
89  SFXWTCore(); /* C-TOR */
90 
92  virtual ~SFXWTCore() {} /* D-TOR */
93 
95  virtual bool reset(CoreProcData& processInfo) override;
96  virtual bool update(CoreProcData& processInfo) override;
97  virtual bool render(CoreProcData& processInfo) override;
98  virtual bool doNoteOn(CoreProcData& processInfo) override;
99  virtual bool doNoteOff(CoreProcData& processInfo) override;
100 
102  double renderSample(SynthClock& clock, bool forceLoop);
103 
104  protected:
105  // --- basic variables
106  double sampleRate = 0.0;
107  double outputAmplitude = 1.0;
108  double panLeftGain = 0.707;
109  double panRightGain = 0.707;
110  bool oneShotDone = false;
111  int32_t currentWaveIndex = -1;
112 
113  // --- timebase
115 
116  // --- table source
118 
119  // --- wavetable sources; these are used to register the tables with the database
120  // if the tables already exist, these won't be used. Notice that the update() function
121  // ONLY uses wavetable sources from the database!
122  //
123  // NOTE: uses drumwtsource because it does pitchleess loops
125  };
126 
127 } // namespace
128 
bool oneShotDone
one shot flag
Definition: sfxwtcore.h:110
DrumWTSource sfxTables[MODULE_STRINGS]
pitchless wavetable sets
Definition: sfxwtcore.h:124
IWavetableSource * selectedTableSource
selected table
Definition: sfxwtcore.h:117
double panLeftGain
left channel gain
Definition: sfxwtcore.h:108
Compact modulo counter with wrapping used as the timebase for all oscillators.
Definition: synthbase.h:137
virtual bool update(CoreProcData &processInfo) override
Updates the object for the next block of audio processing.
Definition: sfxwtcore.cpp:121
virtual bool doNoteOff(CoreProcData &processInfo) override
Note-off handler for the ModuleCore.
Definition: sfxwtcore.cpp:255
SFXWTCore()
Construction: Cores follow the same construction pattern.
Definition: sfxwtcore.cpp:31
Interface for wavetable sources.
Definition: synthbase.h:609
Storage for one static table source, specifically for drums which are pitchless and one-shot...
Definition: synthlabwtsource.h:151
double renderSample(SynthClock &clock, bool forceLoop)
Renders one sample out of the wavetable Core Specific:
Definition: sfxwtcore.cpp:168
double outputAmplitude
amplitude in dB
Definition: sfxwtcore.h:107
Wavetable oscillator with one-shot sound-effects (SFX) extracted into wavetables from WAV files...
Definition: sfxwtcore.h:85
double sampleRate
sample rate
Definition: sfxwtcore.h:106
Definition: addosccore.cpp:4
virtual bool reset(CoreProcData &processInfo) override
Resets object to initialized state.
Definition: sfxwtcore.cpp:81
virtual bool render(CoreProcData &processInfo) override
Renders the output of the module.
Definition: sfxwtcore.cpp:193
virtual bool doNoteOn(CoreProcData &processInfo) override
Note-on handler for the ModuleCore.
Definition: sfxwtcore.cpp:231
const uint32_t MODULE_STRINGS
Definition: synthconstants.h:130
SynthClock oscClock
timebase
Definition: sfxwtcore.h:114
int32_t currentWaveIndex
to minimize dictionary (map) lookup iterating
Definition: sfxwtcore.h:111
virtual ~SFXWTCore()
Definition: sfxwtcore.h:92
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
double panRightGain
right channel gain
Definition: sfxwtcore.h:109
Abstract base class that encapsulates functionality of a module core; used with the Module-Core parad...
Definition: synthbase.h:1516
See also Designing Software Synthesizers in C++ 2nd Ed. by Will Pirkle.