The Greenman Collective / sketchpad
001
→ 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.

Source
Python
Process
numpy · soundfile · Pillow
Length
n/a
Became
Every cover

The script, start to finish:

  1. Read the FLAC and mix it down to mono.
  2. 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.
  3. Convert magnitudes to decibels, set the floor at a low percentile rather than the true minimum, and scale everything to 0–1.
  4. Look each value up in a color gradient (one of two outside inputs).
  5. 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.