Add librosa beat/mood analysis and an Ambience background driven by it
The background worker now runs a real librosa analyzer (tempo, beat grid, per-second energy/valence curves) instead of only the null baseline, kept behind build_analyzer() so a plain checkout without the analysis extra still runs fine. The web player reads that per-track analysis and drives a new animated "Ambience" background (bubbles, colour, current) that reacts to the beat and the mood curve as the track plays, plus a debug overlay for tuning it. Also adds a one-off script to backfill podcast cover art from iTunes.
This commit is contained in:
@@ -24,6 +24,10 @@ dependencies = [
|
||||
|
||||
[project.optional-dependencies]
|
||||
dev = ["mypy>=1.10", "pytest-asyncio>=0.23", "pytest>=8.0", "ruff>=0.5"]
|
||||
# Off by default: the reactive background is nice, not required, and librosa/numpy are
|
||||
# a real install cost on a Pi. Missing this group means `build_analyzer()` falls back
|
||||
# to `NullAnalyzer` and the background stays at its static baseline - never a crash.
|
||||
analysis = ["librosa>=1.0", "numpy>=2.0"]
|
||||
|
||||
[project.scripts]
|
||||
musicmouse = "musicmouse.__main__:main"
|
||||
@@ -62,5 +66,7 @@ files = ["musicmouse"]
|
||||
warn_unreachable = true
|
||||
|
||||
[[tool.mypy.overrides]]
|
||||
module = ["vlc", "serial_asyncio", "ruamel.*"]
|
||||
# numpy ships its own types, but only when the `analysis` extra is installed - a plain
|
||||
# checkout must still type-check clean, so it needs the same treatment as librosa.
|
||||
module = ["vlc", "serial_asyncio", "ruamel.*", "librosa.*", "numpy"]
|
||||
ignore_missing_imports = true
|
||||
|
||||
Reference in New Issue
Block a user