Skip to main content

Create lush, generative ambient music with spacey textures

Project description

🎼 Ambient Generator TUI

Create lush, generative ambient music with spacey textures in your terminal.

📸 View Screenshots | 🎵 Listen to Examples | 📖 Full Documentation

Features

  • 🎼 Multiple scales - Currently featuring Japanese pentatonic scales (Hirajoshi, In Sen, Kumoi, Yo)
  • 🎹 Five layered instruments (Pad, Flute, Vibraphone, Strings, Music Box)
  • 🎚️ Adjustable tempo and length
  • 🎨 Multiple soundfonts (3 high-quality GM soundfonts included)
  • 🎛️ Audio effects (Reverb and Paulstretch time-stretching)
  • 📦 Export to MIDI, WAV, and MP3
  • 💻 Beautiful terminal user interface (TUI)
  • Simple setup - one dependency (PortAudio), then pip install!

Installation

macOS

# Install PortAudio first
brew install portaudio

# Install ambient-gen
pip install ambient-gen

Linux (Ubuntu/Debian)

# Install PortAudio development files
sudo apt-get update
sudo apt-get install portaudio19-dev

# Install ambient-gen
pip install ambient-gen

Windows

# No additional dependencies needed on Windows
pip install ambient-gen

Note: If you skip the PortAudio installation, the app will still work for MIDI generation, but audio rendering (WAV/MP3 export) will be disabled.

Quick Start

Launch the interactive TUI:

ambient-gen

The TUI is fully interactive - use keyboard controls to customize generation!

Keyboard Controls

Generation & Files:

  • g - Generate new track (creates MIDI, WAV, and MP3)
  • o - Open output folder
  • q - Quit

Scale Selection:

  • s - Cycle through scales (Hirajoshi → In Sen → Kumoi → Yo)

Parameters:

  • ↑/k or ↓/j - Adjust tempo (30-120 BPM)
  • →/l or ←/h - Adjust length (4-32 bars)

Instruments:

  • 1 - Toggle Pad layer
  • 2 - Toggle Flute layer
  • 3 - Toggle Vibraphone layer
  • 4 - Toggle Strings layer
  • 5 - Toggle Music Box layer

Audio Options:

  • a - Toggle audio effects (Reverb + Paulstretch)
  • e - Toggle effects only mode (just reverb/paulstretch, no dry signal)
  • f - Cycle soundfonts (FluidR3 GM, GeneralUser GS, SGM V2.01)
  • p - Toggle Paulstretch time-stretching effect

Visual:

  • Ctrl+P - Change color palette

Output Files

Generated files are saved to ~/Desktop/ambient_gen_output/:

  • ambient_YYYYMMDD_HHMMSS.mid - MIDI file
  • ambient_YYYYMMDD_HHMMSS.wav - High-quality WAV audio (44.1kHz, 16-bit)
  • ambient_YYYYMMDD_HHMMSS.mp3 - Compressed MP3 audio (192kbps)

How It Works

  1. Generates MIDI: Creates generative compositions using Japanese pentatonic scales with intelligent note placement and dynamics
  2. Renders Audio: Uses tinysoundfont to synthesize audio with high-quality GM soundfonts (automatically extracted on first run)
  3. Applies Effects: Optional reverb and Paulstretch time-stretching for ambient textures
  4. Converts to MP3: Automatically uses FFmpeg (via static-ffmpeg) to create compressed audio

All of this happens automatically with zero configuration!

Japanese Scales

  • Hirajoshi (平調子): Traditional pentatonic scale (0, 2, 3, 7, 8) - Contemplative and meditative
  • In Sen (陰旋): Mystical and contemplative (0, 1, 5, 7, 10) - Dark and mysterious
  • Kumoi (雲井): Bright and ethereal (0, 2, 3, 7, 9) - Light and floating
  • Yo (陽): Simple and peaceful (0, 2, 5, 7, 9) - Major pentatonic, uplifting

Included Soundfonts

The package includes 3 high-quality, freely-licensed General MIDI soundfonts (compressed to 41MB):

  • FluidR3 GM (23MB) - Clean, balanced GM soundfont (MIT License)
  • GeneralUser GS (7MB) - Excellent pads and flutes, perfect for ambient (Custom Permissive License)
  • SGM V2.01 (27MB) - Rich, warm ambient tones (GPLv3)

Soundfonts are automatically extracted from a compressed archive on first import.

Technical Details

  • Audio Quality: 44.1kHz, 16-bit stereo WAV
  • MIDI Resolution: 960 ticks per quarter note
  • Effects: Freeverb reverb, Paulstretch time-stretching (4x stretch)
  • Package Size: ~41MB (soundfonts compressed with xz)
  • Python Version: 3.8+

Credits

Links

License

MIT License - see LICENSE file for details.

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

ambient_gen-1.1.1.tar.gz (43.3 MB view details)

Uploaded Source

Built Distribution

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

ambient_gen-1.1.1-py3-none-any.whl (43.3 MB view details)

Uploaded Python 3

File details

Details for the file ambient_gen-1.1.1.tar.gz.

File metadata

  • Download URL: ambient_gen-1.1.1.tar.gz
  • Upload date:
  • Size: 43.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ambient_gen-1.1.1.tar.gz
Algorithm Hash digest
SHA256 34ff66d7b6fe676dd98f71f1065ee0766c964c3c8ace220817ed6f074ce4fe7a
MD5 108576caa04bcfdbc04bebaf9d6477c0
BLAKE2b-256 35c73fc71e56e9d960030f7ef05e55f3611ef7d01bf532cd1d77af3cd59620fc

See more details on using hashes here.

Provenance

The following attestation bundles were made for ambient_gen-1.1.1.tar.gz:

Publisher: publish.yml on beowulf-audio/ambient-gen-tui

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ambient_gen-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: ambient_gen-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 43.3 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ambient_gen-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 13d6d2e0eea005bb0d40ca424515c03ab110c8cc19c527ccccdadb2139aa8091
MD5 9e4b9513597101fd5b160a2e9e030c52
BLAKE2b-256 5d6872b938aa026303f24626ce8eedb4768495ed245f1a1edf6746fe6c232bec

See more details on using hashes here.

Provenance

The following attestation bundles were made for ambient_gen-1.1.1-py3-none-any.whl:

Publisher: publish.yml on beowulf-audio/ambient-gen-tui

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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