Play music on your Crazyflie drone by modulating the motor PWM frequencies to generate sound.
Tested on Crazyflie 2.1 and 2.1+. Likely incompatible with Brushless. Propellers must be attached to load the motors properly for accurate pitch.
Warning: Use at your own risk. While designed for low thrust, certain note combinations can cause the drone to move, flip, or take off unexpectedly.
-
Flash the jukebox app to your Crazyflie:
cd app_jukebox make -j$(nproc) CLOAD_CMDS="-w radio://0/80/2M/E7E7E7E7E7" make cload
-
Install Python dependencies:
pip install -r pyproject.toml
Run with a MIDI file:
python main.py --midi path/to/your/song.midRun with default test sequence:
python main.pyConnect to a specific Crazyflie:
python main.py --uri radio://0/80/2M/E7E7E7E701 --midi song.midPlay a MIDI file across multiple drones, with each drone playing different tracks:
python main.py --uris radio://0/80/2M/E7E7E7E701 radio://0/80/2M/E7E7E7E702 --midi song.midThe tool will prompt you to select which MIDI tracks to use and how to assign them across drones. Playback is synchronized: all drones receive periodic sync pulses from the host to stay aligned.
Press Ctrl+C to disconnect and terminate. Terminating the program will not stop music playback.