songsplit heißt jetzt unmix: Submodul tools/unmix auf 58ff3fe, Skript, Make-Ziele, Paket, Doku (#1080)

Das Repository wlkns-dev/unmix hat Werkzeug, Paket und Befehl umbenannt (songsplit bleibt dort als Alias). Die Spezifikation ist unverändert. Umgebungsvariablen UNMIX_SRC und UNMIX_VENV, Paket-Befehl singtrainer-unmix, Pfad /usr/share/singtrainer/unmix, Testdaten-Manifest aus dem neuen Beispiel.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-02 14:52:54 +01:00
parent 05cc0a508a
commit 3e8c4c1d78
19 changed files with 146 additions and 146 deletions

57
tools/unmix.sh Executable file
View File

@ -0,0 +1,57 @@
#!/bin/sh
# Startet das Analysewerkzeug `unmix` (Songs in Songpacks zerlegen). Das Werkzeug liegt als Git-Submodul unter
# tools/unmix, im Paket unter /usr/share/singtrainer/unmix; dieses Skript gibt es als tools/unmix.sh und im
# Paket als /usr/bin/singtrainer-unmix.
#
# unmix.sh setup [--yes] einmalig: Python-Umgebung und Abhängigkeiten anlegen (lädt mehrere GB, fragt vorher)
# unmix.sh doctor System- und Hardwareprüfung von unmix
# unmix.sh analyze <audio> -o <ordner> [--lang de] alles andere geht an `unmix` weiter
#
# Die Umgebung liegt in $UNMIX_VENV (Standard: ~/.local/share/singtrainer/unmix-venv), der Quellordner in
# $UNMIX_SRC (Standard: das Submodul neben diesem Skript oder das Paket). Die Einrichtung (`setup`) ist nicht getestet,
# weil sie große Downloads macht; alles andere ist in tools/test_unmix_wrapper.py geprüft.
set -eu
here="$(cd "$(dirname "$0")" && pwd)"
src="${UNMIX_SRC:-}"
if [ -z "$src" ]; then
for c in "$here/unmix" /usr/share/singtrainer/unmix; do
if [ -f "$c/pyproject.toml" ]; then src="$c"; break; fi
done
fi
if [ -z "$src" ] || [ ! -f "$src/pyproject.toml" ]; then
echo "unmix nicht gefunden. Im Repository: git submodule update --init tools/unmix" >&2
echo "(oder UNMIX_SRC auf den Ordner setzen, der pyproject.toml enthält)." >&2
exit 1
fi
venv="${UNMIX_VENV:-${XDG_DATA_HOME:-$HOME/.local/share}/singtrainer/unmix-venv}"
cmd="${1:-}"
if [ "$cmd" = "setup" ]; then
shift
yes=0
[ "${1:-}" = "--yes" ] && yes=1
if ! command -v uv >/dev/null 2>&1; then
echo "uv fehlt (Python-Paketverwaltung). Arch: sudo pacman -S uv" >&2
exit 1
fi
echo "unmix einrichten:"
echo " Quelle: $src"
echo " Umgebung: $venv"
echo "Das lädt Python 3.12 (falls nicht vorhanden), torch, demucs, whisper und weitere Pakete aus dem Netz"
echo "(mehrere GB); die Modelle folgen beim ersten Analyse-Lauf."
if [ "$yes" -ne 1 ]; then
printf "Fortfahren? [j/N] "
read -r answer || answer=""
case "$answer" in j|J|y|Y) ;; *) echo "Abgebrochen."; exit 1 ;; esac
fi
mkdir -p "$(dirname "$venv")"
UV_PROJECT_ENVIRONMENT="$venv" exec uv sync --project "$src" --frozen --no-dev --no-editable --python 3.12
fi
if [ ! -x "$venv/bin/unmix" ]; then
echo "unmix ist noch nicht eingerichtet (kein $venv/bin/unmix)." >&2
echo "Einmalig ausführen: $0 setup" >&2
exit 1
fi
exec "$venv/bin/unmix" "$@"