Introduction into C++ (Part 4)

From Stateless to Stateful: Filters & Composition

In previous parts, we built an oscillator. It was "stateless"—you give it a phase, it gives you a value. It doesn’t care what happened a microsecond ago. But to make music sound "warm" or "organic," we need objects that have a memory.

1. DSP General: The Concept of State

In Digital Signal Processing (DSP), a filter is stateful. To calculate the current output, a filter needs to know the previous output.