Files
pi-agent bc8df7f33b Add 3 composed MIDI tracks (midi_output)
- midnight_drive.mid: 90s House/Dance at 128 BPM (75s, 5-track)
  Arpeggiated synth lead, driving bass, pads, brass stabs, dance beat

- starlit_conversation.mid: 90s Slow Jam/Love Song at 88 BPM (99s, 4-track)
  Rhodes electric piano, strings, choir pads, soft drum groove

- tronica.mid: 90s Trance/EBM at 138 BPM (69s, 4-track)
  Multi-section arpeggiated lead, wide pads, trance beat, accent lead

Each .mid has a corresponding .py source showing how to compose it with MIDIUtil.
2026-04-17 22:32:46 +00:00

40 lines
1.1 KiB
Markdown

# MIDI Util Examples
Working examples created from the [MIDIUtil](https://github.com/MarkCWirt/MIDIUtil) source repo patterns.
All examples use MIDIUtil with beats-based (not ticks-based) time, the cleanest API for MIDI composition.
## Setup
```bash
pip3 install --break-system-packages MIDIUtil
sudo apt-get install -y fluidsynth fluid-soundfont-gm
```
## Examples
| # | File | Description |
|---|---|---|
| 01 | basic-chord.py | Chord progressions in C major |
| 02 | 90s-dance-track.py | Full multi-track 90s dance composition |
| 03 | arpeggiator.py | Automated arpeggiator with patterns |
| 04 | single-note.py | Minimal single-note example |
## Compositions
| # | File | Genre | Duration |
|---|---|---|---|
| 1 | `midi_output/midnight_drive.mid` | 90s House/Dance (128 BPM, 75s) |
| 2 | `midi_output/starlit_conversation.mid` | 90s Slow Jam/Love Song (88 BPM, 99s) |
| 3 | `midi_output/tronica.mid` | 90s Trance/EBM (138 BPM, 69s) |
## Quick Start
```bash
# Run an example to generate a MIDI file
cd examples/
python3 04-single-note.py
# Play back
fluidsynth -a alsa /usr/share/sounds/sf2/FluidR3_GM.sf2 example.mid
```