public class PinkNoise extends java.lang.Object implements AudioSignal
| Modifier and Type | Field and Description |
|---|---|
protected float |
amp |
protected float |
leftScale |
protected float |
pan |
protected float |
rightScale |
| Constructor and Description |
|---|
PinkNoise()
Constructs a pink noise signal with an amplitude of 1.
|
PinkNoise(float amp)
Constructs a pink noise signal with an amplitude of
amp. |
| Modifier and Type | Method and Description |
|---|---|
void |
generate(float[] signal)
Fills
signal with values in the range of [-1, 1]. |
void |
generate(float[] left,
float[] right)
Fills
left and right with values in the range
of [-1, 1]. |
void |
setAmp(float a)
Sets the amplitude of the signal to
a. |
void |
setPan(float p)
Sets the pan of the signal to
p. |
protected float amp
protected float pan
protected float leftScale
protected float rightScale
public PinkNoise()
public PinkNoise(float amp)
amp.
amp should be between 0 and 1.amp - public void setAmp(float a)
a.a - the new amplitude, it will be constrained to [0, 1].public void setPan(float p)
p.p - the new pan, it will be constrained to [-1, 1]public void generate(float[] signal)
AudioSignalsignal with values in the range of [-1, 1].
signal represents a mono audio signal.generate in interface AudioSignalsignal - the float array to fillpublic void generate(float[] left,
float[] right)
AudioSignalleft and right with values in the range
of [-1, 1]. left represents the left channel of a stereo
signal, right represents the right channel of that same
stereo signal.generate in interface AudioSignalleft - the left channelright - the right channel