Skip to content

massimilianoviola/tempo-agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🎧 Tempo Agent — Your AI DJ

Tempo Agent is an interactive AI DJ web app that lets anyone create dynamic, synchronized, multi-layered music just by typing prompts. Starting from an initial beat, users can iteratively add new tracks, all in sync and harmonically aligned.

Demo

Built by Massimiliano Viola, Samuel Navarro, and Joe Guo.

🚀 How to Run the App

Prerequisites

  • Python with pip (tested on 3.10)
  • Node.js with npm (tested on v24.7.0)
  • DeerAPI account and R2 (Cloudflare) storage credentials

1. Install Dependencies

# Backend dependencies
pip install -r requirements.txt

# Frontend dependencies
cd frontend
npm install
cd ..

2. Configure Backend

cd backend/src
cp config.yaml.example config.yaml
# Edit config.yaml with your DeerAPI and R2 credentials
cd ../..

3. Start the Application

Terminal 1 - Backend

cd backend
./start_api.sh

The API will be available at http://localhost:8000

Terminal 2 - Frontend

cd frontend
npm run dev

The app will be available at http://localhost:5173

4. Use the App

  1. Open http://localhost:5173 in your browser
  2. Play some music!
  3. Enter a prompt in the text box (e.g., "Pop, piano, synth, electric guitar, driving bass") and enter to start generation
  4. Wait for the AI to generate your accompaniment
  5. Play the generated track in the multi-track player

5. Troubleshooting

  • Backend won't start: Check that config.yaml exists and has valid credentials
  • Frontend can't connect: Ensure backend is running on port 8000
  • Audio won't play: Try clicking somewhere on the page first to enable audio
  • Generation fails: Check your DeerAPI quota and R2 credentials

⚙️ How It Works

  1. Frontend: User enters prompt → sends to backend API
  2. Backend: Calls add_instrumental() function → generates accompaniment
  3. Backend: Saves file with prompt-based name (e.g., electric_guitar_driving_bass.mp3) into the backend/tracks folder
  4. Frontend: Polls for completion → downloads and plays generated track

🔌 API Endpoints

  • POST /api/generate - Start generation with prompt
  • GET /api/status/{task_id} - Check generation status
  • GET /api/download/{task_id} - Download generated file
  • GET /api/tracks - List all tracks

📁 Files Generated

Generated accompaniments are saved in backend/tracks/ with names like:

  • pop_piano_synth_electric_guitar_driving_bass.mp3
  • jazz_saxophone_smooth_bass_drums.mp3

The backend automatically uses _input.mp3 as the conditioning vocal track source. Press Merge All to swap the default _input.mp3 file with the combination of all current sounds. This will help the newly generated sounds blend better.

About

AI DJ web app turning text prompts into perfectly synced music

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •