Skip to content

Pass maxFramesToRender to DSP at allocation time#38

Merged
aure merged 1 commit intomainfrom
pass-max-frames-to-render
Apr 16, 2026
Merged

Pass maxFramesToRender to DSP at allocation time#38
aure merged 1 commit intomainfrom
pass-max-frames-to-render

Conversation

@aure
Copy link
Copy Markdown
Member

@aure aure commented Apr 15, 2026

Closes #16. AudioKitAU already knows maximumFramesToRender from the host but never forwarded it into C++, so DSP kernels had no sanctioned way to pre-size scratch buffers at init time and had to infer the worst case from the first render's output buffer.

Store the value as a member on DSPBase, set by allocateRenderResourcesDSP before init() is called. Subclasses opt in by reading maximumFramesToRender in their init() override — the virtual init(int, double) signature is unchanged, so existing overrides (including those in downstream projects) keep compiling.

Closes #16. AudioKitAU already knows maximumFramesToRender from the host
but never forwarded it into C++, so DSP kernels had no sanctioned way to
pre-size scratch buffers at init time and had to infer the worst case
from the first render's output buffer.

Store the value as a member on DSPBase, set by allocateRenderResourcesDSP
before init() is called. Subclasses opt in by reading
maximumFramesToRender in their init() override — the virtual init(int,
double) signature is unchanged, so existing overrides (including those
in downstream projects) keep compiling.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@aure aure requested a review from wtholliday April 15, 2026 20:50
@aure aure merged commit 750410f into main Apr 16, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pass maxFramesToRender to DSPBase::init

2 participants