|
| MultiLine () |
| Constructor.
|
|
void | update () |
| Updates the internal controls of the MultiLine. More...
|
|
Q15n16 | next () |
| Advances one step along the MultiLine and returns the level. More...
|
|
void | start () |
| Start the target1 phase of the MultiLine. More...
|
|
void | stop () |
| Start the target4 phase of the MultiLine. More...
|
|
void | setTarget1Level (Q15n16 value) |
| Set the target1 level of the MultiLine. More...
|
|
void | setTarget2Level (Q15n16 value) |
| Set the target2 level of the MultiLine. More...
|
|
void | setTarget3Level (Q15n16 value) |
| Set the target3 level of the MultiLine. More...
|
|
void | setTarget4Level (Q15n16 value) |
| Set the target4 level of the MultiLine. More...
|
|
void | setIdleLevel (Q15n16 value) |
|
void | setLevels (Q15n16 target1, Q15n16 target2, Q15n16 target3, Q15n16 target4) |
| Set the target1, target2, target3 and target4 levels. More...
|
|
void | setTarget1Time (unsigned int msec) |
| Set the target1 time of the MultiLine in milliseconds. More...
|
|
void | setTarget2Time (unsigned int msec) |
| Set the target2 time of the MultiLine in milliseconds. More...
|
|
void | setTarget3Time (unsigned int msec) |
| Set the target3 time of the MultiLine in milliseconds. More...
|
|
void | setTarget4Time (unsigned int msec) |
| Set the target4 time of the MultiLine in milliseconds. More...
|
|
void | setIdleTime (unsigned int msec) |
|
void | setTimes (unsigned int target1_ms, unsigned int target2_ms, unsigned int target3_ms, unsigned int target4_ms) |
| Set the target1, target2 and target4 times of the MultiLine in milliseconds. More...
|
|
void | setTarget1UpdateSteps (unsigned int steps) |
| Set the target1 time of the MultiLine, expressed as the number of update steps (not MultiLine::next() interpolation steps) in the target1 phase. More...
|
|
void | setTarget2UpdateSteps (unsigned int steps) |
| Set the target2 time of the MultiLine, expressed as the number of update steps (not MultiLine::next() interpolation steps) in the target2 phase. More...
|
|
void | setTarget3UpdateSteps (unsigned int steps) |
| Set the target3 time of the MultiLine, expressed as the number of update steps (not MultiLine::next() interpolation steps) in the target3 phase. More...
|
|
void | setTarget4UpdateSteps (unsigned int steps) |
| Set the target4 time of the MultiLine, expressed as the number of update steps (not MultiLine::next() interpolation steps) in the target4 phase. More...
|
|
void | setIdleUpdateSteps (unsigned int steps) |
|
void | setAllUpdateSteps (unsigned int target1_steps, unsigned int target2_steps, unsigned int target3_steps, unsigned int target4_steps) |
| Set the target1, target2 and target4 times of the MultiLine, expressed in update steps (not MultiLine::next() interpolation steps). More...
|
|
bool | playing () |
| Tells if the envelope is currently playing. More...
|
|
| MultiLine () |
| Constructor.
|
|
void | update () |
| Updates the internal controls of the MultiLine. More...
|
|
Q15n16 | next () |
| Advances one step along the MultiLine and returns the level. More...
|
|
void | start () |
| Start the target1 phase of the MultiLine. More...
|
|
void | stop () |
| Jump to to the final phase in the sequence.
|
|
void | setTargetLevel (uint8_t phase_num, Q15n16 value) |
| Set the target level of one of the phases. More...
|
|
void | setTargetTime (uint8_t phase_num, unsigned int msec) |
| Set the time taken to reach the target level of a phase, in milliseconds. More...
|
|
void | setTargetUpdateSteps (uint8_t phase_num, unsigned int steps) |
| Set the target1 time of the MultiLine, expressed as the number of update steps (not MultiLine::next() interpolation steps) in the target1 phase. More...
|
|
bool | playing () |
| Tells if the MultiLine is currently playing. More...
|
|
template<unsigned int CONTROL_UPDATE_RATE, unsigned int LERP_RATE>
class MultiLine< CONTROL_UPDATE_RATE, LERP_RATE >
A simple MultiLine envelope generator.
This implementation has separate update() and next() methods, where next() interpolates values between each update(). The "normal" way to use this would be with update() in updateControl(), where it calculates a new internal state each control step, and then next() is in updateAudio(), called much more often, where it interpolates between the control values. This also allows the MultiLine updates to be made even more sparsely if desired, eg. every 3rd control update.
- Template Parameters
-
CONTROL_UPDATE_RATE | The frequency of control updates.
Ordinarily this will be CONTROL_RATE, but an alternative (amongst others) is to set this as well as the LERP_RATE parameter to AUDIO_RATE, and call both update() and next() in updateAudio(). Such a use would allow accurate envelopes with finer resolution of the control points than CONTROL_RATE. |
LERP_RATE | Sets how often next() will be called, to interpolate between updates set by CONTROL_UPDATE_RATE. This will produce the smoothest results if it's set to AUDIO_RATE, but if you need to save processor time and your envelope changes slowly or controls something like a filter where there may not be problems with glitchy or clicking transitions, LERP_RATE could be set to CONTROL_RATE (for instance). Then update() and next() could both be called in updateControl(), greatly reducing the amount of processing required compared to calling next() in updateAudio(). |
This implementation has separate update() and next() methods, where next() interpolates values between each update(). The "normal" way to use this would be with update() in updateControl(), where it calculates a new internal state each control step, and then next() is in updateAudio(), called much more often, where it interpolates between the control values. This also allows the MultiLine updates to be made even more sparsely if desired, eg. every 3rd control update.
- Template Parameters
-
CONTROL_UPDATE_RATE | The frequency of control updates. Ordinarily this will be CONTROL_RATE, but an alternative (amongst others) is to set this as well as the LERP_RATE parameter to AUDIO_RATE, and call both update() and next() in updateAudio(). Such a use would allow accurate envelopes with finer resolution of the control points than CONTROL_RATE. |
LERP_RATE | Sets how often next() will be called, to interpolate between updates set by CONTROL_UPDATE_RATE. This will produce the smoothest results if it's set to AUDIO_RATE, but if you need to save processor time and your envelope changes slowly or controls something like a filter where there may not be problems with glitchy or clicking transitions, LERP_RATE could be set to CONTROL_RATE (for instance). Then update() and next() could both be called in updateControl(), greatly reducing the amount of processing required compared to calling next() in updateAudio(). |
Definition at line 44 of file MultiLine.h.