|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.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.EnvelopeType, SamplePlayer.InterpolationType, SamplePlayer.LoopType |
Nested classes/interfaces inherited from class net.beadsproject.beads.core.UGen |
---|
UGen.OutputInitializationRegime, UGen.OutputPauseRegime |
Field Summary | |
---|---|
protected float |
pitch
The pitch, bound to the pitch envelope. |
Fields inherited from class net.beadsproject.beads.ugens.SamplePlayer |
---|
ADAPTIVE_INTERP_HIGH_THRESH, ADAPTIVE_INTERP_LOW_THRESH, envelopeType, forwards, frame, interpolationType, killOnEnd, loopCrossFade, loopEnd, loopEndEnvelope, loopStart, loopStartEnvelope, loopType, position, positionEnvelope, positionIncrement, rate, rateEnvelope, sample, startLoop |
Fields inherited from class net.beadsproject.beads.core.UGen |
---|
bufferSize, bufIn, bufOut, context, ins, outputInitializationRegime, outputPauseRegime, outs |
Constructor Summary | |
---|---|
GranularSamplePlayer(AudioContext context,
int outs)
Instantiates a new GranularSamplePlayer. |
|
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. |
UGen |
getRandomPanEnvelope()
|
Buffer |
getWindow()
|
void |
setBuffer(Sample buffer)
|
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 |
setRandomPanEnvelope(UGen randomPanEnvelope)
|
void |
setWindow(Buffer window)
|
void |
start()
Shortcut for pause(false). |
Methods inherited from class net.beadsproject.beads.ugens.SamplePlayer |
---|
calculateNextPosition, getBuffer, getEnvelopeType, getInterpolationType, getKillOnEnd, getLoopCrossFade, getLoopEndEnvelope, getLoopStartEnvelope, getLoopType, getPosition, getPositionEnvelope, getRateEnvelope, getSample, getSampleRate, inLoop, reset, reTrigger, setEnvelopeType, setInterpolationType, setKillOnEnd, setLoopCrossFade, setLoopEndEnvelope, setLoopPointsFraction, setLoopStartEnvelope, setLoopType, setPosition, setPositionEnvelope, setRateEnvelope, setSample, setToEnd, setToLoopStart, start |
Methods inherited from class net.beadsproject.beads.core.UGen |
---|
addDependent, addInput, addInput, clearInputConnections, containsInput, getConnectedInputs, getContext, getEnvelopes, getIns, getNumberOfConnectedUGens, getOuts, getTimeTakenLastUpdate, getValue, getValue, initializeOuts, isTimerMode, isUpdated, main, noInputs, pause, printInBuffers, printInputList, printOutBuffers, removeAllConnections, removeDependent, setInputProxy, setOutputProxy, setOutsToPause, setProxy, setTimerMode, 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, int outs)
context
- the AudioContext.outs
- the number of outputs.public GranularSamplePlayer(AudioContext context, Sample buffer)
context
- the AudioContext.buffer
- the Sample played by the GranularSamplePlayer.Method Detail |
---|
public UGen getPitchEnvelope()
getPitchEnvelope
in class SamplePlayer
public void setPitchEnvelope(UGen pitchEnvelope)
setPitchEnvelope
in class SamplePlayer
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 Buffer getWindow()
public void setWindow(Buffer window)
public UGen getRandomnessEnvelope()
public void setRandomnessEnvelope(UGen randomnessEnvelope)
randomnessEnvelope
- the new randomness envelope.public UGen getRandomPanEnvelope()
public void setRandomPanEnvelope(UGen randomPanEnvelope)
public void setBuffer(Sample buffer)
setBuffer
in class SamplePlayer
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 |