SynthLab SDK
|
Specialized version of the RampModulator, with nearly identically named functions to peform the portamento operation (aka glide modulation) More...
#include <synthbase.h>
Public Member Functions | |
bool | startModulator (double startNote, double endNote, double glideTime_mSec, double sampleRate) |
Setup the timers and start the ramp modulator running. The modulator produces an output on the range of [startValue, endValue] over a specified duration in mSec. More... | |
bool | setGlideTime (double glideTime_mSec, double sampleRate) |
Change the glide time; this is optional. More... | |
double | getNextModulationValue (uint32_t advanceClock=1) |
Get the current output of the modulator; this is called repeatedly over the ramp modulation time. More... | |
void | advanceClock (uint32_t ticks=1) |
Nudge the clock on the modulator; this is used for block processing where the modulator output outputs one value per audio block. This is called repeatedly to get the modulator clock "caught up" to where it needs to be for the next block of audio to process. More... | |
bool | isActive () |
checks to see if the modulator is running, or completed | |
Protected Attributes | |
bool | timerActive = false |
state of modulator, running (true) or expired (false) | |
double | timerInc = 0.0 |
timer incrementer value | |
double | countDownTimer = 1.0 |
current timer value; this always counts DOWN regardless of the polarity of the modulation (up or down) | |
double | glideRange = 1.0 |
range (distance between MIDI note numbers, as double) | |
Specialized version of the RampModulator, with nearly identically named functions to peform the portamento operation (aka glide modulation)
void SynthLab::GlideModulator::advanceClock | ( | uint32_t | ticks = 1 | ) |
Nudge the clock on the modulator; this is used for block processing where the modulator output outputs one value per audio block. This is called repeatedly to get the modulator clock "caught up" to where it needs to be for the next block of audio to process.
manually advance the clock
ticks | number of tics to advance the clock for the next value |
double SynthLab::GlideModulator::getNextModulationValue | ( | uint32_t | advanceClock = 1 | ) |
Get the current output of the modulator; this is called repeatedly over the ramp modulation time.
get the next modulation value - this is the main output function; auto advances the clock
advanceClock | number of tics to advance the clock for the next value |
bool SynthLab::GlideModulator::setGlideTime | ( | double | glideTime_mSec, |
double | sampleRate | ||
) |
Change the glide time; this is optional.
the glide time may be changed while running, normally not used but permitted
glideTime_mSec | time for the ramp-up or ramp-down across the values |
sampleRate | fs for calculating timer increment |
bool SynthLab::GlideModulator::startModulator | ( | double | startValue, |
double | endValue, | ||
double | glideTime_mSec, | ||
double | sampleRate | ||
) |
Setup the timers and start the ramp modulator running. The modulator produces an output on the range of [startValue, endValue] over a specified duration in mSec.
the main function that sets up and start the modulator
startValue | starting MIDI note number |
endValue | ending MIDI note number |
glideTime_mSec | time for the glide-up or glide-down across the values |
sampleRate | fs for calculating timer increment |