feat(audio): play automation envelopes in preview and bake them at render - #3016
Open
vanceingalls wants to merge 2 commits into
Open
feat(audio): play automation envelopes in preview and bake them at render#3016vanceingalls wants to merge 2 commits into
vanceingalls wants to merge 2 commits into
Conversation
vanceingalls
force-pushed
the
wa-4-automation-playback
branch
from
August 4, 2026 20:24
c464971 to
2f66e1b
Compare
vanceingalls
force-pushed
the
wa-4-automation-playback
branch
from
August 4, 2026 21:04
2f66e1b to
fd8d86c
Compare
vanceingalls
force-pushed
the
wa-4-automation-playback
branch
from
August 4, 2026 21:19
fd8d86c to
9364e6b
Compare
Fallow audit reportFound 20 findings. Duplication (19)
Health (1)
Generated by fallow. |
Schedules each lane onto the AudioParams behind its knob using native ramps and value curves. Nothing evaluates the envelope per frame: it is handed to the audio thread once, so it stays sample-accurate however busy the main thread is, and the offline render will schedule it the same way. Timing comes from the transport, so an envelope survives seeking into the middle of a clip, a clip that has not started yet, and a playback rate that compresses clip seconds into context seconds. A straight line is only scheduled as a ramp when nothing bends it — no curvature, a linear parameter scale, and no unit mapping. Log-scaled parameters and mapped ones are sampled instead, since a delay knob in milliseconds and a wet/dry pair moving in opposition are not linear in the parameter they drive. Lanes with nowhere to write are skipped rather than reported: a one-pole filter exposes no frequency param, and the worklet effects expose none at all. Editing an envelope mid-playback re-aims it at the live playhead rather than restarting the track. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The offline render schedules FX lanes with the same scheduler preview uses, inside the OfflineAudioContext that already runs the same graph builders. The input WAV is the clip's own audio from its first sample, so clip-local time is offline time and the envelope needs no offset. Volume lanes take the existing PCM bake rather than a second mechanism: the lane is converted to keyframes, so a straight fade stays two of them and only a bent segment is sampled — the baker interpolates linearly and would otherwise quietly straighten the curve. A volume lane supersedes keyframes probed from the timeline, which `lint` already warns about. A browser test sweeps a lowpass from below a 2 kHz tone to well above it and measures both ends. Parsing the envelope is not the same as scheduling it, and only running the real thing tells the two apart. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
vanceingalls
force-pushed
the
wa-4-automation-playback
branch
from
August 4, 2026 21:43
9364e6b to
bfa3878
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #3015.
Makes the envelopes actually run, on both sides.
Preview — each lane is scheduled onto the AudioParams behind its knob using
native ramps and value curves. Nothing evaluates the envelope per frame: it is
handed to the audio thread once, so it stays sample-accurate however busy the
main thread is. Timing comes from the transport, so an envelope survives seeking
into the middle of a clip, a clip that has not started yet, and a playback rate
that compresses clip seconds into context seconds.
A segment is only scheduled as a straight ramp when nothing bends it — no
curvature, a linear parameter scale, and no unit mapping. Log-scaled and mapped
segments are sampled instead, because a delay knob in milliseconds and a wet/dry
pair moving in opposition are not linear in the parameter they drive.
Render — the offline path schedules with the same scheduler, in the
OfflineAudioContextthat already runs the same graph builders. The input WAV isthe clip's own audio from its first sample, so clip-local time is offline time.
Volume lanes take the existing PCM bake rather than a second mechanism: the lane
becomes keyframes, so a straight fade stays two of them and only a bent segment
is sampled — the baker interpolates linearly and would otherwise quietly
straighten the curve.
Lanes with nowhere to write are skipped rather than reported: a one-pole filter
exposes no frequency param, and the worklet effects expose none at all.
A browser test sweeps a lowpass from below a 2 kHz tone to well above it and
measures both ends. Parsing an envelope is not the same as scheduling it, and
only running the real thing tells the two apart — this test is what caught that
the injected runtime bundle needed rebuilding.
🤖 Generated with Claude Code