4.2 KiB
4.2 KiB
Curated Vibe Mixes Implementation
Overview
This update adds 19 new curated vibe mixes and a Mood-on-Demand feature that allows users to generate custom mixes based on audio features.
Bug Fix
Fixed the genres field bug - the Album model uses genres (JSON array) not genre (string). Added a helper function findTracksByGenrePatterns() that properly queries:
- Track's
lastfmTagsandessentiaGenres(native String[] fields) - Falls back to filtering
album.genresJSON array in application code
New Daily Vibe Mixes (10 tracks each)
| Mix Name | Description | Key Audio Features |
|---|---|---|
| Sad Girl Sundays | Melancholic introspection | valence < 0.35, minor key, arousal < 0.4 |
| Main Character Energy | You're the protagonist ✨ | valence > 0.55, energy > 0.55, danceability > 0.5 |
| Villain Era | Dark & empowering 😈 | minor key, energy > 0.65, aggressive tags |
| 3AM Thoughts | Late night overthinking 🌙 | arousal < 0.35, energy < 0.45, valence < 0.45 |
| Hot Girl Walk | Confident cardio 💅 | danceability > 0.65, BPM 95-135, energy > 0.55 |
| Rage Cleaning | Aggressive productivity 🔥 | energy > 0.75, arousal > 0.65, BPM > 125 |
| Golden Hour | Warm sunset vibes 🌅 | valence > 0.45, acousticness > 0.35, energy 0.25-0.65 |
| Shower Karaoke | Belters you can't help sing 🚿 | instrumentalness < 0.35, energy > 0.55, valence > 0.45 |
| In My Feelings | Let it all out 💔 | valence < 0.4, arousal < 0.55, acousticness > 0.25 |
| Midnight Drive | Late night cruising 🚗 | energy 0.35-0.65, arousal 0.25-0.55, BPM 85-125 |
| Coffee Shop Vibes | Cozy background ☕ | acousticness > 0.4, energy 0.15-0.55 |
| Romanticize Your Life | Aesthetic moments 🎬 | valence 0.35-0.75, arousal 0.25-0.65, acousticness > 0.25 |
| That Girl Era | Self-improvement mode 💪 | valence > 0.55, energy > 0.45, danceability > 0.45 |
| Unhinged | Embrace the chaos 🎪 | Extreme features (high or low everything) |
New Weekly Curated Mixes (20 tracks each)
| Mix Name | Description | Algorithm |
|---|---|---|
| Deep Cuts | Hidden gems 💎 | Tracks with zero or few plays |
| Key Journey | Harmonic progression 🎹 | Ordered by circle of fifths |
| Tempo Flow | Energy arc 📈 | slow → fast → slow BPM journey |
| Vocal Detox | Instrumental escape 🧘 | instrumentalness > 0.75 |
| Minor Key Mondays | All minor key bangers 🖤 | keyScale = 'minor', energy > 0.45 |
Mood-on-Demand Feature
Backend Endpoints
POST /api/mixes/mood- Generate a custom mix based on audio parametersGET /api/mixes/mood/presets- Get available mood presets for the UI
Preset Moods (12 total)
- 😊 Happy & Upbeat
- 😢 Melancholic
- 😌 Chill & Relaxed
- ⚡ High Energy
- 🎯 Focus Mode
- 💃 Dance Party
- 🎸 Acoustic Vibes
- 🖤 Dark & Moody
- 💕 Romantic
- 💪 Workout Beast
- 😴 Sleep & Unwind
- 👑 Confidence Boost
Custom Mix Builder
Users can adjust sliders for:
- Happiness (valence)
- Energy
- Danceability
- Tempo (BPM)
Frontend Changes
New Component: MoodMixer.tsx
A beautiful Spotify-esque modal with:
- Gradient preset cards with emojis
- Smooth animations (Framer Motion)
- Custom range slider controls
- Dark theme matching the app aesthetic
Homepage Integration
Added "Mood Mixer" button next to the "Refresh" button in the "Made For You" section.
Files Modified
Backend
backend/src/services/programmaticPlaylists.ts- Added helper function, fixed 12 genre bugs, added 19 new mix generatorsbackend/src/routes/mixes.ts- Added mood endpoints and presets
Frontend
frontend/lib/api.ts- Added types and API methods for mood mixingfrontend/app/page.tsx- Integrated MoodMixer modalfrontend/components/MoodMixer.tsx- New component (created)
Technical Notes
- All mixes use Essentia audio analysis data (valence, energy, danceability, BPM, key, etc.)
- Fallback to Last.fm tags when audio analysis is insufficient
- Daily mixes: 10 tracks, refreshed daily
- Weekly mixes: 20 tracks, for longer listening sessions
- Mix generation is cached in Redis for performance