public class Spatial extends UGen
UGen.OutputInitializationRegime, UGen.OutputPauseRegime
bufferSize, bufIn, bufOut, context, ins, outputInitializationRegime, outputPauseRegime, outs
Constructor and Description |
---|
Spatial(AudioContext context,
int dimensions)
Instantiates a new Spatial with given AudioContext and dimensions.
|
Spatial(AudioContext context,
int dimensions,
float sphereDiameter)
Instantiates a new Spatial with given AudioContext and sphereDiameter.
|
Spatial(AudioContext context,
int dimensions,
float[][] locations)
Instantiates a new Spatial with given AudioContext, dimensions and locations.
|
Spatial(AudioContext context,
int dimensions,
float[][] locations,
float sphereDiameter)
Instantiates a new Spatial with the given AudioContext, dimensions, locations and sphereDiamater.
|
Modifier and Type | Method and Description |
---|---|
void |
addInput(int inputIndex,
UGen source,
int outputIndex)
This overrides
addInput(UGen) by adding a new 'source' sound to the spatialisation. |
void |
addInput(UGen source)
This overrides
addInput(UGen) by adding a new 'source' sound to the spatialisation. |
void |
addInput(UGen source,
UGen[][] controllers)
Adds a new source sound with the given UGen controllers for controlling its position.
|
void |
calculateBuffer()
Called by the signal chain to update this UGen's ouput data.
|
void |
clearInputConnections()
Clear all of this UGen's input connections.
|
static float |
distance(float[] a,
float[] b)
Gets the Euclidian distance between two positions.
|
int |
getNumberOfConnectedUGens(int index)
Gets the number of UGens connected at the specified input index of
this UGen.
|
int |
getNumberOfSources() |
void |
removeAllConnections(UGen sourceUGen)
Disconnects the specified UGen from this UGen at all inputs.
|
void |
removeSource(UGen source)
Removes the source.
|
void |
setCurve(float curve)
Sets the curve.
|
void |
setLocation(UGen source,
int channel,
float[] newPos)
Sets the location of a UGen at the give channel with glide.
|
void |
setSpeakerPositions(float[][] locations)
Sets the speaker positions.
|
void |
setSphereDiameter(float sd)
Sets the sphere diameter.
|
static float[][] |
speakerPositionsFromFile(java.lang.String file,
int dimensions)
Gets speaker positions from file.
|
addDependent, clearDependents, containsInput, crossfadeInput, getConnectedInputs, getContext, getEnvelopes, getIns, getNumberOfDependents, getOutBuffer, getOuts, getTimeTakenLastUpdate, getValue, getValue, getValueDouble, getValueDouble, initializeOuts, isTimerMode, isUpdated, noInputs, pause, printInBuffers, printInputList, printOutBuffers, removeConnection, removeDependent, setOutsToPause, setTimerMode, setValue, update, zeroIns, zeroOuts
getKillListener, getName, isDeleted, isPaused, kill, message, messageReceived, setKillListener, setName, start, toString
public Spatial(AudioContext context, int dimensions)
context
- the contextdimensions
- the dimensionspublic Spatial(AudioContext context, int dimensions, float sphereDiameter)
context
- the AudioContext.dimensions
- the number of dimensions, between 1 and 3.sphereDiameter
- the sphere diameter.public Spatial(AudioContext context, int dimensions, float[][] locations)
context
- the context.dimensions
- the dimensions.locations
- the locations.public Spatial(AudioContext context, int dimensions, float[][] locations, float sphereDiameter)
context
- the contextdimensions
- the dimensionslocations
- the locationssphereDiameter
- the sphere diameterpublic void setSphereDiameter(float sd)
sd
- the new sphere diameter.public static float[][] speakerPositionsFromFile(java.lang.String file, int dimensions)
file
- the file.dimensions
- the dimensions.public void setSpeakerPositions(float[][] locations)
locations
- the new speaker positions.public static float distance(float[] a, float[] b)
a
- the ab
- the bpublic void addInput(UGen source)
addInput(UGen)
by adding a new 'source' sound to the spatialisation.public void addInput(int inputIndex, UGen source, int outputIndex)
addInput(UGen)
by adding a new 'source' sound to the spatialisation.public void addInput(UGen source, UGen[][] controllers)
source
- the source.controllers
- the controllers.public void setLocation(UGen source, int channel, float[] newPos)
source
- the sourcechannel
- the channelnewPos
- the new pospublic void removeSource(UGen source)
source
- the sourcepublic void clearInputConnections()
UGen
clearInputConnections
in class UGen
public void removeAllConnections(UGen sourceUGen)
UGen
removeAllConnections
in class UGen
sourceUGen
- the UGen to disconnect.public void setCurve(float curve)
curve
- the new curvepublic 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
public int getNumberOfConnectedUGens(int index)
UGen
getNumberOfConnectedUGens
in class UGen
index
- index of input to inspect.public int getNumberOfSources()