Repository navigation
fill(): a patch that renders slower than real time no longer hangs it - #39
Merged
Merged
Conversation
On a board, a patch that renders on the rack slower than real time never caught up with a ring the pump drains while it renders, so fill() looped for ever and the interpreter stopped. It now renders the blocks that fit when it is called and returns; the audio underruns instead. Claude-Session: https://claude.ai/code/session_0156jxeQhrF9XaLXNUos1NHF
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.
On a board, an instrument whose patch renders on the rack (not compiled to a graph) plays through a ring that
fill()tops up.fill()loopedwhile ring.space() >= need, and when the patch rendered slower than real time the pump drained the ring as fast asfill()wrote it, so the call never returned and the interpreter stopped.Measured on an ESP32-P4 with
electric_piano(rack engine) pumped to I2S: a render of 35 ms per 5.3 ms block (0.15x real time), and onefill()call still writing after 85 blocks and 3 s, with the ring's free space unchanged.fill()now renders the blocks that fit when it is called and returns, so a slow patch underruns instead of hanging. The same board then playedelectric_pianofor 60 s withfill()every 20 ms: longest call 411 ms, and underruns as expected at that render speed.tests/test_fill_bounded.pydrivesfill()against a ring that never fills; it fails on the old loop and passes now.https://claude.ai/code/session_0156jxeQhrF9XaLXNUos1NHF