ddf.minim.ugens
Class Gain

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

public class Gain
extends UGen

Gain is another way of expressing an increase or decrease in the volume of something. It is represented in decibels (dB), which is a logorithmic scale. A gain of 0 dB means that you are not changing the volume of the incoming signal at all, positive gain boosts the signal and negative gain decreases it. You can effectively silence the incoming signal by setting the gain to something like -60.

Author:
Damien Di Fede

Nested Class Summary
 
Nested classes/interfaces inherited from class ddf.minim.ugens.UGen
UGen.InputType, UGen.UGenInput
 
Field Summary
 UGen.UGenInput audio
          The audio input is where incoming signals should be patched, however you do not need to patch directly to this input because patching to the Gain itself will accomplish the same thing.
 UGen.UGenInput gain
          The gain input controls the value of this Gain.
 
Constructor Summary
Gain()
          Construct a Gain UGen with a value of 0 dB, which means it will not change the volume of something patched to it.
Gain(float dBvalue)
          Construct a Gain with the specific dBvalue.
 
Method Summary
 void setValue(float dBvalue)
          Set the value of this Gain to a given dB value.
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
 

Field Detail

audio

public UGen.UGenInput audio
The audio input is where incoming signals should be patched, however you do not need to patch directly to this input because patching to the Gain itself will accomplish the same thing.


gain

public UGen.UGenInput gain
The gain input controls the value of this Gain. It will be interpreted as being in dB. 0 dB means that the incoming signal will not be changed, positive dB increases the amplitude of the signal, and negative dB decreases it. You can effectively silence the incoming signal by setting the gain to something like -60.

Constructor Detail

Gain

public Gain()
Construct a Gain UGen with a value of 0 dB, which means it will not change the volume of something patched to it.


Gain

public Gain(float dBvalue)
Construct a Gain with the specific dBvalue. 0 dB is no change to incoming audio, positive values make it louder and negative values make it softer.

Parameters:
dBvalue -
Method Detail

setValue

public void setValue(float dBvalue)
Set the value of this Gain to a given dB value.

Parameters:
dBvalue -

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.