CoolFace
Apppublic

CreaturesDigital/spotify_dancer

sourceHugging Facemitupdated 4mo agoView on Hugging Face
4likes
App README

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

  1. 1.Go to http://reachy-mini.local:8000
  2. 2.Navigate to Apps
  3. 3.Search for "Spotify Dancer"
  4. 4.Click Install

Manual Installation

bash
pip install spotify_dancer

Setup

1. Install Spotify Connect (raspotify)

bash
curl -sL https://dtcooper.github.io/raspotify/install.sh | sh

# Configure
sudo nano /etc/raspotify/conf
# Set: LIBRESPOT_NAME="Reachy Mini"
# Set: LIBRESPOT_DEVICE=spotify

2. Enable ALSA Loopback (Recommended)

For best audio detection, use ALSA loopback:

bash
sudo modprobe snd-aloop pcm_substreams=1
echo 'snd-aloop' | sudo tee /etc/modules-load.d/loopback.conf

See the full ALSA setup guide for multi-output configuration.

3. Fix Service Permissions

Create /etc/systemd/system/raspotify.service.d/override.conf:

ini
[Service]
PrivateUsers=false
PrivateTmp=false
ProtectSystem=false
RemoveIPC=false
User=pollen
Group=audio

Then: sudo systemctl daemon-reload && sudo systemctl restart raspotify

Usage

  1. 1.Start the app from Reachy Mini dashboard
  2. 2.Open control panel: http://reachy-mini.local:7860
  3. 3.Select loopback_in as Audio Input
  4. 4.Choose a dance style
  5. 5.Click Start Dancing
  6. 6.Play music on Spotify → Select "Reachy Mini" as speaker

Dance Styles

StyleBest ForMovement
EnergeticRock, EDMStrong head bobs, wide sway
GroovyPop, FunkClassic nods, balanced movement
ChillJazz, Lo-FiSmooth tilts, gentle sway
Hip-HopRap, R&BRhythmic nods, bass-driven

Audio Input Options

DeviceQualityNotes
loopback_in⭐ BestDirect stream capture
reachymini_audio_srcPoorMicrophone with echo cancellation issues

Architecture

Spotify App → raspotify → ALSA multi-output
                              ├──→ Speaker
                              └──→ Loopback → Spotify Dancer → Robot

Troubleshooting

  • No loopback_in device: Run sudo modprobe snd-aloop and 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