โโโโโโโโโโโโ โโโโ โโโโโโ โโโโโโโ
โโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโ
โโโโโโ โโโโโโโโโโโโโโโโโโโโโโ โโโโ
โโโโโโ โโโโโโโโโโโโโโโโโโโโโโ โโโ
โโโ โโโ โโโ โโโโโโ โโโโโโโโโโโโ
โโโ โโโ โโโโโโ โโโ โโโโโโโ
AI-powered ambient soundscapes for deep focus
We've all been there. You sit down to focus, but the silence is deafeningโor worse, your environment is full of distractions. FMAG was born from a simple idea: what if you could generate the perfect ambient soundscape for any focus session, on demand?
FMAG combines the power of AI audio generation with carefully crafted mood presets to create loop-friendly ambient audio that helps you enter (and stay in) flow state. Whether you need the gentle patter of rain on a coffee shop window or the low hum of a spaceship drifting through the cosmos, FMAG has you covered.
- ๐จ 5 Curated Mood Presets - Carefully designed ambient soundscapes
- ๐ค Multiple AI Providers - Support for AudioGen, Bark, and more
- ๐ Loop-Optimized Audio - Seamless fade-in, fade-out, and crossfade
- โฑ๏ธ Flexible Duration - Generate 1-5 minute ambient loops
- ๐๏ธ Audio Processing - Automatic volume normalization
- ๐ฅ๏ธ Beautiful CLI - Rich terminal interface with colors and progress
- ๐ฎ Interactive Mode - Guided generation for beginners
- Python 3.9 or higher
- FFmpeg (for audio processing)
# macOS brew install ffmpeg # Ubuntu/Debian sudo apt install ffmpeg # Windows (with Chocolatey) choco install ffmpeg
# From PyPI (when published) pip install fmag-cli # From source git clone https://github.com/fmag-cli/fmag-cli.git cd fmag-cli pip install -e .
Just run fmag without arguments for a guided experience:
fmag
โโ ๐ง FMAG Interactive โโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Welcome to Interactive Mode! โ
โ โ
โ Let's create the perfect ambient soundscape โ
โ for your focus session. โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Step 1: Select a mood
1. ๐ง๏ธ calm_rain_office
Gentle rain falling outside a cozy office window
2. ๐ฒ forest_cafe
A peaceful cafe nestled in a forest clearing
3. ๐ deep_focus_spaceship
The quiet hum of a spacecraft drifting through deep space
4. ๐ ocean_meditation
Waves gently lapping on a secluded beach at sunset
5. ๐ night_coding_lofi
Late night coding session with lofi beats and city ambience
6. ๐ต Custom prompt
Select mood [1]:
# Generate with a preset mood fmag generate forest_cafe # Specify duration (in minutes) fmag generate night_coding_lofi --duration 3 # Use a specific provider fmag generate ocean_meditation --provider bark # Custom prompt fmag generate "peaceful zen garden with wind chimes and bamboo water fountain" -d 5 # Full options fmag generate calm_rain_office \ --duration 3 \ --provider audiogen \ --output ./my-ambience \ --debug
| Mood | Description | Vibe |
|---|---|---|
๐ง๏ธ calm_rain_office |
Gentle rain on a cozy office window | Calm, focused |
๐ฒ forest_cafe |
A cafe nestled in a forest clearing | Natural, warm |
๐ deep_focus_spaceship |
Spacecraft drifting through deep space | Hypnotic, minimal |
๐ ocean_meditation |
Waves on a secluded beach at sunset | Rhythmic, peaceful |
๐ night_coding_lofi |
Late night coding with lofi beats | Chill, nostalgic |
View all presets:
fmag moods
FMAG supports multiple AI audio generation backends:
| Provider | Description | Setup |
|---|---|---|
audiogen |
OpenAI-compatible audio generation | Set OPENAI_API_KEY |
bark |
Open-source text-to-audio model | pip install bark |
View provider status:
fmag providers
# AudioGen (OpenAI) export OPENAI_API_KEY="your-api-key" # Then generate fmag generate forest_cafe --provider audiogen
โโโโโโโโโโโโ โโโโ โโโโโโ โโโโโโโ
โโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโ
โโโโโโ โโโโโโโโโโโโโโโโโโโโโโ โโโโ
โโโโโโ โโโโโโโโโโโโโโโโโโโโโโ โโโ
โโโ โโโ โโโ โโโโโโ โโโโโโโโโโโโ
โโโ โโโ โโโโโโ โโโ โโโโโโโ
Focus Mode Ambience Generator v1.0.0
AI-powered soundscapes for deep focus
โโ ๐ต Selected Mood โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ ๐ฒ forest_cafe โ
โ โ
โ A peaceful cafe nestled in a forest clearing โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Duration: 3.0 minutes
Provider: audiogen
Output: ./output/
โ ๐ฒ Generating audio with audiogen...
โโ ๐ Complete โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ Audio generated successfully! โ
โ โ
โ Saved to: ./output/fmag-forest_cafe-20241125.mp3โ
โ โ
โ Play with: โ
โ afplay ./output/fmag-forest_cafe-20241125.mp3 โ
โ mpv --loop ./output/fmag-forest_cafe-20241125 โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ FMAG CLI โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโ โ
โ โ CLI โโโโโถโ Core โโโโโถโ Providers โ โ
โ โ (Typer) โ โGenerator โ โ โโโโโโโโโโโโโโโโโ โ โ
โ โโโโโโโโโโโ โโโโโโโโโโโโ โ โ AudioGen โ โ โ
โ โ โ โ โโโโโโโโโโโโโโโโโ โ โ
โ โ โ โ โโโโโโโโโโโโโโโโโ โ โ
โ โผ โผ โ โ Bark โ โ โ
โ โโโโโโโโโโโ โโโโโโโโโโโโ โ โโโโโโโโโโโโโโโโโ โ โ
โ โ Presets โ โ Audio โ โโโโโโโโโโโโโโโโโโโโโโ โ
โ โ Library โ โ Utils โ โ
โ โโโโโโโโโโโ โโโโโโโโโโโโ โ
โ โ โ
โ โผ โ
โ โโโโโโโโโโโโ โ
โ โ FFmpeg โ โ
โ โโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
graph LR
A[Mood Selection] --> B[Prompt Generation]
B --> C[AI Audio Generation]
C --> D[Volume Normalization]
D --> E[Fade In/Out]
E --> F[Loop Optimization]
F --> G[MP3 Export]
fmag-cli/
โโโ src/
โ โโโ fmag/
โ โโโ __init__.py # Package exports
โ โโโ cli.py # Typer CLI interface
โ โโโ core.py # Generation orchestrator
โ โโโ audio_utils.py # FFmpeg audio processing
โ โโโ presets.py # Mood preset definitions
โ โโโ providers/
โ โโโ __init__.py # Provider registry
โ โโโ base.py # Abstract provider interface
โ โโโ audiogen_provider.py
โ โโโ bark_provider.py
โโโ tests/
โ โโโ test_cli.py
โ โโโ test_core.py
โโโ demo_outputs/
โ โโโ sample_output_commentary.md
โโโ README.md
โโโ LICENSE
โโโ pyproject.toml
โโโ requirements.txt
โโโ example_commands.md
# Clone the repository git clone https://github.com/fmag-cli/fmag-cli.git cd fmag-cli # Create virtual environment python -m venv venv source venv/bin/activate # or `venv\Scripts\activate` on Windows # Install in development mode pip install -e ".[dev]"
# Run all tests pytest # Run with coverage pytest --cov=fmag --cov-report=term-missing # Run specific test file pytest tests/test_core.py -v
# Format code black src tests # Lint ruff check src tests # Type checking (optional) mypy src
We welcome contributions! Here's how you can help:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- ๐จ Add new mood presets
- ๐ Implement new audio providers
- ๐ Add internationalization
- ๐ฑ Create a GUI wrapper
- ๐ต Improve audio synthesis algorithms
Generated files are saved to ./output/ by default:
output/
โโโ fmag-forest_cafe-20241125_143022.mp3
โโโ fmag-night_coding_lofi-20241125_144530.mp3
โโโ fmag-ocean_meditation-20241125_150015.mp3
Each file is:
- 192kbps MP3 format
- Loop-optimized with crossfade
- Volume normalized to -16 LUFS
- Fade in/out (0.5 seconds each)
This project is licensed under the MIT License - see the LICENSE file for details.
- Typer - CLI framework
- Rich - Beautiful terminal formatting
- FFmpeg - Audio processing
- Pydub - Audio manipulation
Made with โค๏ธ for focus enthusiasts everywhere