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.2.tar.gz (25.0 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.2-py3-none-any.whl (24.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: musicgen_minimal-1.1.2.tar.gz
  • Upload date:
  • Size: 25.0 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.2.tar.gz
Algorithm Hash digest
SHA256 1d1b3862c5d617ee2c89229552e0ff6931085913e4a2a0bc45929dbb6bd99c4b
MD5 f3bbe9f0041279003e25200582a02280
BLAKE2b-256 19999da799b9b6953a8879dcd01cb5c9e7e739ac8a5348550d5a84f5525fefb9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for musicgen_minimal-1.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 038701c5f07eec3ce3a53d0e3a1106d115cabb3faef9ef055529cbaaf9748012
MD5 b949d3db2fac9ffb27e112e0972dff4d
BLAKE2b-256 205b28371f54a5a22312b48924d5cb8fc30d016ed8d6a57a770924704839bb26

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