Volume ramp implementation

DSP, Plugin and Host development discussion.
Post Reply New Topic
RELATED
PRODUCTS

Post

Instead of calculating envelopes/lfo/pitch/filter coefs every sample, calculate them every few samples (I like calculating them every 16 samples or so) and ramp the volume (pitch and cutoff don't have to be ramped), this makes it a lot easier to have a fast core loop.
I saw this in another thread - What does it actually mean to ramp the volume ?
Say my volume is 0.5 right now, how do I know what volume to ramp to 16 samples later?
Do correct me if my understanding is wrong.

Thank you.

Post

If you for instance want to modulate your volume using an envelope, you can calculate the next envelope value (since it is deterministic) at 16x speed, and interpolate (usually linear) between the previous and the new value for the next 16 samples.

The idea being that stuff like envelopes, which can be calculated at any point in time, usually represent somewhat smooth changes over time, thus they can be approximated decently by calculating them at lower rates, thus reducing cpu usage.

Post Reply

Return to “DSP and Plugin Development”