SynthLab SDK
|
This is a tiny modulator object that produces an output that ramps up or down linearly between two values over a specified time in milliseconds. More...
#include <synthbase.h>
Public Member Functions | |
bool | startModulator (double startValue, double endValue, double modTime_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 | setModTime (double modTime_mSec, double sampleRate) |
Change the modulation 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 | countUpTimer = 0.0 |
current timer value; this always counts UP regardless of the polarity of the modulation (up or down) | |
double | modRange = 1.0 |
range of modulation output | |
double | modStart = 0.0 |
ramp mod start value | |
double | modEnd = 1.0 |
ramp mod end value | |
This is a tiny modulator object that produces an output that ramps up or down linearly between two values over a specified time in milliseconds.
void SynthLab::RampModulator::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::RampModulator::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::RampModulator::setModTime | ( | double | modTime_mSec, |
double | sampleRate | ||
) |
Change the modulation time; this is optional.
the mod time may be changed while running, normally not used but permitted
modTime_mSec | time for the ramp-up or ramp-down across the values |
sampleRate | fs for calculating timer increment |
bool SynthLab::RampModulator::startModulator | ( | double | startValue, |
double | endValue, | ||
double | modTime_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 modulator value |
endValue | ending modulator value |
modTime_mSec | time for the ramp-up or ramp-down across the values |
sampleRate | fs for calculating timer increment |