|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.beadsproject.beads.core.Bead net.beadsproject.beads.core.UGen net.beadsproject.beads.ugens.Envelope
public class Envelope
An Envelope generates a sequence of timed transitions (segments) between values as an audio signal. New segments are added to a running Envelope using variations of the method #addSegment()
. With the method addSegment(float, float, float, Bead)
a Bead
can be provided which gets triggered when the segment has reached its destination.
At any point in time, the Envelope maintains a current value. New segments define transitions from that current value to a destination value over a given duration. Instead of a linear transition, a curved transition can be used. The curve is defined as the mapping of the range [0,1] from y=x to y=x^p with a given exponent p.
Nested Class Summary | |
---|---|
class |
Envelope.Segment
The nested class Segment. |
Field Summary |
---|
Fields inherited from class net.beadsproject.beads.core.UGen |
---|
bufferSize, bufIn, bufOut, context, ins, outs |
Constructor Summary | |
---|---|
Envelope(AudioContext context)
Instantiates a new Envelope with start value 0. |
|
Envelope(AudioContext context,
float value)
Instantiates a new Envelope with the specified start value. |
Method Summary | |
---|---|
void |
addSegment(float endValue,
float duration)
Adds a new Segment. |
void |
addSegment(float endValue,
float duration,
Bead trigger)
Adds a new Segment. |
void |
addSegment(float endValue,
float duration,
float curvature,
Bead trigger)
Adds a new Segment. |
void |
calculateBuffer()
Called by the signal chain to update this UGen's ouput data. |
void |
clear()
Clears the list of Segments. |
float |
getCurrentValue()
Gets the current value. |
boolean |
isLocked()
Checks whether the Envelope is locked. |
void |
lock(boolean lock)
Locks/unlocks the Envelope. |
void |
setValue(float value)
Clears the list of Segments and sets the current value of the Envelope immediately. |
Methods inherited from class net.beadsproject.beads.core.UGen |
---|
addDependent, addInput, addInput, clearInputConnections, getContext, getIns, getNumberOfConnectedUGens, getOuts, getValue, getValue, noInputs, pause, printInputList, printOutBuffers, removeAllConnections, removeDependent, update, zeroIns, zeroOuts |
Methods inherited from class net.beadsproject.beads.core.Bead |
---|
getKillListener, getName, isDeleted, isPaused, kill, message, messageReceived, setKillListener, setName, start, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Envelope(AudioContext context)
context
- the AudioContext.public Envelope(AudioContext context, float value)
context
- the AudioContext.value
- the start value.Method Detail |
---|
public void lock(boolean lock)
public boolean isLocked()
public void addSegment(float endValue, float duration, float curvature, Bead trigger)
endValue
- the destination value.duration
- the duration.curvature
- the exponent of the curve.trigger
- the trigger.public void addSegment(float endValue, float duration)
endValue
- the destination value.duration
- the duration.public void addSegment(float endValue, float duration, Bead trigger)
endValue
- the destination value.duration
- the duration.trigger
- the trigger.public void setValue(float value)
setValue
in class UGen
value
- the new value.com.olliebown.beads.core.UGen#setValue(float)
public void clear()
public float getCurrentValue()
public void calculateBuffer()
UGen
UGen.bufIn
and putting data
into UGen.bufOut
in some way. UGen.bufIn
and UGen.bufOut
are 2D arrays of floats of the form float[numChannels][bufferSize]. The length of the buffers is given by
UGen.bufferSize
, and the number of channels of the input and output buffers are given by UGen.ins
and UGen.outs
respectively.
calculateBuffer
in class UGen
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |