-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
94 lines (75 loc) · 3.7 KB
/
Makefile
File metadata and controls
94 lines (75 loc) · 3.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# Auris Vive — development tasks
# Usage: make <target>
# Run 'make' or 'make help' to see all targets.
VENV := .venv-ml/bin/activate
PYTHON := . $(VENV) && python3
DEVICE ?= mps
.PHONY: help test test-base test-ml ui dev build export analyse transcribe \
stems-all clean-stems commit
# ── Help ──────────────────────────────────────────────────────────────────────
help:
@echo ""
@echo " Auris Vive"
@echo ""
@echo " Pipeline"
@echo " make ui Launch the pipeline UI (grab/stems/analyse/export)"
@echo " make stems-all Re-run stems for all songs (force)"
@echo " make analyse Re-analyse all songs with stems (adds pitch curves)"
@echo " make export Export all curves + audio to docs/proto/public/data/"
@echo " make transcribe Transcribe vocals for all songs (requires Whisper)"
@echo ""
@echo " Web prototype"
@echo " make dev Start Vite dev server at localhost:5173"
@echo " make build Build prototype for GitHub Pages"
@echo ""
@echo " Tests"
@echo " make test Run full test suite in both environments"
@echo " make test-base Run tests in .venv (Python 3.13)"
@echo " make test-ml Run tests in .venv-ml (Python 3.11)"
@echo ""
@echo " Other"
@echo " make clean-stems Delete all stems/curves (keeps clips)"
@echo ""
# ── Pipeline ──────────────────────────────────────────────────────────────────
ui:
. $(VENV) && AURIS_DEVICE=$(DEVICE) python3 scripts/pipeline-ui.py
analyse:
. $(VENV) && bash scripts/run-analyse.sh
export:
. $(VENV) && python3 scripts/export-curves.py
transcribe:
@echo "▸ transcribing vocals for all songs..."
@. $(VENV) && for slug in $$(python3 -c \
"import json; [print(s['slug']) for s in json.load(open('test_audio/songs.json'))]"); do \
if [ -f "test_audio/$$slug/stems/vocals.flac" ]; then \
echo " $$slug"; \
bash scripts/transcribe-vocals.sh $$slug; \
fi; \
done
stems-all:
@echo "▸ force re-running stems for all songs..."
@. $(VENV) && python3 -c " \
import json, subprocess, os; \
songs = json.load(open('test_audio/songs.json')); \
env = {**os.environ, 'AURIS_DEVICE': '$(DEVICE)'}; \
[subprocess.run(['bash', 'scripts/run-stems.sh', \
f'test_audio/{s[\"slug\"]}/clip.wav', s['slug'], '--force'], env=env) \
for s in songs if (lambda p: p.exists())(__import__('pathlib').Path(f'test_audio/{s[\"slug\"]}/clip.wav'))]"
# ── Web prototype ─────────────────────────────────────────────────────────────
dev:
cd docs/proto && npm run dev
build:
cd docs/proto && npm run build
# ── Tests ─────────────────────────────────────────────────────────────────────
test:
bash scripts/test-all.sh
test-base:
bash scripts/test-base.sh
test-ml:
bash scripts/test-ml.sh
# ── Cleanup ───────────────────────────────────────────────────────────────────
clean-stems:
@echo "▸ removing stems and curves (keeping clips)..."
@find test_audio -name "stems" -type d -exec rm -rf {} + 2>/dev/null || true
@find test_audio -name "curves" -type d -exec rm -rf {} + 2>/dev/null || true
@echo "✓ done"