I recently built a circular spectrogram generator - it’s primary purpose is to take your uploaded audio file and create a visual representation of your sound that you can download as a PNG.
As a bonus feature of the original spectrogram generator, you could also play the sound, grab the “play head” and move it to scrub around the sound, and activate a random mode where it will play back sections of the sound locked to a BPM that you can speed up or slow down. I have since removed these audio features from this project as it grew into something more…
Thanks for reading A Signal in the Static! Subscribe for free to receive new posts and support my work.
I kept thinking about the spectrogram and what else it could be used for, and I realised that I had the beginnings of an instrument. And there it was, the next all consuming rabbit hole to fall down.
TERRAIN is a browser based granular environment that lets you take a sound and turn it into anything from glitchy percussive rhythms to evolving ambient soundscapes. It renders your spectrogram and then let’s you add “grains” that will play back a small portion of the audio. You can then shape the sound of each grain and the overall global sound. All in your browser using the Web Audio and Canvas API.
The name TERRAIN comes from the way you play the spectrogram like it is a physical terrain, each change in density that you see can also be heard.
You have the following parameters to play with:
Sync - activates global tempo and per grain clock division
Key and scale
When sync is inactive (free mode) you have some additional options:
Humanise - Per-trigger randomness (jitter) around each grain’s interval
Drift - Slow evolving random-walk on timing
Rate LFO - Very slow modulation of grain rate
Grain - represented by the “play heads” on the spectrogram, you can drag a grain around the spectrogram to change the location it plays. Each grain has it’s own set of controls:
Scale step, fine tune, pan, reverse, length, gain rate
High pass and low pass filters with modulation options
Global spatial options for width and spray (Random tiny start-position offset per trigger)
Motion options:
Wander - Grains drift around their placed position
Distance - How far grains travel around the ring
Speed - How quickly grains drift
Random - Randomise play head position
Random smooth - How long the random jump takes
At the end of the chain is a simple delay and a custom built reverb. The reverb uses a convolution engine that applies an impulse response representing a physical space. This process blends delayed reflections of the sound back into the signal, producing a natural ambient wash.
You can read the full user guide here to learn more about it’s capabilities or check out my youtube channel for demo videos.
This was the most complex project I’ve built with AI so far and it was a really interesting test when it came to problem solving. I hit a major wall early on with a lot of clicks/pops in the audio that would disappear when the sound was dropped an octave. AI will endlessly try to come up with fixes (all of which failed in this case) but it will never try to reframe the problem. I started to think about how the problem could become a feature and give the instrument a unique identity. I made the audio drop to -1 octave by default so that it became more focussed on the low end.
I later worked out that it was the grain envelope causing the issue so v1.1 removed the -1 octave by default “feature”.
The fact that this is also a musical app meant that there was a lot of refining that had to be done manually so I learnt a lot about granular processes and digital instruments in general. AI can create a function but it can’t listen to the result, and it can’t tell you what sounds good vs bad.
I feel more confident about the place of AI in creative projects like this. It gives you a fantastic base to work from and can speed up the process but it cannot replace the human creative process where faults can become features of expression.
TERRAIN is free to use and I will make the source available on my Github soon if anyone is interested in modifying it.
I have a lot of ideas for future versions of TERRAIN including presets, a PWA and hopefully rebuilding it as a VST so you can use it with your favourite DAW.
I have really enjoyed using TERRAIN to make interesting rhythmic patterns and evolving soundscapes, it can feel like quite a meditative process and I think it has a lot of potential as a performative tool.
Start playing…
https://terrain.aftertone.nz ➔
Thanks for reading A Signal in the Static! Subscribe for free to receive new posts and support my work.

Comments
Nothing yet. Say the first thing.
Sign in to join the conversation.