GitHunt
SA

Sami210105/moodify-ai

AI-based music mood generation and remix system using MusicGen

๐ŸŽต Moodify AI

AI-powered music generation and remixing platform that creates and transforms audio based on moods and genres.

Python FastAPI Streamlit

โœจ Features

  • ๐ŸŽผ Generate Music - Create original tracks from mood, genre, and text prompts
  • ๐Ÿ”„ Remix Audio - Transform existing audio to match different moods
  • ๐Ÿ“Š Analyze Audio - Extract detailed audio features and characteristics
  • ๐ŸŽจ Beautiful UI - Intuitive Streamlit interface with custom styling

๐Ÿš€ Quick Start

# Clone and setup
git clone https://github.com/yourusername/moodify-ai.git
cd moodify-ai
python -m venv venv
source venv/bin/activate  # or venv\Scripts\activate on Windows
pip install -r requirements.txt

# Terminal 1 - Start Backend
cd backend
uvicorn main:app --reload --host 127.0.0.1 --port 8000

# Terminal 2 - Start Frontend
cd frontend
streamlit run app.py

Open http://localhost:8501 in your browser.

๐Ÿ“ Project Structure

moodify-ai/
โ”œโ”€โ”€ backend/
โ”‚   โ””โ”€โ”€ main.py           # FastAPI server
โ”‚   โ””โ”€โ”€ requirements.txt   #backend-only   
โ”œโ”€โ”€ frontend/
โ”‚   โ””โ”€โ”€ app.py            # Streamlit UI
โ”œโ”€โ”€ requirements.txt      # Dependencies frontend-only
โ””โ”€โ”€ venv/                # Virtual environment

๐Ÿ”ง Tech Stack

  • Backend: FastAPI, PyTorch, Transformers (MusicGen), Librosa
  • Frontend: Streamlit, Matplotlib
  • Audio: Librosa, SoundFile, NumPy

๐Ÿ“ก API Endpoints

Endpoint Method Description
/generate POST Generate new music
/remix POST Remix existing audio
/analyze POST Analyze audio features
/moods GET List available moods

API docs: http://localhost:8000/docs

๐ŸŽฎ Usage

Generate Music:

  1. Select mood and genre
  2. Add text description (optional)
  3. Set duration (5-30 seconds)
  4. Click "Generate Music"

Remix Audio:

  1. Upload audio file (WAV/MP3/OGG)
  2. Choose target mood
  3. Click "Remix Audio"

Analyze Audio:

  1. Upload audio file
  2. Click "Analyze Audio"
  3. View extracted features

โš ๏ธ Important Notes

  • First run downloads MusicGen model (~2.5 GB) - cached for reuse
  • Backend must run before frontend
  • FFmpeg required for audio processing
  • GPU recommended for faster generation

๐Ÿ› Troubleshooting

Connection refused: Ensure backend is running on port 8000

Module not found: Activate venv and reinstall: pip install -r requirements.txt

Slow generation: Normal on CPU (2-5 min). Use GPU for faster results (10-30s)

Requirements Structure

The project uses separate dependency files for frontend and backend.

  • Root requirements.txt โ†’ Frontend (Streamlit Cloud)
  • backend/requirements.txt โ†’ Backend (FastAPI + MusicGen)

This separation avoids cloud deployment limitations and follows standard ML system design.

For technical documentation, see DOCUMENTATION.md

Sami210105/moodify-ai | GitHunt