Repository navigation
audiograph: Graph.carry, so a rebuilt patch takes over a running one's state - #348
Merged
Merged
Conversation
…over its nodes' state carry(node, src_graph, src_node) copies a node's running state and config from another graph: voices, envelopes, phases, filter memory and delay lines continue across a patch change. The destination keeps its own wiring, parameters and wow table; a parameter that differs, or a change the source had queued, lands on the next block. It refuses a node of another kind, arg, state size or sample rate. graph_carry_probe.py builds every node kind three times and proves the carried graph renders what the reference renders from the swap block on, byte for byte; verify_graph.py compares it across interpreters. CI builds the CPython extension with each planted C fault (the delay line left on the source's, a pending change dropped) and the probe must fail.
…ap; install setuptools for the fault builds
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.
Graph.carry(node, src_graph, src_node)hands a node of a running graph to a graph built beside it, so a patch can change while it plays: build the new graph, carry each node the two share, and run the new one from the next block. Voices, envelopes, oscillator phases, filter memory, delay lines and modal banks continue where they were.The destination keeps its own wiring, parameters and wow table. A parameter that differs from the source's, or a change the source had queued but not rendered, lands on the next block as a
set()would. A delay handed an equal copy of the wow table playing plays on without a dip; a different table takes over with the diptable()gives. A table the source lent is held for as long as the destination might read it.It raises
ValueErrorfor a node of another kind, arg, state size or sample rate, or a bad node, andTypeErrorfor a source that isn't a graph. Neither graph may be playing from the pump.Proof
tests/parity/graph_carry_probe.pybuilds one patch with every node kind three times: a reference that renders 140 blocks, a source that renders 48, and a destination that carries the source's nodes. From block 48 on, every node of the destination renders what the reference renders, byte for byte, while the source keeps rendering other input and is then freed and its heap churned. Three delays cover the wow cases: one shared table, an equal copy, and a new table at the swap. A destination that carries nothing differs on every stateful kind.verify_graph.pycompares that render across CPython and MicroPython (CI) and CircuitPython (local), with a plantedoffbeatfault (the carry taken a block late) that must fail.AUDIODSP_GRAPH_CARRY_FAULT=1(the delay line left on the source's) and=2(a pending change dropped); the probe must fail on each.