Case study
Mics
C# library + CLI that sonifies any file into music
Point mics at any file and get back a deterministic audio composition.
- C#
- .NET 6
- System.Media
- CLI
Problem & context
Sonification tools are either too complex (Max/MSP, SuperCollider) or too shallow (random notes). I wanted a one-command, deterministic way to turn any file into music.
Constraints & tradeoffs
- Same file must produce the same audio every time.
- CLI + library in one package.
- No external audio dependencies — WAV output only.
Solution
Bytes from the file seed a PRNG which drives pitch, rhythm, and instrument selection. A tiny composition DSL lets users override mappings and layer their own sounds. Output is rendered to a WAV file with pure C#.
Architecture
- 01Input file → byte stream
- 02Byte stream → seeded PRNG
- 03PRNG → note events (pitch, duration, velocity)
- 04Composition DSL for overrides
- 05WAV renderer (System.Media / raw PCM)
Results
- Target framework
- .NET 10
- Install
- dotnet tool install
- Output
- WAV (PCM)
- Deterministic
- Yes
Lessons learned
- Deterministic mapping turns sonification into reproducible art.
- Shipping both a library and a CLI is worth the extra hour of docs.
- Byte-level input is infinitely more fun than a curated dataset.