cutting wind

The last experiment took a block of noise and pounded it into waves on the beach. Wind is much like surf in many ways. But rather than a smooth pulse, wind requires something more erratic. Erratic but not random. A different kind of erratic. Wait, what?!

Yes, there different flavors of chaotic. One flavor was created by Ken Perlin for the original movie “Tron.” It’s a type of bounded randomness rather than careening between extremes with no rhyme or reason. Perlin’s algorithm is popular for generating visual effects with organic textures. It seemed like a good fit for this. (Ken also has a cool online slideshow about how this came about.)

So Perlin noise can (maybe) model the amplitude shifts in a winds natural variation. Better than a simple sine wave oscillation. But wind also shifts frequencies.  Sometimes it sounds like a whistle, other times like guttural sighs and moans. And it frequently contains embedded gusts of more intense sound.

The approach with surf sound was to simply chop off the high frequencies. But wind needs to skip within frequency bands like a flickering flame.

A special kind of filter call the band-pass filter may be useful. It’s one of the prime “sculpting” tools of subtractive synthesis. A little finer blade than the heavy cleaver of the low-pass filter.

A Band-pass filter has a center frequency it filters and a Q value that determines how wide the band is that’s filtered on either side of the target frequency.

So with Perlin controlling the the fluctuation of amplitude and a band-pass filter to slice a frequency for a particular kind of wind, the only thing remaining is the gusts.

For intermittent gusts, the sound will need to be shaped more directly. For this, there’s  another tool in the subtractive toybox called an “envelope” which controls 4 variables: attack, decay, sustain and release. Basically, these control how fast a sound peaks from zero (attack), how fast it drops (decay) to a level it sustains (sustain) and then how fast it drops from there back to zero (release.) With a block of wind-like noise, this should be able to craft a decent gust effect.

The widget created below explores this approach to simulation with controls for all the variables discussed above.

Dials control the band-pass filters frequency and Q value. Play with these to get the right “tone” of wind.

Other dials control the nature of the Perlin noise and a real time graph shows the shape of the resultant waves forming the amplitude of the wind.

The envelope is a set of nodes you can drag to tweak and hit the play button to start a gust of wind at any time into the mix.

This experiment took a little longer than I anticipated. Mainly because I decided to build all the interface elements from scratch. I also skipped the Pure Data sketch and just went straight to code for the audio.

sculpting sound

Sound can be created from scratch –synthesized digitally– in a number of ways. It can be crafted bottom up by combining individual sine waves like blending frequencies of light to create any shade of music, speech or noise. And every sound is a combination of one or more sines. This approach is called additive synthesis.

But sound can also be distilled from complex and chaotic noise by filtering it through virtual prisms, slicing colors off the spectrum from an infinite potential of entropy; this strategy is called subtractive synthesis (and this mixing of sensory metaphors in writing, yeah um, that is known as synesthesia.)

I harbor a suspicion that unshackled from “natural” constraints, a class of stimuli might be discovered foreign to regions of our biology, beyond our brain’s circumscribed exposure in the physical world; stimuli that could trigger insanity, genius, awe or psychosis merely from a brief exposure to its alien imprint. So that’s part of the appeal: learning how to navigate into new territories of sensory experience for their sheer novelty and potential.

And like most explorations here, this one starts with code. In particular, with a visual language called Pure Data used for sound research. Beginning with subtractive synthesis, and arguably the “hello world” of subtractive synthesis, this project is about the simulation of waves on a beach.

The first step is procuring some white noise, which sounds like static and contains a random mix of all audible frequencies, then a different spectra of sound can be created by subtracting a slice and changing amplitudes; it’s the flip side of starting with silence and building sound by adding new frequencies together and tweaking their relative strengths.

The sound of ocean waves is already close to the randomness of noise, due to the vast number of physical forces at work as the water hits the sand and rocks with the tides and the wind and the sun and the sum of energies at play in open seas. So it lends itself naturally to the subtractive approach.

The code below starts by generating white noise and then adds a sine wave of a low frequency (a lfo, or low frequency oscillator), set at 0.05hz, which is one complete cycle every 20 seconds and uses this to control the amplitude (volume) of the noise.  The “lop” is a low pass filter that screens out higher frequency sounds, giving the deeper resonance found in the large currents of the sea and the complete program, expressed in a Pure Data looks like this:

Pure Data program to simulate ocean waves

PD (Pure Data) is great for experimentation, but hard to share unless someone also has Pure Data installed, then they could just load the sketch and run it.

So a second step was converting this PD “patch” to another language native to the web, and browser friendly. I took the opportunity to slap on some dials for tweaking the oscillator and filter values, and added a frequency graph to get a picture of what was happening to the noise visually. And her’s the final widget for experimentation. Have a go, switch it on and play with the dials and see if it can be tuned with just these simple permutations of a block of noise to sound somewhat like a beach. (Closing your eyes and imagining the feel of warm sand between your toes might help too)

See the Pen Surfs Up by Kentskyo (@kentskyo) on CodePen.0

So this was a start, hacking at a chunk of noise. It didn’t really reveal any alien soundscapes, but it’s useful to start by imitating the masters (i.e. nature.)  And it was educational. Next up is hacking noise further for a wind simulation. Writing this up, stumbling around with grammar and constructing gizmos, also gives me a  better understanding and hopefully provides some collateral entertainment.

Resources used in this research track

Technology used

  • Pure Data
  • HTML5 WebAudio and Canvas via Processing P5 and P5.Sound
  • jQuery Knob by Anthony Terrien
  • On/off flip switch from proto.io