|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectddf.minim.ugens.UGen
ddf.minim.ugens.Bypass<T>
T
- The type of UGen being wrapped, like GranulateSteady.public class Bypass<T extends UGen>
The Bypass UGen allows you to wrap another UGen and then insert that UGen into your signal chain using Bypass in its place. You can then dynamically route the audio through the wrapped UGen or simply allow incoming audio to pass through unaffected. Using a Bypass UGen allows you to avoid concurrency issues caused by patching and unpatching during runtime from a Thread other than the audio one.
Your usage of Bypass might look something like this:
Bypass granulate = new Bypass( new GranulateSteady() ); filePlayer.patch( granulate ).patch( mainOut );
If you needed to patch something else to one of the inputs of the GranulateSteady,
you'd use the ugen
method of Bypass to retrieve the wrapped UGen
and operate on it:
grainLenLine.patch( granulate.ugen().grainLen );
Now, calling the activate
method will bypass the granulate effect
so that the Bypass object outputs the audio that is coming into it. Calling the
deactivate
method will route the audio through the wrapped effect. The
isActive
method indicates whether or not the wrapped effect is currently
being bypassed.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class ddf.minim.ugens.UGen |
---|
UGen.InputType, UGen.UGenInput |
Constructor Summary | |
---|---|
Bypass(T ugen)
Construct a Bypass UGen that wraps a UGen of type T. |
Method Summary | |
---|---|
void |
activate()
Activate the bypass functionality. |
protected void |
addInput(UGen input)
If you want to do something other than the default behavior when your UGen is patched to, you can override this method in your derived class. |
void |
deactivate()
Deactivate the bypass functionality. |
boolean |
isActive()
|
protected void |
removeInput(UGen input)
If you need to do something specific when something is unpatched from your UGen, you can override this method. |
protected void |
sampleRateChanged()
Override this method in your derived class to receive a notification when the sample rate of your UGen has changed. |
void |
setAudioChannelCount(int channelCount)
Let this UGen know how many channels of audio you will be asking it for. |
T |
ugen()
|
protected void |
uGenerate(float[] channels)
Implement this method when you extend UGen. |
Methods inherited from class ddf.minim.ugens.UGen |
---|
getLastValues, patch, patch, patch, printInputs, sampleRate, setSampleRate, tick, unpatch, unpatch |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Bypass(T ugen)
ugen
- Method Detail |
---|
public T ugen()
protected void sampleRateChanged()
UGen
sampleRateChanged
in class UGen
protected void addInput(UGen input)
UGen
addInput
in class UGen
protected void removeInput(UGen input)
UGen
removeInput
in class UGen
public void setAudioChannelCount(int channelCount)
UGen
setAudioChannelCount
in class UGen
channelCount
- how many channels of audio you will be generating with this
UGenpublic void activate()
public void deactivate()
public boolean isActive()
protected 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
.
uGenerate
in class UGen
channels
- an array representing one sample frame.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |