Skip to main content
Glama
DXN1-termux

DXN1-AUDIO-AI-TOOL

by DXN1-termux
README.md
 <p align="center">
  <img src="https://img.shields.io/badge/version-2.0.0-orange?style=for-the-badge" alt="v2.0.0">
  <img src="https://img.shields.io/badge/license-MIT-green?style=for-the-badge" alt="MIT">
  <img src="https://img.shields.io/badge/python-3.10+-blue?style=for-the-badge" alt="Python 3.10+">
  <img src="https://img.shields.io/badge/tools-18_MCP_Tools-red?style=for-the-badge" alt="18 Tools">
</p>

# DXN1-AUDIO-AI-TOOL

AI-powered music production toolkit. Generate music with Suno AI, remix in any DAW, separate stems, master, and more — all controllable by any AI agent (Claude, GPT, etc.) via MCP.

## Install

```bash
# Clone the repo
git clone https://github.com/DXN1-termux/DXN1-DAW-AI-TOOL.git
cd DXN1-DAW-AI-TOOL

# Install dependencies
pip install -r requirements.txt

# (Optional) Install as a command-line tool
pip install -e .
```

That's it. `dxn1` commands are now available.

### Optional extras

```bash
# Stem separation (drums/bass/vocals/other) — needs GPU for speed
pip install demucs torch

# REAPER DAW control
pip install reapy

# Claude Vision (AI screenshot analysis of your DAW mixer)
pip install anthropic

# Suno AI music generation
pip install httpx
```

### Set API keys (optional — local MIDI generation works without any keys)

```bash
export DXN1_SUNO_API_KEY="sk-..."
```

## Quick Start

### Generate music

```bash
# With Suno AI (needs API key)
dxn1 generate "Hardstyle banger with heavy distorted kicks at 150 BPM" --style hardstyle

# Without API key — generates a MIDI file locally
dxn1 generate "Dark trap beat" --local --bpm 140

# Generate MIDI only
dxn1 midi --root Am --scale NATURAL_MINOR --bpm 150 --bars 32 --genre hardstyle
```

### Remix a song

```bash
# Analyze first
dxn1 analyze song.mp3

# Full remix (no DAW needed — pure audio processing)
dxn1 remix song.mp3 --style hardstyle --bpm 150

# Remix with DAW control (REAPER must be running)
dxn1 remix song.mp3 --style trap --backend reaper

# Separate stems first
dxn1 stem song.mp3
```

### Master a track

```bash
dxn1 master track.wav --preset electronic
dxn1 master track.wav --preset hip_hop
```

### Analyze audio

```bash
dxn1 analyze song.mp3
# → BPM: 128.0  Key: C minor  LUFS: -12.3  Duration: 3:42
```

## Use with AI (Claude Desktop, etc.)

Add to your Claude Desktop config:

```json
{
  "mcpServers": {
    "dxn1-audio-ai-tool": {
      "command": "python",
      "args": ["-m", "dxn1_audio_ai_tool.server.mcp_server"]
    }
  }
}
```

Then just tell Claude: **"Make me a hardstyle remix of this song at 150 BPM"** — it knows exactly what to do.

## All Commands

| Command | Description |
|---------|-------------|
| `dxn1 generate "prompt"` | Generate music (Suno AI or local MIDI) |
| `dxn1 remix file.mp3 --style trap` | Full remix pipeline |
| `dxn1 analyze file.mp3` | Detect BPM, key, loudness, duration |
| `dxn1 stem file.mp3` | Split into drums / bass / vocals / other |
| `dxn1 master file.wav --preset modern` | Master a track (5 presets) |
| `dxn1 normalize file.wav --lufs -14` | Normalize to target LUFS |
| `dxn1 midi --bpm 150 --genre hardstyle` | Generate a MIDI arrangement |
| `dxn1 serve` | Start MCP server for AI agents |
| `dxn1 dashboard` | Open real-time web dashboard |

## MCP Tools (18 tools for AI agents)

### AI Music Generation (Suno / Udio)
- `suno_generate` — Generate a full song from text
- `suno_generate_custom` — Custom lyrics with `[Verse]`, `[Chorus]`, `[Drop]` tags
- `suno_extend` — Extend an existing generated track
- `suno_remix` — AI-powered remix via Suno
- `generate_music` — Auto-picks best provider (Suno → Udio → local MIDI)
- `generate_and_import` — Generate music AND load it into a DAW

### Audio Processing
- `analyze_audio` — BPM, key, loudness, duration
- `separate_stems` — Drums / bass / vocals / other via Demucs
- `normalize_audio` — LUFS normalization
- `pitch_shift` — Shift pitch by semitones
- `time_stretch` — Change tempo without changing pitch
- `fade_audio` — Add fade in / fade out

### DAW Control
- `daw_connect` — Connect to FL Studio / REAPER / Audacity / any DAW
- `remix_song` — Full remix pipeline in one call

### Mixing & Mastering
- `apply_mix_preset` — Genre-balanced mix (9 genres)
- `list_mix_presets` — List all available presets
- `master_audio` — Full mastering chain (EQ → compression → limiting → LUFS)

### Local Generation (no API key needed)
- `generate_midi` — Complete MIDI song: chords, melody, bass, drums

## Supported DAWs

| DAW | Cost | Controller | Best For |
|-----|------|-----------|----------|
| **REAPER** | Free trial / $60 | reapy Python API | All genres, all platforms |
| **FL Studio** | $99+ | pywinauto + MIDI Script | Electronic music, Windows |
| **Audacity** | Completely free | Keyboard automation | Basic editing, all platforms |
| **Any DAW** | — | Generic keyboard shortcuts | Quick tasks |

## Environment Variables

| Variable | Default | Description |
|----------|---------|-------------|
| `DXN1_SUNO_API_KEY` | — | Suno AI API key |
| `DXN1_UDIO_API_KEY` | — | Udio API key |
| `DXN1_FL_EXE_PATH` | — | FL Studio executable path |
| `DXN1_OUTPUT_DIR` | `./output` | Output directory |
| `DXN1_SERVER_TRANSPORT` | `stdio` | MCP transport (stdio / sse) |
| `DXN1_VISION_ANTHROPIC_API_KEY` | — | Claude API for vision QC |

## Project Structure

```
dxn1_audio_ai_tool/
├── audio/engine.py              # Analysis, stem separation, normalize, pitch, stretch
├── services/
│   ├── suno_client.py           # Suno AI — generate, extend, remix
│   ├── udio_client.py           # Udio AI — generate, extend
│   └── ai_music_client.py       # Unified client (auto-pick provider)
├── controllers/
│   ├── base.py                  # Abstract DAW interface
│   ├── fl_studio.py             # FL Studio (pywinauto + MIDI Script)
│   ├── reaper_controller.py     # REAPER (reapy)
│   ├── audacity_controller.py   # Audacity (keyboard automation)
│   └── generic_daw.py           # Any DAW (keyboard shortcuts)
├── pipeline/remix.py            # Full remix orchestration
├── generation/midi_generator.py # Algorithmic MIDI songs
├── mixing/presets.py            # 9 genre mix presets
├── mastering/chain.py           # Offline mastering (EQ/comp/limit/LUFS)
├── vision/agent.py              # Claude Vision screenshot analysis
├── feedback/
│   ├── dashboard.py             # Real-time web dashboard
│   ├── overlay.py               # Cursor tracking + screenshot annotation
│   └── action_log.py            # Action history
├── server/
│   ├── mcp_server.py            # 18 MCP tools for AI agents
│   └── system_prompt.py         # System prompt that teaches AI how to use tools
├── cli.py                       # One command for everything
├── config.py                    # All settings + env var support
└── utils.py                     # Logging, timing, helpers
```

## License

MIT