Real-time MIDI chord detection and suggestion engine. Play chords on a MIDI piano and get intelligent next-chord suggestions streamed to a web UI via WebSocket.
- Python 3.10+
- Node.js 18+
- A MIDI controller (optional — the backend can run without one)
cd backend
pip install -r requirements.txtcd frontend
npm installpython backend/main.pyThe WebSocket server starts on ws://localhost:8000/ws.
To run without a MIDI device:
DISABLE_MIDI=1 python backend/main.pycd frontend
npm run devOpens at http://localhost:3000.
Create a .env file in the backend directory with the following variables:
# Perplexity API Key (required for song recommendations)
PERPLEXITY_API_KEY=your_api_key_here
# Spotify API Credentials (optional - for album art and artist info)
SPOTIFY_CLIENT_ID=your_client_id_here
SPOTIFY_CLIENT_SECRET=your_client_secret_here
# Optional: Disable MIDI input
DISABLE_MIDI=1- Visit https://www.perplexity.ai/
- Sign up or log in
- Navigate to your account settings and generate an API key
- Visit https://developer.spotify.com/dashboard
- Log in or create a developer account
- Create a new application
- Copy the Client ID and Client Secret
- Add them to your
.envfile
Note: Spotify credentials are optional. Without them, song recommendations will still work but won't display album art or artist information.
backend/
main.py # FastAPI WebSocket server + MIDI capture
jass/ # Chord suggestion & tonal tension engine
pianomidi/ # MIDI input & chord detection utilities
requirements.txt
frontend/ # Next.js + React + Tailwind CSS
src/app/