public class AuralAttributes extends NodeComponent
Attribute Gain
Attribute Gain Rolloff
Auralization
In Java3D's model for auralization there are several parameters that approximate sound reflection and reverberation for a particular listening space:
Reflection Coefficient
Reflection Delay
Reverberation Coefficient
Reverberation Delay
Reverberation Bounds
Reverberation Order
Decay Time
Decay Filter
Reverberation Diffusion
Reverberation Density
Distance Filter
If the distance from the listener to the sound source is less than the first distance in the array, the first filter is applied to the sound source. This creates a spherical region around the listener within which a sound is uniformly attenuated by the first filter in the array. If the distance from the listener to the sound source is greater than the last distance in the array, the last filter is applied to the sound source.
Distance elements in these array of pairs is a monotonically-increasing set of floating point numbers measured from the location of the sound source. FrequencyCutoff elements in this list of pairs can be any positive float. While for most applications this list of values will usually be monotonically-decreasing, they do not have to be.
The getDistanceFilterLength method returns the length of the distance filter arrays. Arrays passed into getDistanceFilter methods should all be at least this size.
Doppler Effect Model
The FrequencyScaleFactor can be used to increase or reduce the change of frequency associated with normal Doppler calculation, or to shift the pitch of the sound directly if Doppler effect is disabled. Values must be > zero for sounds to be heard. If the value is zero, sounds affected by this AuralAttribute object are paused.
To simulate Doppler effect, the relative velocity (change in distance in the local coordinate system between the sound source and the listener over time, in meters per second) is calculated. This calculated velocity is multipled by the given VelocityScaleFactor. Values must be >= zero. If is a scale factor value of zero is given, Doppler effect is not calculated or applied to sound.
Modifier and Type | Field and Description |
---|---|
static int |
ALLOW_ATTRIBUTE_GAIN_READ
For AuralAttributes component objects, specifies that this object
allows the reading of it's attribute gain scale factor information.
|
static int |
ALLOW_ATTRIBUTE_GAIN_WRITE
For AuralAttributes component objects, specifies that this object
allows the writing of it's attribute gain scale factor information.
|
static int |
ALLOW_DECAY_FILTER_READ
For AuralAttributes component objects, specifies that this object
allows the reading of it's reverb decay filter information.
|
static int |
ALLOW_DECAY_FILTER_WRITE
For AuralAttributes component objects, specifies that this object
allows the writing of it's reverb decay filter information.
|
static int |
ALLOW_DECAY_TIME_READ
For AuralAttributes component objects, specifies that this object
allows the reading of it's reverb decay time information.
|
static int |
ALLOW_DECAY_TIME_WRITE
For AuralAttributes component objects, specifies that this object
allows the writing of it's reverb decay time information.
|
static int |
ALLOW_DENSITY_READ
For AuralAttributes component objects, specifies that this object
allows the reading of it's reverb density information.
|
static int |
ALLOW_DENSITY_WRITE
For AuralAttributes component objects, specifies that this object
allows the writing of it's reverb density information.
|
static int |
ALLOW_DIFFUSION_READ
For AuralAttributes component objects, specifies that this object
allows the reading of it's reverb diffusion information.
|
static int |
ALLOW_DIFFUSION_WRITE
For AuralAttributes component objects, specifies that this object
allows the writing of it's reverb diffusion information.
|
static int |
ALLOW_DISTANCE_FILTER_READ
For AuralAttributes component objects, specifies that this object
allows the reading of it's frequency cutoff information.
|
static int |
ALLOW_DISTANCE_FILTER_WRITE
For AuralAttributes component objects, specifies that this object
allows the writing of it's frequency cutoff information.
|
static int |
ALLOW_FREQUENCY_SCALE_FACTOR_READ
For AuralAttributes component objects, specifies that this object
allows the reading of it's frequency scale factor information.
|
static int |
ALLOW_FREQUENCY_SCALE_FACTOR_WRITE
For AuralAttributes component objects, specifies that this object
allows the writing of it's frequency scale factor information.
|
static int |
ALLOW_REFLECTION_COEFFICIENT_READ
For AuralAttributes component objects, specifies that this object
allows the reading of it's reflection coefficient.
|
static int |
ALLOW_REFLECTION_COEFFICIENT_WRITE
For AuralAttributes component objects, specifies that this object
allows the writing of it's reflection coefficient.
|
static int |
ALLOW_REFLECTION_DELAY_READ
For AuralAttributes component objects, specifies that this object
allows the reading of it's reflection delay information.
|
static int |
ALLOW_REFLECTION_DELAY_WRITE
For AuralAttributes component objects, specifies that this object
allows the writing of it's reflection delay information.
|
static int |
ALLOW_REVERB_COEFFICIENT_READ
For AuralAttributes component objects, specifies that this object
allows the reading of it's reverb coefficient.
|
static int |
ALLOW_REVERB_COEFFICIENT_WRITE
For AuralAttributes component objects, specifies that this object
allows the writing of it's reverb coefficient.
|
static int |
ALLOW_REVERB_DELAY_READ
For AuralAttributes component objects, specifies that this object
allows the reading of it's reverberation delay information.
|
static int |
ALLOW_REVERB_DELAY_WRITE
For AuralAttributes component objects, specifies that this object
allows the writing of it's reverberation delay information.
|
static int |
ALLOW_REVERB_ORDER_READ
For AuralAttributes component objects, specifies that this object
allows the reading of it's reverb order (feedback loop) information.
|
static int |
ALLOW_REVERB_ORDER_WRITE
For AuralAttributes component objects, specifies that this object
allows the writing of it's reverb order (feedback loop) information.
|
static int |
ALLOW_ROLLOFF_READ
For AuralAttributes component objects, specifies that this object
allows the reading of it's atmospheric rolloff.
|
static int |
ALLOW_ROLLOFF_WRITE
For AuralAttributes component objects, specifies that this object
allows the writing of it's atmospheric rolloff.
|
static int |
ALLOW_VELOCITY_SCALE_FACTOR_READ
For AuralAttributes component objects, specifies that this object
allows the reading of it's velocity scale factor information.
|
static int |
ALLOW_VELOCITY_SCALE_FACTOR_WRITE
For AuralAttributes component objects, specifies that this object
allows the writing of it's velocity scale factor information.
|
Constructor and Description |
---|
AuralAttributes()
Constructs and initializes a new AuralAttributes object using default
parameters.
|
AuralAttributes(float gain,
float rolloff,
float reflectionCoefficient,
float reflectionDelay,
float reverbCoefficient,
float reverbDelay,
float decayTime,
float decayFilter,
float diffusion,
float density,
float[] distance,
float[] frequencyCutoff,
float frequencyScaleFactor,
float velocityScaleFactor)
Constructs and initializes a new AuralAttributes object using specified
parameters with separate float arrays for components of distanceFilter
and full reverb parameters.
|
AuralAttributes(float gain,
float rolloff,
float reflectionCoefficient,
float reverbDelay,
int reverbOrder,
float[] distance,
float[] frequencyCutoff,
float frequencyScaleFactor,
float velocityScaleFactor)
Constructs and initializes a new AuralAttributes object using specified
parameters with separate float arrays for components of distanceFilter.
|
AuralAttributes(float gain,
float rolloff,
float reflectionCoefficient,
float reverbDelay,
int reverbOrder,
Point2f[] distanceFilter,
float frequencyScaleFactor,
float velocityScaleFactor)
Constructs and initializes a new AuralAttributes object using specified
parameters including an array of Point2f for the distanceFilter.
|
Modifier and Type | Method and Description |
---|---|
NodeComponent |
cloneNodeComponent()
Deprecated.
As of Java 3D version 1.2, replaced by
cloneNodeComponent(boolean forceDuplicate) |
float |
getAttributeGain()
Retrieve Attribute Gain (amplitude).
|
float |
getDecayFilter()
Retrieve Decay Filter.
|
float |
getDecayTime()
Retrieve Decay Time.
|
float |
getDensity()
Retrieve Density.
|
float |
getDiffusion()
Retrieve Diffusion.
|
void |
getDistanceFilter(float[] distance,
float[] frequencyCutoff)
Retrieve Distance Filter in separate distance and frequency cutoff arrays.
|
void |
getDistanceFilter(Point2f[] attenuation)
Retrieve Distance Filter as a single array containing distances
and frequency cutoff.
|
int |
getDistanceFilterLength()
Retrieve Distance Filter array length.
|
float |
getFrequencyScaleFactor()
Retrieve Frequency Scale Factor.
|
float |
getReflectionCoefficient()
Retrieve Reflective Coefficient.
|
float |
getReflectionDelay()
Retrieve Reflection Delay Time.
|
Bounds |
getReverbBounds()
Retrieve Reverberation Delay Bounds volume.
|
float |
getReverbCoefficient()
Retrieve Reverb Coefficient.
|
float |
getReverbDelay()
Retrieve Reverberation Delay Time.
|
int |
getReverbOrder()
Retrieve Reverberation Order
|
float |
getRolloff()
Retrieve Attribute Gain Rolloff.
|
float |
getVelocityScaleFactor()
Retrieve Velocity Scale Factor used to calculate Doppler Effect.
|
void |
setAttributeGain(float gain)
Set Attribute Gain (amplitude) scale factor.
|
void |
setDecayFilter(float frequencyCutoff)
Set Decay Filter
In this form, reverberation decay filtering is defined as a low-pass
filter, starting at the given reference frequency.
|
void |
setDecayTime(float decayTime)
Set Decay Time
Length of time from the start of late reflections reverberation volume
takes to decay to effective zero (-60 dB of initial signal amplitude).
|
void |
setDensity(float ratio)
Set Density.
|
void |
setDiffusion(float ratio)
Set Diffusion.
|
void |
setDistanceFilter(float[] distance,
float[] frequencyCutoff)
Set Distance Filter using separate arrays for distances and frequency
cutoff.
|
void |
setDistanceFilter(Point2f[] attenuation)
Set Distance Filter using a single array containing distances and
frequency cutoff as pairs of values as a single array of Point2f.
|
void |
setFrequencyScaleFactor(float frequencyScaleFactor)
This parameter specifies a scale factor applied to the frequency
of sound during rendering playback.
|
void |
setReflectionCoefficient(float coefficient)
Set Reflective Coefficient.
|
void |
setReflectionDelay(float reflectionDelay)
Set early Refection Delay Time.
|
void |
setReverbBounds(Bounds reverbVolume)
Set Reverberation Bounds volume.
|
void |
setReverbCoefficient(float coefficient)
Set Reverb Coefficient.
|
void |
setReverbDelay(Bounds reverbVolume)
Deprecated.
As of Java 3D version 1.2, replaced by
setReverbBounds(Bounds) |
void |
setReverbDelay(float reverbDelay)
Set Reverberation Delay Time.
|
void |
setReverbOrder(int reverbOrder)
Set Reverberation Order
This parameter limits the number of times reflections are added
to the reverberation being rendered.
|
void |
setRolloff(float rolloff)
Set Attribute Gain Rolloff.
|
void |
setVelocityScaleFactor(float velocityScaleFactor)
Set Velocity scale factor applied during Doppler Effect calculation.
|
cloneNodeComponent, duplicateNodeComponent, duplicateNodeComponent, getDuplicateOnCloneTree, setDuplicateOnCloneTree
clearCapability, clearCapabilityIsFrequent, duplicateSceneGraphObject, getCapability, getCapabilityIsFrequent, getName, getUserData, isCompiled, isLive, setCapability, setCapabilityIsFrequent, setName, setUserData, toString, updateNodeReferences
public static final int ALLOW_ATTRIBUTE_GAIN_READ
public static final int ALLOW_ATTRIBUTE_GAIN_WRITE
public static final int ALLOW_ROLLOFF_READ
public static final int ALLOW_ROLLOFF_WRITE
public static final int ALLOW_REFLECTION_COEFFICIENT_READ
public static final int ALLOW_REFLECTION_COEFFICIENT_WRITE
public static final int ALLOW_REFLECTION_DELAY_READ
public static final int ALLOW_REFLECTION_DELAY_WRITE
public static final int ALLOW_REVERB_COEFFICIENT_READ
public static final int ALLOW_REVERB_COEFFICIENT_WRITE
public static final int ALLOW_REVERB_DELAY_READ
public static final int ALLOW_REVERB_DELAY_WRITE
public static final int ALLOW_REVERB_ORDER_READ
public static final int ALLOW_REVERB_ORDER_WRITE
public static final int ALLOW_DECAY_TIME_READ
public static final int ALLOW_DECAY_TIME_WRITE
public static final int ALLOW_DECAY_FILTER_READ
public static final int ALLOW_DECAY_FILTER_WRITE
public static final int ALLOW_DIFFUSION_READ
public static final int ALLOW_DIFFUSION_WRITE
public static final int ALLOW_DENSITY_READ
public static final int ALLOW_DENSITY_WRITE
public static final int ALLOW_DISTANCE_FILTER_READ
public static final int ALLOW_DISTANCE_FILTER_WRITE
public static final int ALLOW_FREQUENCY_SCALE_FACTOR_READ
public static final int ALLOW_FREQUENCY_SCALE_FACTOR_WRITE
public static final int ALLOW_VELOCITY_SCALE_FACTOR_READ
public static final int ALLOW_VELOCITY_SCALE_FACTOR_WRITE
public AuralAttributes()
public AuralAttributes(float gain, float rolloff, float reflectionCoefficient, float reverbDelay, int reverbOrder, Point2f[] distanceFilter, float frequencyScaleFactor, float velocityScaleFactor)
gain
- amplitude scale factorrolloff
- atmospheric (changing speed of sound) scale factorreflectionCoefficient
- reflective/absorptive factor applied to reflectionsreverbDelay
- delay time before start of reverberationreverbOrder
- limit to number of reflections added to reverb signaldistanceFilter
- frequency cutofffrequencyScaleFactor
- applied to change of pitchvelocityScaleFactor
- applied to velocity of sound in relation to listenerpublic AuralAttributes(float gain, float rolloff, float reflectionCoefficient, float reverbDelay, int reverbOrder, float[] distance, float[] frequencyCutoff, float frequencyScaleFactor, float velocityScaleFactor)
gain
- amplitude scale factorrolloff
- atmospheric (changing speed of sound) scale factorreflectionCoefficient
- reflection/absorption factor applied to reflectionsreverbDelay
- delay time before start of reverberationreverbOrder
- limit to number of reflections added to reverb signaldistance
- filter frequency cutoff distancesfrequencyCutoff
- distance filter frequency cutofffrequencyScaleFactor
- applied to velocity/wave-lengthvelocityScaleFactor
- applied to velocity of sound in relation to listenerpublic AuralAttributes(float gain, float rolloff, float reflectionCoefficient, float reflectionDelay, float reverbCoefficient, float reverbDelay, float decayTime, float decayFilter, float diffusion, float density, float[] distance, float[] frequencyCutoff, float frequencyScaleFactor, float velocityScaleFactor)
gain
- amplitude scale factorrolloff
- atmospheric (changing speed of sound) scale factorreflectionCoefficient
- factor applied to early reflectionsreflectionDelay
- delay time before start of early reflectionsreverbCoefficient
- factor applied to late reflectionsreverbDelay
- delay time before start of late reverberationdecayTime
- time (in milliseconds) reverb takes to decay to -60bDdecayFilter
- reverb decay filter frequency cutoffdiffusion
- percentage of echo dispersement between min and maxdensity
- percentage of modal density between min and maxdistance
- filter frequency cutoff distancesfrequencyCutoff
- distance filter frequency cutofffrequencyScaleFactor
- applied to velocity/wave-lengthvelocityScaleFactor
- applied to velocity of sound in relation to listenerpublic void setAttributeGain(float gain)
gain
- scale factor applied to amplitude of direct and reflected soundCapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic float getAttributeGain()
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic void setRolloff(float rolloff)
rolloff
- atmospheric gain scale factor (changing speed of sound)CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic float getRolloff()
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic void setReflectionCoefficient(float coefficient)
coefficient
- reflection/absorption factor applied to reflectionsCapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic float getReflectionCoefficient()
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic void setReflectionDelay(float reflectionDelay)
reflectionDelay
- delay time before start of reverberationCapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic float getReflectionDelay()
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic void setReverbCoefficient(float coefficient)
coefficient
- reflective/absorptive factor applied to late reflectionsCapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic float getReverbCoefficient()
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic void setReverbDelay(float reverbDelay)
reverbDelay
- delay time before start of reverberationCapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic float getReverbDelay()
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic void setDecayTime(float decayTime)
decayTime
- of late reflections (reverb) in millisecondsCapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic float getDecayTime()
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic void setDecayFilter(float frequencyCutoff)
frequencyCutoff
- of reverberation decay low-pass filterCapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic float getDecayFilter()
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic void setDiffusion(float ratio)
ratio
- reverberation echo dispersement factorCapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic float getDiffusion()
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic void setDensity(float ratio)
ratio
- reverberation modal density factorCapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic float getDensity()
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic void setReverbDelay(Bounds reverbVolume)
setReverbBounds(Bounds)
public void setReverbBounds(Bounds reverbVolume)
reverbVolume
- the bounding regionCapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic Bounds getReverbBounds()
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic void setReverbOrder(int reverbOrder)
reverbOrder
- limit to the number of times reflections added to reverb signalCapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic int getReverbOrder()
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic void setDistanceFilter(Point2f[] attenuation)
attenuation
- array of pairs of distance and frequency cutoffCapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic void setDistanceFilter(float[] distance, float[] frequencyCutoff)
distance
- array of float distance with corresponding cutoff valuesfrequencyCutoff
- array of frequency cutoff values in HertzCapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic int getDistanceFilterLength()
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic void getDistanceFilter(Point2f[] attenuation)
attenuation
- array of pairs of distance and frequency cutoff valuesCapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic void getDistanceFilter(float[] distance, float[] frequencyCutoff)
distance
- arrayfrequencyCutoff
- cutoff arrayCapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic void setFrequencyScaleFactor(float frequencyScaleFactor)
frequencyScaleFactor
- factor applied to change of frequencyCapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic float getFrequencyScaleFactor()
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic void setVelocityScaleFactor(float velocityScaleFactor)
velocityScaleFactor
- applied to velocity of sound in relation
to listenerCapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic float getVelocityScaleFactor()
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic NodeComponent cloneNodeComponent()
cloneNodeComponent(boolean forceDuplicate)
cloneNodeComponent
in class NodeComponent
Copyright © 2016–2022 SciJava. All rights reserved.