A real-time collaborative drum machine built for hackathons! Multiple users can connect and contribute to the same drum pattern simultaneously.
- Real-time collaboration - Multiple users can edit the same drum pattern
- Web Audio synthesis - High-quality drum sounds generated using Tone.js
- Parameter controls - Adjust pitch, decay, and volume for each drum track
- 16-step sequencer - Classic drum machine pattern programming
- WebSocket communication - Real-time synchronization across all clients
- Sinatra - Lightweight Ruby web framework
- sinatra-websocket - WebSocket support for real-time communication
- Thin - Event-driven web server
- React - Component-based UI framework
- Vite - Fast development build tool
- Tailwind CSS - Utility-first CSS framework
- Tone.js - Web Audio synthesis library
bundle install
cd frontend
npm install
# From the root directory
ruby app.rb
The backend will start on http://localhost:4567
# From the frontend directory
cd frontend
npm run dev
The frontend will start on http://localhost:5173
Open http://localhost:5173
in multiple browser windows to test real-time collaboration!
- Backend State Management - The Sinatra server maintains the global drum pattern state
- WebSocket Communication - Real-time updates are broadcast to all connected clients
- Audio Synthesis - Each client generates audio locally using Tone.js
- Pattern Synchronization - Step patterns and parameter changes sync across all users
- Kick - Low-frequency drum using MembraneSynth
- Snare - White noise percussion using NoiseSynth
- Hi-hat - Closed metallic percussion using MetalSynth
- Open Hat - Open metallic percussion with longer decay
- Play/Stop - Transport controls for the sequencer
- BPM - Tempo control (60-180 BPM)
- Pattern Grid - Click to toggle steps on/off
- Parameter Sliders - Adjust pitch, decay, and volume per track
This project was built for rapid hackathon development with hot-reloading and real-time collaboration features built-in.
- Backend handles state synchronization and WebSocket management
- Frontend handles audio synthesis and user interface
- Real-time updates ensure all users see changes immediately
Enjoy making beats together! 🥁