Cool, I've been meaning to look into the DMA/i2s stuff myself
IIRC, the way things are calculated is
- the voice calculations produce float values (-1,1) and these are summed per timbre
- Timbre::fxAfterBlock scales the the timbre output from (-n,n) to (-131072,131072) via ratioTimbres and numberOfVoiceInverse to avoid clipping in the final mix
- during the final mixing of the timbre samples in buildNewSampleBlock, the sum is offset from float (-131072,131072) to int (0,2^18) for the DAC
So I guess you mainly have to replace the 131072.f (2^17) constants with 8388609.f (2^23).
Does the codec accept padded 24bit samples (i.e. 32bit), or how does that work with DMA?