Tutorial · Python · ~8 min

How to Automatically Mix Multitrack Stems in Python

No gain staging by hand. No masking fight. No 32-track ceiling. About five minutes, using our sample stems — and the API tells you what it decided.

PythonMixingAutomix

Step 1 — Sign up and get your API key

  • Sign up (free tier included)
  • Copy the key from the dashboard
  • pip install mlslabs

Step 2 — Pick sample stems

Sample setContents
indie-rock-4stems/vocals, drums, bass, guitar
pop-6stems/vocals, drums, bass, guitar, keys, brass
solo-acoustic/vocals, acoustic guitar

Step 3 — Submit a mixing job

Python
import mlslabs

client = mlslabs.Client("YOUR_API_KEY")
job = client.ai_mixing.submit(
    stems=[
        {"url": "s3://bucket/stems/vocals.wav", "role": "vocals", "priority": 1},
        {"url": "s3://bucket/stems/drums.wav",  "role": "drums",  "priority": 2},
        {"url": "s3://bucket/stems/bass.wav",   "role": "bass",   "priority": 3},
        {"url": "s3://bucket/stems/guitar.wav", "role": "guitar", "priority": 4},
    ],
    preset="modern_pop",
    output={"format": "stereo", "objects": False},
)
print(job.job_id)

Step 4 — What the AI decided (the step competitors skip)

Python
job.wait()
print(job.settings)
# => gain staging per stem, panning, EQ carve points,
#    masking ducking windows, arpeggio-vs-strum decisions

# apply these settings in your own session:
engineer_session.apply(job.settings)

Step 5 — Poll, download, verify

Bash
curl -L -o mix.wav <mix_output_url>
ffprobe -show_streams mix.wav | grep -E "channels|duration"

Next: spatial rendering

Add output format 5.1/7.1.2 with objects enabled and the same stems render into immersive space — the stereo-to-Atmos pipeline's final stage.