ddf.minim.ugens
Class GranulateRandom

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

public class GranulateRandom
extends UGen

GranulateRandom is granular synthesis of the incoming audio. Currently, there are no inputs to this UGen other than the incoming audio. All parameters must be set at construction. The envelope of these sounds has a linear fade in and fade out.

Author:
Anderson Mills

Nested Class Summary
 
Nested classes/interfaces inherited from class ddf.minim.ugens.UGen
UGen.InputType, UGen.UGenInput
 
Field Summary
 UGen.UGenInput audio
          The default input is "audio."
 UGen.UGenInput fadeLenMax
          Controls the maximum length of the fade in and fade out.
 UGen.UGenInput fadeLenMin
          Controls the minimum length of the fade in and fade out.
 UGen.UGenInput grainLenMax
          Controls the manimum length of each grain.
 UGen.UGenInput grainLenMin
          Controls the minimum length of each grain.
 UGen.UGenInput spaceLenMax
          Controls the manimum space between each grain.
 UGen.UGenInput spaceLenMin
          Controls the minimum space between each grain.
 
Constructor Summary
GranulateRandom()
          Constructor for GranulateRandom.
GranulateRandom(float grainLengthMin, float spaceLengthMin, float fadeLengthMin, float grainLengthMax, float spaceLengthMax, float fadeLengthMax)
          Constructor for GranulateRandom.
GranulateRandom(float grainLengthMin, float spaceLengthMin, float fadeLengthMin, float grainLengthMax, float spaceLengthMax, float fadeLengthMax, float minAmp, float maxAmp)
          Constructor for GranulateRandom
 
Method Summary
protected  void sampleRateChanged()
          Use this method to notify GranulateRandom that the sample rate 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
 

Field Detail

audio

public UGen.UGenInput audio
The default input is "audio."


grainLenMin

public UGen.UGenInput grainLenMin
Controls the minimum length of each grain.


spaceLenMin

public UGen.UGenInput spaceLenMin
Controls the minimum space between each grain.


fadeLenMin

public UGen.UGenInput fadeLenMin
Controls the minimum length of the fade in and fade out.


grainLenMax

public UGen.UGenInput grainLenMax
Controls the manimum length of each grain.


spaceLenMax

public UGen.UGenInput spaceLenMax
Controls the manimum space between each grain.


fadeLenMax

public UGen.UGenInput fadeLenMax
Controls the maximum length of the fade in and fade out.

Constructor Detail

GranulateRandom

public GranulateRandom()
Constructor for GranulateRandom. grainLengthMin, minimum grain length of each grain, defaults to 10 msec. spaceLengthMin, minimum space between each grain, defaults to 20 msec. fadeLengthMin, minimum length of the linear fade in and fade out of the i grain envelope, defaults to 2.5 msec. grainLengthMax, maximum grain length of each grain, defaults to 100 msec. spaceLengthMax, maximum space between each grain, defaults to 200 msec. fadeLengthMax, maximum length of the linear fade in and fade out of the grain envelope, defaults to 25 msec. minAmp, minimum amplitude of the envelope, defaults to 0. maxAmp, maximum amplitude of the envelope, defaults to 1.


GranulateRandom

public GranulateRandom(float grainLengthMin,
                       float spaceLengthMin,
                       float fadeLengthMin,
                       float grainLengthMax,
                       float spaceLengthMax,
                       float fadeLengthMax)
Constructor for GranulateRandom. minAmp, minimum amplitude of the envelope, defaults to 0. maxAmp, maximum amplitude of the envelope, defaults to 1.

Parameters:
grainLengthMin - minimum grain length of each grain
spaceLengthMin - minimum space between each grain
fadeLengthMin - minimum length of the linear fade in and fade out of the grain envelope
grainLengthMax - maximum grain length of each grain
spaceLengthMax - maximum space between each grain
fadeLengthMax - maximum length of the linear fade in and fade out of the grain envelope

GranulateRandom

public GranulateRandom(float grainLengthMin,
                       float spaceLengthMin,
                       float fadeLengthMin,
                       float grainLengthMax,
                       float spaceLengthMax,
                       float fadeLengthMax,
                       float minAmp,
                       float maxAmp)
Constructor for GranulateRandom

Parameters:
grainLengthMin - minimum grain length of each grain
spaceLengthMin - minimum space between each grain
fadeLengthMin - minimum length of the linear fade in and fade out of the grain envelope
grainLengthMax - maximum grain length of each grain
spaceLengthMax - maximum space between each grain
fadeLengthMax - maximum length of the linear fade in and fade out of the grain envelope
minAmp - minimum amplitude of the envelope
maxAmp - maximum amplitude of the envelope
Method Detail

sampleRateChanged

protected void sampleRateChanged()
Use this method to notify GranulateRandom that the sample rate has changed.

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.