You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By rendering into a 32b int we don't have to saturate check in the inner
loop of the voice render, which is called multiple times per actual output
block. That check is very expensive.
In tsf_render_short make the input `short *buffer` have 2x the space as
normal to allow the full 32b quantity for each sample to accumulate.
After all voices have been rendered, then resample with saturation into
int16_t values.
About 24% faster on the Pico while still saturating properly.
// The short render needs space for a long (32b) for all samples, so pass in a buffer of 2x the expected size. Only the first `samples` samples will be valid on return
if (!flag_mixing) TSF_MEMSET(buffer, 0, (f->outputmode==TSF_MONO ? 1 : 2) *sizeof(short) *samples*2/* We sum in 32bs then downsample here to 16b to minimized saturation calcs */);
0 commit comments