Repository navigation
Add per-track band diagnosis; record captures from --start - #129
Merged
Merged
Conversation
session capture never honored --start: it moved the playhead while the transport was stopped, which Live ignores, then fired the clip. Each capture began wherever the last stop left the playhead (or at beat 0 when firing from a stopped transport). Back-to-back captures drifted through the song, so section measurements came from the wrong bars. Captures now start playback, move the playhead one bar before --start, and fire the clip, so 1-bar launch quantization begins the recording at --start. The stop position minus the file's length gives recorded_start_beat; a recording more than half a beat off fails with step verify_recorded_start. --start is now required and must be at least one bar, on session capture and the new capture-tracks. New commands: - audio spectrum shares --stem LABEL=PATH ...: each stem's level per band, its share of the band's summed energy, the dominant stem, and with --focus the margin over the loudest other stem. --resolution third-octave uses the 29 ISO bands from 25 Hz to 16 kHz. - session capture-tracks --track-index N ... --start B: solos each track into a temporary capture track, optionally bypassing active main devices; solos, the temporary track, and devices are restored even when a capture fails. It refuses to run while a track is soloed. --analyze reports spectrum shares by track. Band measurement now runs every band in one ffmpeg pass (asplit into named astats instances) with a 16384-point FFT for the narrow low third-octave bands. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Three tests passed only on a host with Live and ffmpeg: - capture-tracks under --read-only reached tracks_list (a read) and failed to connect on CI. The command now refuses up front, like set automation write, since every capture writes. - spectrum shares checked for ffmpeg before checking the stem files, so a missing file reported CONFIG_INVALID on CI. Stem paths are now validated with the other arguments, before the ffmpeg check. - The missing --start usage error is colored on CI, which splits the option name; the test strips ANSI codes. The quality harness failed on warning growth (26 over a baseline of 20 allowed). capture_tracks takes a ShareAnalysis instead of three analysis arguments, restores bypassed main devices in a context manager, and the shares, band-graph, and command-registration code is split into helpers. --focus without --analyze is now rejected by the CLI, where both options live. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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 #128, which is stacked on #127. Merge those first; this PR's base then moves down.
Bug fix:
session capturenever honored--startcapture_sessionmoved the playhead while the transport was stopped, which Live ignores. It then fired the clip and pressed play, so each capture began wherever the previous stop left the playhead. Firing from a stopped transport restarts the song at beat 0.Back-to-back captures drifted through the song. On the Phase Trance set:
transport playre-applies the playhead;capture_sessioncalledtransport_playdirectly and never did.Fix:
--start, then fire. Live's 1-bar launch quantization begins the recording exactly at--start. Verified in Live: a capture at beat 252 had the kick enter 1.8 s in, matching the arrangement.recorded_start_beat= stop position − file length (from the WAV header). If it is more than half a beat from--start(e.g. launch quantization ≠ 1 Bar), the command fails withstep: verify_recorded_start.--startis now required and must be at least one bar, because the pre-roll needs a bar before it.session capture's old default of 0 can no longer be honored.New commands
audio spectrum shares --stem LABEL=PATH …reports, per band:shares_pct: each stem's share of the band's summed energydominant: the stem with the largest shareband_totals_dbfs: the summed level--focus LABEL,focus.margin_db: the focus stem minus the loudest other stem (negative = gap to close)--resolution third-octaveuses the 29 ISO bands from 25 Hz to 16 kHz.session capture-tracks --start B --track-index N …captures each track on its own:--bypass-main-devicesturns off active main devices for the capture.finallyblocks, even when a capture fails.--analyze,--resolution,--focusfeedspectrum shares, with labels from track names (index:namewhen names repeat).asplitinto namedastats@bNinstances, joined byamix), with a 16384-point FFT so the 22–28 Hz third-octave band holds more than one bin.Public contract impact (intentional)
audio spectrum shares,session capture-tracks.session capture:--startis required (≥ one bar), and the result addsrecorded_start_beat.docs/mastering.mdare updated.Tests
tests/test_capture.py: call order (play before playhead before fire), pre-roll per time signature, pre-roll validation, recorded-start mismatch, and existing behaviors on the new flow.tests/test_capture_tracks.py: solo/temporary-track sequence, device bypass and restore, restore on failure, duplicate labels,--analyzewiring, validation (empty, duplicate, unknown, already soloed,--focuswithout--analyze, bad resolution before capturing),--read-onlyblocking.tests/test_spectrum_shares.py: share math, silent bands, focus margins, third-octave bands, validation, CLI--stemparsing and report, missing file; plus real ffmpeg (an 80/20 split of a tone at half amplitude).tests/test_audio_spectrum_bands.py: single-pass graph, custom bands, readings found by instance name.Validation
ruff check,ruff format --check,dev_checks: 1432 passedcapture-tracksproduced audio for the full window on every track, with solos, the temporary track and main devices restored.session capture --start 192reportedrecorded_start_beat: 192.0.Known limit: shares average the whole window, so a track that rests for part of it reads low. The docs say to check its level while it plays.
🤖 Generated with Claude Code