|
|||||||||
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.Spatial
public class Spatial
A mixer for a speaker config in any number of dimensions (we haven't tested D>3 yet). Add sources (UGens) and control their locations using other UGens. Locations are changed on a per-channel basis, so that multichannel files can be located in the mixer independently. We follow the 'right-handed' ordering of the axes: http://en.wikipedia.org/wiki/Cartesian_coordinate_system#Orientation_and_handedness The default speaker numbering is as follows: first layout speakers 1-4 on the ground in clockwise order (2D and 3D) then layout speakers 5-8 so that they are above 1-4 respectively. Then according to the 'right-handed' ordering: the x-axis follows the line joining 1 and 4 the y-axis follows the line joining 1 and 2 the z-axis follows the line joining 1 and 5
Nested Class Summary |
---|
Nested classes/interfaces inherited from class net.beadsproject.beads.core.UGen |
---|
UGen.OutputInitializationRegime, UGen.OutputPauseRegime |
Field Summary |
---|
Fields inherited from class net.beadsproject.beads.core.UGen |
---|
bufferSize, bufIn, bufOut, context, ins, outputInitializationRegime, outputPauseRegime, outs |
Constructor Summary | |
---|---|
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. |
Method Summary | |
---|---|
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. |
Methods inherited from class net.beadsproject.beads.core.UGen |
---|
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 |
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 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 diameterMethod Detail |
---|
public 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 b
public void addInput(UGen source)
addInput(UGen)
by adding a new 'source' sound to the spatialisation.
addInput
in class UGen
source
- the UGen to connect to this UGen.public void addInput(int inputIndex, UGen source, int outputIndex)
addInput(UGen)
by adding a new 'source' sound to the spatialisation.
addInput
in class UGen
inputIndex
- the input of this UGen to connect to.source
- the UGen to connect to this UGen.outputIndex
- the output of the connecting UGen with which to make the
connection.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()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |