Commit fa7aef0b by PLN (Algolia)

add(tools): sample-pack.py — bundle a set's must-travel sample banks

Answers: for a chosen set of tracks, which Dirt-Samples banks does it
actually need, and can that be handed off over swisstransfer to play the
set from a different laptop? Selectors: --tracks (explicit/bare names),
--set NAME (armada/setlist_*.txt or a gig's tracks.json under
../../Web/www/content/lives/{year}/{slug}/, --set list to enumerate),
--all (every .tidal under live/+copycat/, the default). Dry run by
default; --pack DEST copies, --manifest-only writes just the manifest
(the one meant to be committed, so a remote box can verify/reproduce
the bundle without re-scanning).

Reuses tools/setlist_samples.py (extract_names/build_index/resolve_track/
read_setlist/bank_file_count) as the ONLY .tidal parser — no new regex
over .tidal text. A second ad-hoc parser is the specific mistake this
tool exists to avoid (a prior grep false-positived "gfunk" prose against
the gfunk_* banks).

THE MAPPED-ONLY FILTER: only banks actually mapped into the Dirt-Samples
root travel (a real dir there, or a symlink into ~/Work/Sound/Samples).
Classified as stock (tracked in the Dirt-Samples git checkout — ships
free with a fresh install, excluded unless --include-stock), mapped
(the symlink farm + local additions), extra (~/Work/Sound/Samples/extra),
or unmapped (e.g. tidal-drum-machines, excluded unless --include-unmapped).
The raw ~/Work/Sound/Samples tree (36 GB, mostly work-in-progress) is
never walked directly — only through the same mapped index
setlist_samples.py already resolves against, which is what keeps that
36 GB out of the bundle.

BANK-INDEX SAFETY: `s "bank:N"` indexes files in the order SuperDirt's
pathMatch("*") glob returns them, which skips dotfiles. So packing copies
EVERY non-dotfile in a bank (never subsets), follows symlinks to copy
real content, and preserves the bank's directory name and file names
exactly — dropping even one real file renumbers every index after it and
changes what plays on the receiving machine. --force on a re-pack rmtrees
the destination bank first rather than merging, for the same reason: a
merge leaves stale files from a previous pack sitting next to fresh ones.

Measured against --all today (714 .tidal files, live/+copycat/): 400
banks resolve; 119 are stock (~166 MB) and excluded by default; 265
mapped + 16 extra = 281 must travel, ~15.1 GB total. rhadamanthe_divers
alone is a symlink to 314 files / ~4.3 GB, roughly 30% of the bundle.

Tokens that resolve to no bank (--unresolved) are NOT reported as
missing/broken: ParVagues' `#` is structure-left/values-right
(`$ s "k" # s "jazz"` — k is a rhythm skeleton, jazz is what plays), so
most unresolved tokens are structural placeholders or built-in SuperDirt
synth names (superpiano, moogBass, supersaw...), never dropped samples.
setlist_samples.py's own docstring treats the unresolved set the same
way — as a non-error remainder, not an alarm channel.
parent 747f5be2
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment