The open engine
How a noise color is made
Every color in NoiseZ is made live, one sample at a time, by a small piece of code. It is the same code in the app and on this page, and anyone may use it.
Try it
Move the levels and listen. The chart is worked out by the very code that makes the sound.
The seven colors
White noise
Equal energy at every pitch. Each sample is a fresh random number, so nothing links one moment to the next. It is the brightest of the plain colors and the best at covering sudden sounds.
Pink noise
Energy falls 3 dB with every octave, so every octave carries the same amount. The engine bends white noise through six one-pole filters (Paul Kellet’s refined method), which holds the slope steady from about 20 Hz to 10 kHz. Many people hear it as the most natural.
Brown noise
Energy falls 6 dB per octave. The engine keeps a running total of the white noise and lets a little of it leak away each step, so it never drifts off: x = (x + 0.02 × white) ÷ 1.02. A deep, soft rumble.
Gray noise
White noise bent to match how ears hear. A low shelf adds 9 dB below 250 Hz, a dip takes 9 dB out around 3.2 kHz, and a high shelf adds 4 dB above 9 kHz: three biquad filters from the RBJ cookbook.
Green noise
The middle of the spectrum, where voices and rain live: a 200 Hz high-pass followed by a 1.2 kHz low-pass, both second order. Like a forest with its sharp edges taken off.
Blue noise
Energy rises 3 dB per octave, the opposite of pink. The engine takes the difference between one pink sample and the next. Bright and hissy, best used in small amounts.
Violet noise
Energy rises 6 dB per octave: the difference between one white sample and the next. The brightest color here, a fine mist of high pitches.
Tone, waves and the soft clip
The tone knob is a one-pole low-pass that glides from 400 Hz (dark) to fully open. Waves slowly swell and ease the level over ten seconds, up to 70 percent deep. A soft clip bends anything above 0.8 so that nothing ever clips hard, and the master level glides rather than jumps.
Use it
The engine is a single file with no dependencies, offered under the Apache-2.0 license as the @noisez/noise package: the code only, with none of the app’s sounds or artwork. It runs as an AudioWorklet, directly in Node, or through a ScriptProcessor where worklets are missing.
const NoiseDSP = require('@noisez/noise');
const dsp = new NoiseDSP(48000);
// gains: [white, pink, brown, grey, green, blue, violet]
dsp.setParameters({ gains: [0, 0, 0.3, 0, 0, 0, 0], toneCoefficient: 1, waves: 0 });
dsp.setMaster(0.5);
const left = new Float32Array(128), right = new Float32Array(128);
dsp.render(128, left, right); // false when it rendered silence
// In a browser, as an AudioWorklet:
await audioContext.audioWorklet.addModule('/node_modules/@noisez/noise/noise-dsp.js');
const node = new AudioWorkletNode(audioContext, 'noisez-noise', { outputChannelCount: [2] });
node.port.postMessage({ master: 0.5, params: { gains: [0, 0, 0.3, 0, 0, 0, 0], toneCoefficient: 1, waves: 0 } });
To put the player on a page without writing any code, make an embed.
How is it made?
Every noise color is generated live, from a few lines of open code. Move the sliders and hear what each one does.