ddf.minim.ugens
Class GranulateSteady

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

public class GranulateSteady
extends UGen

A UGen which chops the incoming audio into steady grains of sound. 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 fadeLen
          Controls the length of the fade in and fade out.
 UGen.UGenInput grainLen
          Controls the length of each grain.
 UGen.UGenInput spaceLen
          Controls the space between each grain.
 
Constructor Summary
GranulateSteady()
          Constructor for GranulateSteady.
GranulateSteady(float grainLength, float spaceLength, float fadeLength)
          Constructor for GranulateSteady.
GranulateSteady(float grainLength, float spaceLength, float fadeLength, float minAmp, float maxAmp)
          Constructor for GranulateSteady.
 
Method Summary
protected  void sampleRateChanged()
          Use this method to notify GranulateSteady 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."


grainLen

public UGen.UGenInput grainLen
Controls the length of each grain.


spaceLen

public UGen.UGenInput spaceLen
Controls the space between each grain.


fadeLen

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

Constructor Detail

GranulateSteady

public GranulateSteady()
Constructor for GranulateSteady. grainLength, length of each grain, defaults to 10 msec. spaceLength, space between each grain, defaults to 20 msec. fadeLength, length of the linear fade in and fade out of the grain envelope, defaults to 2.5 msec. minAmp, minimum amplitude of the envelope, defaults to 0. maxAmp, maximum amplitude of the envelope, defaults to 1.


GranulateSteady

public GranulateSteady(float grainLength,
                       float spaceLength,
                       float fadeLength)
Constructor for GranulateSteady. minAmp, minimum amplitude of the envelope, defaults to 0. maxAmp, maximum amplitude of the envelope, defaults to 1.

Parameters:
grainLength - length of each grain
spaceLength - space between each grain
fadeLength - length of the linear fade in and fade out of the grain envelope

GranulateSteady

public GranulateSteady(float grainLength,
                       float spaceLength,
                       float fadeLength,
                       float minAmp,
                       float maxAmp)
Constructor for GranulateSteady.

Parameters:
grainLength - length of each grain
spaceLength - space between each grain
fadeLength - 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 GranulateSteady 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.