|
1 | 1 | # Tonn API Examples |
2 | 2 |
|
3 | | -Code examples for integrating with the [Tonn API](https://tonn-portal.roexaudio.com) - professional audio mixing, mastering, and analysis powered by AI. |
| 3 | +Code examples for integrating with the [Tonn API](https://tonn-portal.roexaudio.com) — professional audio mixing, mastering, and analysis powered by AI. |
| 4 | + |
| 5 | +**Perfect for:** Junior developers, indie musicians, and anyone building audio apps. |
4 | 6 |
|
5 | 7 | ## What Can You Build? |
6 | 8 |
|
7 | | -- **Mix Analysis**: Get detailed feedback on your mixes (loudness, dynamics, stereo, tonal balance) |
8 | | -- **Multitrack Mixing**: Send stems, get a professional mix with AI-suggested settings |
9 | | -- **Mix Enhancement**: Automatically improve stereo mixes without stems |
10 | | -- **Audio Cleanup**: Remove noise from vocals, drums, and other recordings |
11 | | -- **Batch Mastering**: Master an entire album with consistent settings |
| 9 | +| Feature | What It Does | Use Case | |
| 10 | +|---------|--------------|----------| |
| 11 | +| **Mix Analysis** | Get feedback on loudness, dynamics, stereo, tonal balance | Check if your mix is ready for release | |
| 12 | +| **Mix Enhancement** | Auto-improve stereo mixes without stems | Polish rough mixes quickly | |
| 13 | +| **Multitrack Mixing** | Send stems, get a professional mix | Let AI balance your tracks | |
| 14 | +| **Audio Cleanup** | Remove noise, hum, clicks from recordings | Clean up vocals or live recordings | |
| 15 | +| **Batch Mastering** | Master an album with consistent settings | Release-ready EP/album mastering | |
12 | 16 |
|
13 | 17 | ## Quick Start |
14 | 18 |
|
15 | | -Get running in 5 minutes: **[QUICKSTART.md](QUICKSTART.md)** |
| 19 | +### Python |
16 | 20 |
|
17 | 21 | ```bash |
18 | | -# 1. Clone the repo |
19 | 22 | git clone https://github.com/roex-audio/TonnExamples.git |
20 | 23 | cd TonnExamples |
21 | 24 |
|
22 | | -# 2. Install dependencies |
23 | | -pip install requests |
| 25 | +pip install -r requirements.txt |
24 | 26 |
|
25 | | -# 3. Set your API key (get one at https://tonn-portal.roexaudio.com) |
26 | | -export TONN_API_KEY=your_api_key_here |
| 27 | +export TONN_API_KEY=your_api_key_here # Or create a .env file |
27 | 28 |
|
28 | | -# 4. Run an example |
29 | 29 | cd python/examples |
30 | 30 | python 01_mix_analysis.py your_track.wav POP |
31 | 31 | ``` |
32 | 32 |
|
33 | | -## Examples by Language |
| 33 | +### Node.js |
| 34 | + |
| 35 | +```bash |
| 36 | +git clone https://github.com/roex-audio/TonnExamples.git |
| 37 | +cd TonnExamples/nodejs |
| 38 | + |
| 39 | +npm install |
| 40 | + |
| 41 | +export TONN_API_KEY=your_api_key_here # Or create a .env file |
| 42 | + |
| 43 | +node src/examples/01_mix_analysis.js your_track.wav POP |
| 44 | +``` |
| 45 | + |
| 46 | +**Get your API key:** [tonn-portal.roexaudio.com](https://tonn-portal.roexaudio.com) |
| 47 | + |
| 48 | +**Need detailed setup?** See [QUICKSTART.md](QUICKSTART.md) |
| 49 | + |
| 50 | +## Examples |
34 | 51 |
|
35 | | -| Language | Status | Location | |
36 | | -|----------|--------|----------| |
37 | | -| Python | Ready | [python/](python/) | |
38 | | -| Node.js | Coming Soon | [nodejs/](nodejs/) | |
| 52 | +Both Python and Node.js have identical examples: |
39 | 53 |
|
40 | | -## Python Examples |
| 54 | +| # | Example | Description | Typical Runtime | |
| 55 | +|---|---------|-------------|-----------------| |
| 56 | +| 01 | Mix Analysis | Analyze your mix for issues | ~30 seconds | |
| 57 | +| 02 | Mix Comparison | Compare two mixes side-by-side | ~1 minute | |
| 58 | +| 03 | Mix Enhance | Auto-enhance a stereo mix | ~3 minutes | |
| 59 | +| 04 | Multitrack Mix | Mix stems with AI settings | ~2 minutes | |
| 60 | +| 05 | Audio Cleanup | Remove noise/hum/clicks | ~1 minute | |
| 61 | +| 06 | Batch Mastering | Master an entire album | ~2 min/track | |
41 | 62 |
|
42 | | -| Example | Description | |
43 | | -|---------|-------------| |
44 | | -| [01_mix_analysis.py](python/examples/01_mix_analysis.py) | Analyze your mix for issues | |
45 | | -| [02_mix_comparison.py](python/examples/02_mix_comparison.py) | Compare two mixes side-by-side | |
46 | | -| [03_mix_enhance.py](python/examples/03_mix_enhance.py) | Auto-enhance a stereo mix | |
47 | | -| [04_multitrack_mix.py](python/examples/04_multitrack_mix.py) | Mix multiple stems with audio effects | |
48 | | -| [05_audio_cleanup.py](python/examples/05_audio_cleanup.py) | Clean up noisy recordings | |
49 | | -| [06_batch_mastering.py](python/examples/06_batch_mastering.py) | Master an entire album | |
| 63 | +### Python Examples → [python/examples/](python/examples/) |
| 64 | + |
| 65 | +```bash |
| 66 | +cd python/examples |
| 67 | +python 01_mix_analysis.py track.wav POP |
| 68 | +python 03_mix_enhance.py # Uses demo track |
| 69 | +python 06_batch_mastering.py ./my_album |
| 70 | +``` |
| 71 | + |
| 72 | +### Node.js Examples → [nodejs/src/examples/](nodejs/src/examples/) |
| 73 | + |
| 74 | +```bash |
| 75 | +cd nodejs |
| 76 | +node src/examples/01_mix_analysis.js track.wav POP |
| 77 | +node src/examples/03_mix_enhance.js # Uses demo track |
| 78 | +node src/examples/06_batch_mastering.js |
| 79 | +``` |
| 80 | + |
| 81 | +## Using Your API Key |
| 82 | + |
| 83 | +**Option 1: Environment variable** |
| 84 | +```bash |
| 85 | +export TONN_API_KEY=your_api_key_here |
| 86 | +``` |
| 87 | + |
| 88 | +**Option 2: Create a \`.env\` file** (recommended) |
| 89 | +```bash |
| 90 | +echo "TONN_API_KEY=your_api_key_here" > .env |
| 91 | +``` |
| 92 | + |
| 93 | +Both Python and Node.js will automatically load the \`.env\` file. |
50 | 94 |
|
51 | 95 | ## Documentation |
52 | 96 |
|
53 | | -- **[QUICKSTART.md](QUICKSTART.md)** - Get running in 5 minutes |
54 | | -- **[Python README](python/README.md)** - Python-specific setup and details |
55 | | -- **[Audio Effects Guide](docs/AUDIO_EFFECTS_GUIDE.md)** - EQ, compression, panning reference |
| 97 | +| Doc | Description | |
| 98 | +|-----|-------------| |
| 99 | +| [QUICKSTART.md](QUICKSTART.md) | Get running in 5 minutes | |
| 100 | +| [Python README](python/README.md) | Python setup and usage | |
| 101 | +| [Node.js README](nodejs/README.md) | Node.js setup and usage | |
| 102 | +| [Troubleshooting](docs/TROUBLESHOOTING.md) | Common issues and fixes | |
| 103 | +| [Audio Effects Guide](docs/AUDIO_EFFECTS_GUIDE.md) | EQ, compression, panning reference | |
56 | 104 |
|
57 | 105 | ### Tutorials |
58 | 106 |
|
59 | | -- [Mix Analysis Tutorial](docs/tutorials/mix_analysis.md) |
60 | | -- [Mix Comparison Tutorial](docs/tutorials/mix_comparison.md) |
61 | | -- [Mix Enhance Tutorial](docs/tutorials/mix_enhance.md) |
62 | | -- [Multitrack Mixing Tutorial](docs/tutorials/multitrack_mixing.md) |
63 | | -- [Batch Mastering Tutorial](docs/tutorials/batch_mastering.md) |
64 | | -- [Audio Cleanup Tutorial](docs/tutorials/audio_cleanup.md) |
| 107 | +- [Mix Analysis](docs/tutorials/mix_analysis.md) — Check your mix against industry standards |
| 108 | +- [Mix Comparison](docs/tutorials/mix_comparison.md) — A/B compare two versions |
| 109 | +- [Mix Enhance](docs/tutorials/mix_enhance.md) — Auto-improve your mix |
| 110 | +- [Multitrack Mixing](docs/tutorials/multitrack_mixing.md) — AI-assisted stem mixing |
| 111 | +- [Batch Mastering](docs/tutorials/batch_mastering.md) — Master your album |
| 112 | +- [Audio Cleanup](docs/tutorials/audio_cleanup.md) — Remove unwanted noise |
65 | 113 |
|
66 | 114 | ## Repository Structure |
67 | 115 |
|
68 | 116 | ``` |
69 | 117 | TonnExamples/ |
70 | | -├── README.md # This file |
71 | | -├── QUICKSTART.md # 5-minute getting started |
72 | | -├── requirements.txt # Python dependencies |
73 | | -├── .env.example # Environment variable template |
| 118 | +├── README.md # You are here |
| 119 | +├── QUICKSTART.md # 5-minute setup guide |
| 120 | +├── LICENSE # MIT License |
| 121 | +├── requirements.txt # Python dependencies |
| 122 | +├── .env.example # API key template |
74 | 123 | │ |
75 | | -├── python/ # Python examples |
76 | | -│ ├── README.md # Python-specific docs |
77 | | -│ ├── examples/ # Runnable scripts |
78 | | -│ ├── shared/ # Reusable utilities |
79 | | -│ └── payloads/ # Example JSON payloads |
| 124 | +├── python/ |
| 125 | +│ ├── README.md # Python docs |
| 126 | +│ ├── examples/ # 6 runnable scripts |
| 127 | +│ ├── shared/ # TonnClient utility class |
| 128 | +│ └── payloads/ # Example JSON configs |
80 | 129 | │ |
81 | | -├── docs/ # Documentation |
82 | | -│ ├── AUDIO_EFFECTS_GUIDE.md |
83 | | -│ └── tutorials/ # Step-by-step guides |
| 130 | +├── nodejs/ |
| 131 | +│ ├── README.md # Node.js docs |
| 132 | +│ ├── package.json # Dependencies |
| 133 | +│ ├── src/examples/ # 6 runnable scripts |
| 134 | +│ ├── src/shared/ # TonnClient utility class |
| 135 | +│ └── payloads/ # Example JSON configs |
84 | 136 | │ |
85 | | -└── nodejs/ # Node.js examples (coming soon) |
| 137 | +└── docs/ |
| 138 | + ├── TROUBLESHOOTING.md # Common issues |
| 139 | + ├── AUDIO_EFFECTS_GUIDE.md |
| 140 | + └── tutorials/ # Step-by-step guides |
86 | 141 | ``` |
87 | 142 |
|
88 | | -## Get an API Key |
89 | | - |
90 | | -1. Go to [tonn-portal.roexaudio.com](https://tonn-portal.roexaudio.com) |
91 | | -2. Create an account |
92 | | -3. Copy your API key |
93 | | -4. Set it as an environment variable: `export TONN_API_KEY=your_key` |
94 | | - |
95 | 143 | ## Support |
96 | 144 |
|
97 | | -- **API Documentation**: [tonn-portal.roexaudio.com](https://tonn-portal.roexaudio.com) |
98 | | -- **Email**: support@roexaudio.com |
99 | | -- **Issues**: [GitHub Issues](https://github.com/roex-audio/TonnExamples/issues) |
| 145 | +- **Having issues?** → [Troubleshooting Guide](docs/TROUBLESHOOTING.md) |
| 146 | +- **API docs** → [tonn-portal.roexaudio.com](https://tonn-portal.roexaudio.com) |
| 147 | +- **Email** → support@roexaudio.com |
| 148 | +- **Bugs** → [GitHub Issues](https://github.com/roex-audio/TonnExamples/issues) |
100 | 149 |
|
101 | 150 | ## License |
102 | 151 |
|
103 | | -MIT License - see [LICENSE](LICENSE) for details. |
| 152 | +MIT License — see [LICENSE](LICENSE) for details. |
0 commit comments