Life of an audio buffer
(Applies to Clouds, Rings, Warps, Elements).
-
The audio samples received from the codec (resp: sent to it) are shoved by the DMA controller into
Codex:: rx_dma_buffer_
(resp:Codec:: tx_dma_buffer_
). -
An ISR is called whenever 50% of the input buffer is filled. This also means that 50% of the output buffer has to be filled. The code handling this interrupt will invoke the callback passed to
Codec::Init
, with pointers to the input and output buffers. -
Typically,
Codec::Init
has been called on startup, with a callback namedFillBuffer
. -
FillBuffer
will read the current value of the CV, convert the input samples to floats, invoke the main processing function (for example, modal synthesis for Rings) with the input data and the parameters read from the CV, then clip and convert the output samples to integer.