CreaturesDigital/spotify_dancer
4
Spotify Dancer for Reachy Mini
Make your Reachy Mini dance to Spotify music! This app analyzes audio in real-time and generates expressive robot movements synchronized to the beat.
Based on [DJ Reactor](https://huggingface.co/spaces/RyeCatcher/dj_reactor) by RyeCatcher, enhanced with Spotify Connect integration and ALSA loopback for best audio detection quality.
Features
- Spotify Connect - Reachy Mini appears as a speaker in your Spotify app
- Real-time Beat Detection - BPM estimation and beat tracking
- Dance Styles - Energetic, Groovy, Chill, and Hip-Hop modes
- Stream Analysis - Direct audio capture via ALSA loopback (best quality)
- Web Control Panel - Live visualizer with adjustable settings
- Auto-Configuration - Automatically detects and fixes ALSA audio settings
Requirements
- Reachy Mini WiFi version (wireless connectivity required for Spotify Connect)
- Python 3.10+
- Spotify account (Free or Premium)
Installation
From Reachy Mini Dashboard
- Go to
http://reachy-mini.local:8000 - Navigate to Apps
- Search for "Spotify Dancer"
- Click Install
Manual Installation
pip install spotify_dancerSetup
1. Install Spotify Connect (raspotify)
curl -sL https://dtcooper.github.io/raspotify/install.sh | sh
# Configure
sudo nano /etc/raspotify/conf
# Set: LIBRESPOT_NAME="Reachy Mini"
# Set: LIBRESPOT_DEVICE=spotify2. Enable ALSA Loopback (Recommended)
For best audio detection, use ALSA loopback:
sudo modprobe snd-aloop pcm_substreams=1
echo 'snd-aloop' | sudo tee /etc/modules-load.d/loopback.confSee the full ALSA setup guide for multi-output configuration.
3. Fix Service Permissions
Create /etc/systemd/system/raspotify.service.d/override.conf:
[Service]
PrivateUsers=false
PrivateTmp=false
ProtectSystem=false
RemoveIPC=false
User=pollen
Group=audioThen: sudo systemctl daemon-reload && sudo systemctl restart raspotify
Usage
- Start the app from Reachy Mini dashboard
- Open control panel:
http://reachy-mini.local:7860 - Select loopback_in as Audio Input
- Choose a dance style
- Click Start Dancing
- Play music on Spotify → Select "Reachy Mini" as speaker
Dance Styles
Audio Input Options
Architecture
Spotify App → raspotify → ALSA multi-output
├──→ Speaker
└──→ Loopback → Spotify Dancer → RobotTroubleshooting
- No loopback_in device: Run
sudo modprobe snd-aloopand restart the app - Poor detection: Use loopback_in, increase sensitivity, turn up volume
- Tracks skip: Check ALSA config and IPC permissions (see setup guide)
- ALSA errors after reboot: The app auto-detects and fixes card numbers on startup. If issues persist, see the setup guide
License
MIT License
Credits
- DJ Reactor by RyeCatcher - Original dance movement system
- Spotify Connect via raspotify (librespot wrapper)
- Built for the Reachy Mini community
