A collection of electronic music projects that are **generated from code** instead of being clicked together in a DAW. Each track lives in its own folder with a deterministic Python script, and the script produces files that open in [Bitwig Studio](https://www.bitwig.com/) (or any DAWproject / MIDI-capable DAW).
Because everything is generated, a track is fully reproducible: the same script always writes the same notes, and arrangements can be changed by editing a few lines and re-running.
├── exit-progressive-emulation/ ← one folder per track
│ ├── README.md ← full track documentation
│ ├── build_track.py ← the generator (Python 3, stdlib only)
│ ├── exit-progressive-emulation.dawproject
│ └── midi/ ← per-track and full-arrangement MIDI
└── progressive-emulation/ ← empty folder with its own empty nested .git (not tracked here)
```
> `progressive-emulation/` is an empty sibling repository with no commits. It is deliberately **not** part of this repo's history; git would otherwise treat it as an embedded repository.
## What each track folder contains
| File | Purpose |
|---|---|
| `build_track.py` | Generator script. Defines the song structure, writes the notes, and exports every file below. |
| `*.dawproject` | Open [DAWproject](https://github.com/bitwig/dawproject) file. Import in Bitwig via **File → Import → DAWproject**. |
| `midi/full_arrangement.mid` | All tracks in a single type 1 MIDI file (tempo and time signature included). |
| `midi/NN_<track>.mid` | One full-length MIDI file per instrument, for dragging into any DAW. |
| `README.md` | Structure, patterns, harmony, file formats and sound-design notes for that track. |
## Requirements
- **Python 3.12** (any recent Python 3 should work). The generators use only the standard library, so there is nothing to install.
- **Bitwig Studio** (or another DAW) to open the result. Bitwig is *not* needed to generate the files.
- Optional, for validation: `xmllint` (libxml2) and the official `Project.xsd` from [bitwig/dawproject](https://github.com/bitwig/dawproject).
## Quick start
```bash
cd exit-progressive-emulation
python3 build_track.py # writes the .dawproject and midi/ next to the script
python3 build_track.py --devices # same, with instrument-device hints on each track
Then open Bitwig and use **File → Import → DAWproject**, or drag the `.mid` files onto instrument tracks.
## How the generators work
All tracks follow the same recipe, so a new one can be started by copying an existing script:
1.**Structure**: a list of sections (name, start bar, length) defines the arrangement.
2.**Harmony**: chord and bass-root tables for the key, plus short progressions chosen per section.
3.**Pattern generators**: one function per instrument returns a list of notes as `(start_beat, duration_beats, midi_key, velocity 0–1)`. A seeded `random.Random` adds small humanisation and variation, so output is stable between runs.
4.**Finalise**: notes are clamped to the arrangement length, dead notes are dropped, velocities are clamped and the list is sorted.
5.**Writers**: a hand-written Standard MIDI File writer (no dependencies) and a DAWproject writer (`project.xml` + `metadata.xml` zipped with `zipfile`).
- Generated tracks carry **notes, clip layout, section markers, volume and pan**, plus (for Exit Progressive Emulation) **low-pass filter automation and kick-ducking volume automation**. Instrument patches and other effects are left to be built in the DAW.
- DAWproject cannot express **sidechain routing**, so "sidechain" in a generated project means volume-ducking automation, not a compressor.