Skip to main content

Simple text-to-music generation that actually works - no enterprise complexity

Project description

MusicGen-Minimal v1.1.0

Text-to-music generation that actually works. No bullshit, just music.

What This Does

  • 🎵 Generates music from text descriptions
  • 🚀 Extended generation beyond 30 seconds (NEW)
  • 📦 Batch processing from CSV files (NEW)
  • 🎧 MP3 output support (NEW)
  • 📊 Real-time progress bars (NEW)
  • ✅ Uses Facebook's MusicGen model
  • 💻 Works on CPU (slow) or GPU (fast)

What This Doesn't Do

  • No web interface (yet)
  • No real-time generation
  • No style transfer
  • No MIDI export
  • No audio conditioning

Installation

⚠️ Reality Check: This package downloads 2.7GB of dependencies (PyTorch, etc.) on first install.

# Basic installation
pip install musicgen-minimal

# With MP3 support  
pip install 'musicgen-minimal[audio]'

First install includes:

  • PyTorch (2.1GB) - ML framework
  • Transformers (400MB) - HuggingFace models
  • Other dependencies (300MB)
  • Total: ~2.7GB download, ~7GB disk space

Optional MP3 support:

First use downloads model:

  • Small model: 300MB (recommended)
  • Medium model: 1.5GB (better quality)
  • Large model: 3.2GB (best quality)

Usage

Basic Generation

# Generate 10 seconds of music
musicgen generate "upbeat jazz piano" --duration 10

# Generate 2-minute track (uses extended generation)
musicgen generate "epic orchestral symphony" --duration 120

# Generate with MP3 output (requires pydub)
musicgen generate "lofi hip hop" --output beats.mp3

# Disable progress bars
musicgen generate "ambient nature sounds" --no-progress

Batch Processing

# Create sample CSV template
musicgen create-sample-csv

# Process multiple tracks from CSV
musicgen batch playlist.csv

# Parallel processing with 4 workers
musicgen batch jobs.csv --workers 4

Python API

from musicgen import quick_generate

# Generate 60-second MP3
quick_generate(
    "cinematic trailer music",
    "trailer.mp3", 
    duration=60,
    format="mp3",
    bitrate="320k"
)

Performance (Brutal Honesty)

CPU Performance (Most Users)

  • Model loading: ~30 seconds
  • Generation speed: 0.1x realtime (10x slower)
  • 30-second song: ~5 minutes
  • 2-minute song: ~20 minutes
  • Memory usage: ~4GB RAM

GPU Performance (CUDA)

  • Model loading: ~5 seconds
  • Generation speed: 2-5x realtime
  • 30-second song: ~10 seconds
  • 2-minute song: ~40 seconds
  • Memory usage: ~4GB VRAM

⚠️ WARNING: Long generations on CPU will test your patience!

Why So Simple?

Because it actually works. The original project had 343 files and didn't run. This has 4 files and ships music.

What's New in v1.1.0

Extended Generation

  • Generate music longer than 30 seconds (up to unlimited duration)
  • Automatic segment blending with crossfade
  • Progress tracking for multi-segment generation

Batch Processing

  • Process multiple tracks from CSV files
  • Parallel generation with multiprocessing
  • Mixed format support (WAV and MP3 in same batch)

MP3 Output

  • 75-90% smaller files than WAV
  • Configurable bitrate (128k-320k)
  • Graceful fallback if dependencies missing

Progress Bars

  • Real-time progress for all operations
  • ETA calculation for long generations
  • Optional --no-progress for automation

Contributing

Keep it simple. If your PR adds more than 50 lines, it's too complex.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

musicgen_minimal-1.1.0.tar.gz (24.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

musicgen_minimal-1.1.0-py3-none-any.whl (23.7 kB view details)

Uploaded Python 3

File details

Details for the file musicgen_minimal-1.1.0.tar.gz.

File metadata

  • Download URL: musicgen_minimal-1.1.0.tar.gz
  • Upload date:
  • Size: 24.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for musicgen_minimal-1.1.0.tar.gz
Algorithm Hash digest
SHA256 1467a25599abc22ba557346dc2e804c73f2328570de111c0a70297435204a1c6
MD5 ff1edd2245345917ab116705bbfb8aae
BLAKE2b-256 7021eb90aa807e9dca9ecfb41486565ae68e83a87e82e551dde92cf44acc7d66

See more details on using hashes here.

File details

Details for the file musicgen_minimal-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for musicgen_minimal-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 abfc6ddc4017091e71525f03608ff965993d548c2edd8fca12f005f492813c5b
MD5 f5f8735455da318c97c4c0ed2b4ae4b3
BLAKE2b-256 1dc34c6afedfae03aa5b40052979cffb4da5942a44fe6901c27e9e602e0ddbf8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page