November 11, 2025
Play it or it didn’t happen
Étude in C minor (2020)
Tiny C “music” post lands — commenters chant: play it already
TLDR: A tiny C snippet claims to generate melodies and teach simple digital audio, but the community roasted the post for missing actual audio and correcting a wrong claim about CD sample rates. People love the hacker vibe, yet demand accuracy and a demo — because sound talk needs sound.
A developer showed off a super tiny C program that turns typed notes into sound and pitched it as proof that making music with code can be simple. They explained digital audio in plain terms — sample rates, byte ranges, and even “just pipe raw bytes to a player” — but the crowd made more noise than the code. The top vibe: show, don’t tell. One commenter sighed, “no audio sample on the webpage?” while another went full coach mode: “If you’re going to talk about sound, give me sound.”
Then came the fact-checkers. A sharp-eyed reader flagged the claim that “CDs used 22 kHz” as wrong, reminding everyone it’s 44.1 kHz per channel. Cue the “actually” energy and a mini lesson in how sampling works. Old-timers chimed in with nostalgia, linking back to the 2020 Hacker News thread where this exact idea sparked 78 comments. Meanwhile, jokers riffed on the command to play raw noise — “cat /dev/urandom | PLAY” — declaring it their avant-garde album. The mood splits: half love the hacker minimalism and tweet-sized code flex, half want accurate audio facts and, most of all, an actual clip. No sound sample? That’s the loudest part of the story.
Key Points
- •A 160-byte C program generates two-octave melodies from stdin by outputting audio bytes.
- •The article explains digital sound via sampling and amplitude quantization, using 8,000 Hz and uint8 format for examples.
- •Amplitude formats discussed include float (−1 to +1), int16 (−32,768 to +32,767), and uint8 (0 to 255).
- •It notes that arrays of all zeros or all 255 result in silence, while varying values produce sound.
- •Cross-platform playback is achieved via command-line tools (aplay, pacat, play, mplayer, ffplay) configured for raw unsigned 8-bit mono at 8,000 Hz.