ddf.minim.ugens
Class Noise

java.lang.Object
  extended by ddf.minim.ugens.UGen
      extended by ddf.minim.ugens.Noise

public class Noise
extends UGen

Provides a UGen which generates noise.

Author:
Anderson Mills, Damien Di Fede

Nested Class Summary
static class Noise.Tint
          enumeration used to specify the tint of the noise
 
Nested classes/interfaces inherited from class ddf.minim.ugens.UGen
UGen.InputType, UGen.UGenInput
 
Constructor Summary
Noise()
          Constructor for white noise with an amplitude of 1.0.
Noise(float amplitude)
          Constructor for white noise of the specified amplitude.
Noise(float amplitude, Noise.Tint noiseType)
          Costructor for noise of a specific tint with a specified amplitude.
Noise(Noise.Tint noiseType)
          Constructor for noise of the specified tint with an amplitude of 1.0.
 
Method Summary
protected  void sampleRateChanged()
          Override this method in your derived class to receive a notification when the sample rate of your UGen has changed.
protected  void uGenerate(float[] channels)
          Implement this method when you extend UGen.
 
Methods inherited from class ddf.minim.ugens.UGen
addInput, getLastValues, patch, patch, patch, printInputs, removeInput, sampleRate, setSampleRate, tick, unpatch, unpatch
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Noise

public Noise()
Constructor for white noise with an amplitude of 1.0.


Noise

public Noise(float amplitude)
Constructor for white noise of the specified amplitude.

Parameters:
amplitude -

Noise

public Noise(Noise.Tint noiseType)
Constructor for noise of the specified tint with an amplitude of 1.0.

Parameters:
noiseType - specifies the tint of the noise: WHITE, PINK, RED, BROWN

Noise

public Noise(float amplitude,
             Noise.Tint noiseType)
Costructor for noise of a specific tint with a specified amplitude.

Parameters:
amplitude -
noiseType - specifies the tint of the noise: WHITE, PINK, RED, BROWN
Method Detail

sampleRateChanged

protected void sampleRateChanged()
Description copied from class: UGen
Override this method in your derived class to receive a notification when the sample rate of your UGen has changed. You might need to do this to recalculate sample rate dependent values, such as the step size for an oscillator.

Overrides:
sampleRateChanged in class UGen

uGenerate

protected void uGenerate(float[] channels)
Description copied from class: UGen
Implement this method when you extend UGen. It will be called when your UGen needs to generate one sample frame of audio. It is expected that you will assign values to the array and not simply modify the existing values. In the case where you write a UGen that takes audio input and modifies it, the pattern to follow is to have the first UGenInput you create be your audio input and then in uGenerate you will use the getLastValues method of your audio UGenInput to retrieve the audio you want to modify, which you will then modify however you need to, assigning the result to the values in channels.

Specified by:
uGenerate in class UGen
Parameters:
channels - an array representing one sample frame.