SynthLab SDK
SynthLab::ModuleCore Class Referenceabstract

Abstract base class that encapsulates functionality of a module core; used with the Module-Core paradigm. More...

#include <synthbase.h>

Inheritance diagram for SynthLab::ModuleCore:
SynthLab::AddOscCore SynthLab::AnalogEGCore SynthLab::BQFilterCore SynthLab::ClassicWTCore SynthLab::DrumWTCore SynthLab::DXEGCore SynthLab::FMLFOCore SynthLab::FMOCore SynthLab::FourierWTCore SynthLab::KSOCore SynthLab::LegacyPCMCore SynthLab::LFOCore SynthLab::LinearEGCore SynthLab::MellotronCore SynthLab::MorphWTCore SynthLab::SFXWTCore SynthLab::SynthLabCore SynthLab::SynthLabCore SynthLab::SynthLabCore SynthLab::SynthLabCore SynthLab::SynthLabCore SynthLab::SynthLabCore SynthLab::SynthLabCore SynthLab::SynthLabCore SynthLab::SynthLabCore SynthLab::SynthLabCore SynthLab::SynthLabCore SynthLab::SynthLabCore SynthLab::SynthLabCore SynthLab::SynthLabCore SynthLab::SynthLabCore SynthLab::SynthLabCore SynthLab::SynthLabCore SynthLab::SynthLabCore SynthLab::SynthLabCore SynthLab::VAFilterCore SynthLab::VAOCore SynthLab::WaveSliceCore

Public Member Functions

 ModuleCore ()
 Constructs a ModuleCore. More...
 
virtual bool reset (CoreProcData &processInfo)=0
 
virtual bool update (CoreProcData &processInfo)=0
 
virtual bool render (CoreProcData &processInfo)=0
 
virtual bool doNoteOn (CoreProcData &processInfo)=0
 
virtual bool doNoteOff (CoreProcData &processInfo)=0
 
virtual int32_t getState ()
 
virtual bool shutdown ()
 
virtual void setSustainOverride (bool sustain)
 
virtual void setStandAloneMode (bool b)
 
bool startGlideModulation (GlideInfo &glideInfo)
 
uint32_t getModuleType ()
 
const char * getModuleName ()
 
void * getModuleHandle ()
 
void setModuleHandle (void *handle)
 
uint32_t getModuleIndex ()
 
void setModuleIndex (uint32_t index)
 
int32_t getPreferredModuleIndex ()
 
void setPreferredModuleIndex (uint32_t index)
 
ModuleCoreDatagetModuleData ()
 provides access to the core data: More...
 

Protected Attributes

uint32_t moduleType = UNDEFINED_MODULE
 type of module, LFO_MODULE, EG_MODULE, etc...
 
const char * moduleName = nullptr
 module name must be set in derived constructor
 
void * moduleHandle = nullptr
 used for dynamically loading cores from DLLs
 
uint32_t moduleIndex = 0
 index of this core
 
int32_t preferredIndex = -1
 preferred index of this DYNAMIC core
 
ModuleCoreData coreData
 core strings (16) and mod knob labels (4)
 
bool standAloneMode = false
 flag for stand-alone mode of operation outside of SynthLab
 
std::unique_ptr< GlideModulatorglideModulator
 built-in glide modulator for oscillators
 

Detailed Description

Abstract base class that encapsulates functionality of a module core; used with the Module-Core paradigm.

  • each Core is a special variation on the Module that owns it
  • for example, the wavetable oscillator object owns four cores that implement four different kinds of wavetables from classic waveforms, to electronic drums
  • this is the most important object in SynthLab for getting started
  • you can compile SynthLab DM cores that impelement only one of these objects
  • although this is an abstract base class, it is not an interface because it contains non-abstract functions and implements some very low level functionality itself to make it easier to use the derived classes in a stand-alone manner

Abstract Functions:

  • note that the main five abstract functions all take the same argument, CoreProcData
  • this argument is capable of surviving calls acrss the thunk-layer
  • the owning SynthModule will prepare the CoreProcData argument for the core to use
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

Constructor & Destructor Documentation

◆ ModuleCore()

SynthLab::ModuleCore::ModuleCore ( )
inline

Constructs a ModuleCore.

  • just resets the glide modulator

Member Function Documentation

◆ getModuleData()

ModuleCoreData& SynthLab::ModuleCore::getModuleData ( )
inline

provides access to the core data:

  • this includes the 16 module strings (these are waveform names for oscillators, filter types for filters, etc...)
  • and the four mod-knob labels; this is only used for systems that can load dynamically filled GUI controls

◆ getModuleType()

uint32_t SynthLab::ModuleCore::getModuleType ( )
inline

needed for dynamic loading/unloading

◆ getState()

virtual int32_t SynthLab::ModuleCore::getState ( )
inlinevirtual

ModuleCore virtual functions for EGs only – they need a few additional methods

Reimplemented in SynthLab::SynthLabCore, SynthLab::SynthLabCore, SynthLab::SynthLabCore, SynthLab::AnalogEGCore, SynthLab::DXEGCore, and SynthLab::LinearEGCore.

◆ reset()

◆ startGlideModulation()

bool SynthLab::ModuleCore::startGlideModulation ( GlideInfo glideInfo)
inline

to start glide modulation directly, without needing a derived class pointer


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