SynthLab SDK
SynthLab::ExciterEG Class Reference

Special purpose EG just for the Karplus Strong exciter. More...

#include <exciter.h>

Public Member Functions

 ExciterEG ()
 empty constructor
 
virtual ~ExciterEG ()
 empty destructor
 
bool reset (double _sampleRate)
 < reset/render (simialar to SynthModule) More...
 
double render ()
 start the FSM More...
 
bool startEG ()
 param setter More...
 
void setParameters (double _attackTime_mSec, double _holdTime_mSec, double _releaseTime_mSec)
 Set attack, hold and relesase times. More...
 

Protected Member Functions

void calcAttackCoeff (double attackTime, double attackTimeScalar=1.0)
 Calculate analg EG time constants. More...
 
void calcReleaseCoeff (double releaseTime, double releaseTimeScalar=1.0)
 Calculate analg EG time constants. More...
 

Protected Attributes

double attackTime_mSec = -1.0
 att: is a time duration
 
double releaseTime_mSec = -1.0
 rel: is a time to decay from max output to 0.0
 
double holdTime_mSec = -1.0
 rel: is a time to decay from max output to 0.0
 
double attackCoeff = 0.0
 see AnalogEG
 
double attackOffset = 0.0
 see AnalogEG
 
double attackTCO = 0.0
 see AnalogEG
 
double releaseCoeff = 0.0
 see AnalogEG
 
double releaseOffset = 0.0
 see AnalogEG
 
double releaseTCO = 0.0
 see AnalogEG
 
double sampleRate = 0.0
 sample rate
 
double envelopeOutput = 0.0
 the current envelope output sample
 
EGState state = EGState::kOff
 EG state variable.
 
Timer holdTimer
 holding timer
 
bool noteOn = false
 run/stop flag
 

Detailed Description

Special purpose EG just for the Karplus Strong exciter.

  • does not use a base class or interface
  • custom designed for use with KS algorithm
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

Member Function Documentation

◆ calcAttackCoeff()

void SynthLab::ExciterEG::calcAttackCoeff ( double  attackTime,
double  attackTimeScalar = 1.0 
)
protected

Calculate analg EG time constants.

Parameters
attackTimeattack time in mSec
attackTimeScalaroptional scalar to speed up or slow down attack

◆ calcReleaseCoeff()

void SynthLab::ExciterEG::calcReleaseCoeff ( double  releaseTime,
double  releaseTimeScalar = 1.0 
)
protected

Calculate analg EG time constants.

Parameters
releaseTimerelease time in mSec
releaseTimeScalaroptional scalar to speed up or slow down release

◆ render()

double SynthLab::ExciterEG::render ( )

start the FSM

Run the FSM and calculate the new envelope out.

Returns
new envelope value

◆ reset()

bool SynthLab::ExciterEG::reset ( double  _sampleRate)

< reset/render (simialar to SynthModule)

Reset Exciter for another run.

Parameters
_sampleRatenew sample rate
Returns
true if successful

◆ setParameters()

void SynthLab::ExciterEG::setParameters ( double  _attackTime_mSec,
double  _holdTime_mSec,
double  _releaseTime_mSec 
)

Set attack, hold and relesase times.

  • calculates coefficients only if parameters have changed
Parameters
_attackTime_mSecattack time in mSec
_holdTime_mSechold time in mSec
_releaseTime_mSecrelease time in mSec

◆ startEG()

bool SynthLab::ExciterEG::startEG ( )

param setter

Start the FSM.

Returns
true if successfule

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