public class Balance extends UGen
A balance of 0 will make no change to the incoming audio. Negative balance will decrease the volume of the right channel and positive balance will decrease the volume of the left channel. This is meant to mirror how a balance knob on a typical stereo operates.
UGen.InputType, UGen.UGenInput
Modifier and Type | Field and Description |
---|---|
UGen.UGenInput |
audio
The audio input is where audio comes in to be balanced.
|
UGen.UGenInput |
balance
The balance control should be driven by UGens that generate values in the
range [-1, 1].
|
Constructor and Description |
---|
Balance()
Construct a Balance with a value of 0 (no change).
|
Balance(float balanceVal)
Construct a balance with a particular value.
|
Modifier and Type | Method and Description |
---|---|
void |
setBalance(float balanceVal)
Set the balance setting to balanceVal.
|
protected void |
uGenerate(float[] channels)
Implement this method when you extend UGen.
|
addAudio, addControl, addControl, addInput, channelCount, channelCountChanged, getLastValues, patch, patch, patch, printInputs, removeInput, sampleRate, sampleRateChanged, setChannelCount, setSampleRate, tick, unpatch, unpatch
public UGen.UGenInput audio
public UGen.UGenInput balance
public Balance()
public Balance(float balanceVal)
balanceVal
- float: a value in the range [-1, 1]public void setBalance(float balanceVal)
balanceVal
- float: the new value for this Balanceprotected void uGenerate(float[] channels)
UGen
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
.