ATMOSYNTH Groove: a desktop DAW whose instruments and effects are ATMOSYNTH patches, on ATproto.

Playback plays into a fake output under cargo test, from prepare through the swap to the mix #29

Closed opened by center.for.cybernetic.beauty

Part of #26 Blocked by: #31, whose shared test device this builds on.

Playback (src-tauri/src/playback.rs) is constructed by nothing in cargo test: prepare spawns on tauri's runtime and sends to a real output, listen_through does nothing without one, and swap_in is only read, never run. So each decision (preparing, Routing::feeding, Mix::rebuild) is tested and the calls of it are not. Seen four times since 30 October: the stutter when a clip is lengthened while playing could only be shown fixed by comparing samples; the line that makes swap_in listen again had no test that could go red; a listen_through in swap_in set rerouted and would have let go of every held note on every clip edit, caught by a reviewer and not by a test; hold prepares before it takes Current's lock, so a knob turned in that gap lands in the new document's latest, left alone because nothing could test it. The same wish had three sightings before 28 October and no ticket.

Done when a Playback can be built in a test over a fake output that renders on demand and records what it was handed, and one test says "an edit, then not a sample changed" from prepare through swap_in to the mix, one says monitoring comes back after an edit gives an effect an input stage, and one holds that a clip edit lets go of no held note. The #[cfg(test)] record of what Playback::send sends, added for audition_parameter's test, is the seed of it. Left out: the commands in lib.rs, which are their own child of #26.

Done in 5a0f7c9. Where a Playback finds and opens its devices is now a field: this machine's, or under test the test device's Speakers (Playback::on), one device of two channels each way at 48 kHz whose callback renders only when the test asks. Each callback first carries out what Playback handed it through the command loop a device runs, keeping each command as a Taken, and the device's input is a ring the test fills once something opens it. The route, the opening and every command are the real code; only cpal is left out.

Three tests in src-tauri/src/playback.rs use it: a clip made longer while it plays changes not a sample against the same arrangement left alone; a patch document made an effect is heard through from the input once it is swapped in; a clip edited lets go of no key held on its track.

Mutants: preparing every edit whole reddened all three, two by the sound (the first sample changed at frame 24064, the held key falling from 0.28 to 0.01); never listening again after a swap, and hears_otherwise always false, each left the effect silent. Two survived: listening again after every swap, and the mix letting go of the hands on every routing told. Each alone keeps the held key, since the mix lets go only when the routing differs and a clip edit leaves it alone, so neither guard is held on its own. The #[cfg(test)] sent record still stands, used by Knobbed in mix.rs and two tests in playback.rs, which could move onto the speakers. cargo test --workspace passes 1205.

Sign up or Sign in to add to the discussion.