Problem
5,000 tracks generating unique visuals is $115K. Many tracks share genre, BPM range, energy level, and mood -- their visuals could be interchangeable.
Proposal
Build a content-addressable visual library that indexes video segments by:
- Genre cluster (DnB, House, Techno, etc.)
- Energy bucket (low / mid / high)
- Section type (intro / buildup / drop / breakdown / outro)
- BPM range (120-130, 130-140, etc.)
- Mood quadrant (euphoric, dark, chill, aggressive)
Before generating a new segment, query the library. If a matching segment exists within the same cluster, reuse it.
Math
- ~20 genre/energy/mood clusters x 8 segments each = 160 unique segments
- 160 x $1.50 = $240 total for the entire library
- Effective cost: $0.05/track
Even at 100 clusters (finer granularity): $1,200 total = $0.24/track.
Implementation
- Extend
KeyframeCache in cache.py with multi-dimensional indexing
- Add genre/energy/mood classification step before generation
- Replace Jaccard similarity in
find_similar() with embedding-based matching (CLIP)
- Add a "visual library build" command that pre-generates the cluster library
Tradeoff
Visuals won't be unique per song. Two similar DnB tracks will share drop visuals. For a DJ library this is acceptable -- the audience never sees back-to-back identical visuals.
Files to Modify
src/generator/cache.py -- extend indexing
src/pipeline.py -- library lookup before generation
- New:
src/generator/visual_library.py -- clustering and library management
Labels: cost-optimization, feature
Problem
5,000 tracks generating unique visuals is $115K. Many tracks share genre, BPM range, energy level, and mood -- their visuals could be interchangeable.
Proposal
Build a content-addressable visual library that indexes video segments by:
Before generating a new segment, query the library. If a matching segment exists within the same cluster, reuse it.
Math
Even at 100 clusters (finer granularity): $1,200 total = $0.24/track.
Implementation
KeyframeCacheincache.pywith multi-dimensional indexingfind_similar()with embedding-based matching (CLIP)Tradeoff
Visuals won't be unique per song. Two similar DnB tracks will share drop visuals. For a DJ library this is acceptable -- the audience never sees back-to-back identical visuals.
Files to Modify
src/generator/cache.py-- extend indexingsrc/pipeline.py-- library lookup before generationsrc/generator/visual_library.py-- clustering and library managementLabels: cost-optimization, feature