→ toolprocess
The spiral renderer
A script that turns a FLAC file into a spectrogram and then winds that spectrogram into one line. This is where things went when I rebooted this series.
The script, start to finish:
- Read the FLAC and mix it down to mono.
- Slide a 2048-sample Hann window across it, 512 samples at a time, and take the FFT of each frame. That is a short-time Fourier transform: frequency down the rows, time across the columns.
- Convert magnitudes to decibels, set the floor at a low percentile rather than the true minimum, and scale everything to 0–1.
- Look each value up in a color gradient (one of two outside inputs).
- Read the finished image off as a single strand of pixels and lay that strand down as an Archimedean spiral, center outward.
More turns and a thinner line (thickness being the other input) bring the coils close enough to read like the grooves on a record.
No, I’m not going to share the code. It’s silly, overwrought, and it would feel like lending out my toothbrush.