Files

40 lines
1.1 KiB
Markdown
Raw Permalink Normal View History

# MIDI Util Examples
2026-04-17 17:52:33 +01:00
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 |
2026-04-17 22:32:46 +00:00
|---|---|---|
| 01 | basic-chord.py | Chord progressions in C major |
2026-04-17 22:32:46 +00:00
| 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 |
2026-04-17 22:32:46 +00:00
## 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
2026-04-17 22:32:46 +00:00
# Run an example to generate a MIDI file
cd examples/
python3 04-single-note.py
2026-04-17 22:32:46 +00:00
# Play back
fluidsynth -a alsa /usr/share/sounds/sf2/FluidR3_GM.sf2 example.mid
```