Gin
Loading...
Searching...
No Matches
Public Member Functions | List of all members
PinkNoise Class Reference

Pink noise generator using the Voss-McCartney algorithm. More...

#include <gin_noise.h>

Public Member Functions

 PinkNoise ()
 
float nextSample ()
 

Detailed Description

Pink noise generator using the Voss-McCartney algorithm.

PinkNoise produces random samples with a 1/f frequency spectrum (power decreases 3dB per octave). This implementation uses the Voss-McCartney approximation with a middle square Weyl PRNG and octave-sequencing lookup table for efficiency.

Pink noise characteristics:

Implementation details:

Usage:

PinkNoise noise;
// In audio processing loop
for (int i = 0; i < numSamples; ++i)
{
float sample = noise.nextSample();
audioBuffer[i] = sample;
}
Pink noise generator using the Voss-McCartney algorithm.
Definition gin_noise.h:125
float nextSample()
Definition gin_noise.h:138
A lightweight 2D point class for projects that don't use juce_graphics.
Definition gin_point.h:25

LICENSE: Copyright 2020 Thomas Merchant

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE

See also
WhiteNoise

Constructor & Destructor Documentation

◆ PinkNoise()

PinkNoise::PinkNoise ( )

Member Function Documentation

◆ nextSample()

float PinkNoise::nextSample ( )

The documentation for this class was generated from the following file: