com.jsyn.unitgen
Class PinkNoise

java.lang.Object
  extended by com.jsyn.unitgen.UnitGenerator
      extended by com.jsyn.unitgen.UnitOscillator
          extended by com.jsyn.unitgen.PinkNoise
All Implemented Interfaces:
UnitSource, UnitVoice

public class PinkNoise
extends UnitOscillator

Noise_Pink Generate Pink Noise using Gardner method. Optimization suggested by James McCartney uses a tree to select which random value to replace.

  x x x x x x x x x x x x x x x x 
  x   x   x   x   x   x   x   x   
  x       x       x       x       
  x               x               
  x
 
Tree is generated by counting trailing zeros in an increasing index. When the index is zero, no random number is selected. Author: Phil Burk (C) 1996 SoftSynth.com, All Rights Reserved.


Field Summary
 
Fields inherited from class com.jsyn.unitgen.UnitOscillator
amplitude, DEFAULT_AMPLITUDE, DEFAULT_FREQUENCY, frequency, output, phase
 
Fields inherited from class com.jsyn.unitgen.UnitGenerator
FALSE, TRUE
 
Constructor Summary
PinkNoise()
           
 
Method Summary
 void generate(int start, int limit)
          Perform essential synthesis function.
 double generatePinkNoise()
           
 
Methods inherited from class com.jsyn.unitgen.UnitOscillator
convertFrequencyToPhaseIncrement, getOutput, noteOff, noteOff, noteOn, noteOn
 
Methods inherited from class com.jsyn.unitgen.UnitGenerator
addPort, convertHalfLifeToMultiplier, flattenOutputs, generate, getFramePeriod, getFrameRate, getPortByName, getPorts, getSynthesisEngine, isEnabled, pullData, setCircuit, setFrameRate, setSynthesisEngine, start, stop
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PinkNoise

public PinkNoise()
Method Detail

generate

public void generate(int start,
                     int limit)
Description copied from class: UnitGenerator
Perform essential synthesis function.

Specified by:
generate in class UnitGenerator
Parameters:
start - offset into port buffers
limit - limit offset into port buffers for loop

generatePinkNoise

public double generatePinkNoise()