ddf.minim.ugens
Class Constant

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

public class Constant
extends UGen

Just outputs a constant value.

Author:
Anderson Mills

Nested Class Summary
 
Nested classes/interfaces inherited from class ddf.minim.ugens.UGen
UGen.InputType, UGen.UGenInput
 
Constructor Summary
Constant()
          Empty constructor for Constant.
Constant(float val)
          Constructor for Constant.
 
Method Summary
 void setConstant(float val)
          Sets value of Constant during execution.
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, sampleRateChanged, setSampleRate, tick, unpatch, unpatch
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Constant

public Constant()
Empty constructor for Constant. Sets value to 1.0.


Constant

public Constant(float val)
Constructor for Constant. Sets value to val.

Parameters:
val -
Method Detail

setConstant

public void setConstant(float val)
Sets value of Constant during execution.

Parameters:
val -

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.