|
|||||||||
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.SamplePlayer net.beadsproject.beads.ugens.GranularSamplePlayer
public class GranularSamplePlayer
GranularSamplePlayer plays back a Sample
using granular synthesis. GranularSamplePlayer inherits its main behaviour from SamplePlayer
but replaces the direct Sample
lookup with a granular process.
UGen
s can be used to control playback rate, pitch, loop points, grain size, grain interval, grain randomness and position (this last case assumes that the playback rate is zero).
Sample
Nested Class Summary |
---|
Nested classes/interfaces inherited from class net.beadsproject.beads.ugens.SamplePlayer |
---|
SamplePlayer.InterpolationType, SamplePlayer.LoopType |
Field Summary | |
---|---|
protected float |
pitch
The pitch, bound to the pitch envelope. |
Fields inherited from class net.beadsproject.beads.ugens.SamplePlayer |
---|
buffer, forwards, interpolationType, killOnEnd, lastChangedPosition, loopCrossFade, loopEnd, loopEndEnvelope, loopStart, loopStartEnvelope, loopType, position, positionEnvelope, positionIncrement, rate, rateEnvelope, sampleRate, startLoop |
Fields inherited from class net.beadsproject.beads.core.UGen |
---|
bufferSize, bufIn, bufOut, context, ins, outs |
Constructor Summary | |
---|---|
GranularSamplePlayer(AudioContext context,
Sample buffer)
Instantiates a new GranularSamplePlayer. |
Method Summary | |
---|---|
void |
calculateBuffer()
Called by the signal chain to update this UGen's ouput data. |
float |
getAverageNumberOfGrains()
Calculates the average number of Grains given the current grain size and grain interval. |
UGen |
getGrainIntervalEnvelope()
Gets the grain interval envelope. |
UGen |
getGrainSizeEnvelope()
Gets the grain size envelope. |
UGen |
getPitchEnvelope()
Gets the pitch envelope. |
UGen |
getRandomnessEnvelope()
Gets the randomness envelope. |
void |
setGrainIntervalEnvelope(UGen grainIntervalEnvelope)
Sets the grain interval envelope. |
void |
setGrainSizeEnvelope(UGen grainSizeEnvelope)
Sets the grain size envelope. |
void |
setPitchEnvelope(UGen pitchEnvelope)
Sets the pitch envelope. |
void |
setRandomnessEnvelope(UGen randomnessEnvelope)
Sets the randomness envelope. |
void |
start()
Shortcut for pause(false). |
Methods inherited from class net.beadsproject.beads.ugens.SamplePlayer |
---|
calculateNextPosition, getBuffer, getInterpolationType, getKillOnEnd, getLoopCrossFade, getLoopEndEnvelope, getLoopStartEnvelope, getLoopType, getPosition, getPositionEnvelope, getRateEnvelope, getSampleRate, inLoop, reset, reTrigger, setBuffer, setInterpolationType, setKillOnEnd, setLoopCrossFade, setLoopEndEnvelope, setLoopPointsFraction, setLoopStartEnvelope, setLoopType, setPosition, setPositionEnvelope, setRateEnvelope, setToEnd, setToLoopStart, start |
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, setValue, update, zeroIns, zeroOuts |
Methods inherited from class net.beadsproject.beads.core.Bead |
---|
getKillListener, getName, isDeleted, isPaused, kill, message, messageReceived, setKillListener, setName, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected float pitch
Constructor Detail |
---|
public GranularSamplePlayer(AudioContext context, Sample buffer)
context
- the AudioContext.buffer
- the Sample played by the GranularSamplePlayer.Method Detail |
---|
public UGen getPitchEnvelope()
public void setPitchEnvelope(UGen pitchEnvelope)
pitchEnvelope
- the new pitch envelope.public UGen getGrainIntervalEnvelope()
public void setGrainIntervalEnvelope(UGen grainIntervalEnvelope)
grainIntervalEnvelope
- the new grain interval envelope.public UGen getGrainSizeEnvelope()
public void setGrainSizeEnvelope(UGen grainSizeEnvelope)
grainSizeEnvelope
- the new grain size envelope.public UGen getRandomnessEnvelope()
public void setRandomnessEnvelope(UGen randomnessEnvelope)
randomnessEnvelope
- the new randomness envelope.public void start()
Bead
start
in class Bead
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 SamplePlayer
public float getAverageNumberOfGrains()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |