Modes

class in Clatter.Core

Audio modes data for an object. This is usually meant to be automatically created and adjusted within an AudioEvent.

Fields

Name Type Description Default Value
synthSound double[] The cached synth sound array. new double[Globals.DEFAULT_SAMPLES_LENGTH]
synthSoundLength int The actual length of the synth sound (usually less than synthSound.Length).

Static Methods

Add

public static int Add(double[] a, int aLength, double[] b, int bLength, ref double[] added)

Add together arrays of different lengths by zero-padding the shorter.

Name Type Description
a double[] The first array.
aLength int The length of the first array (can be less than the true length).
b double[] The second array.
bLength int The length of the second array (can be less than the true length).
added ref double[] The output array.

Methods

Modes

public Modes(ImpactMaterialData material, Random rng)

Name Type Description
material ImpactMaterialData The impact material data.
rng Random The random number generator.

Sum

public void Sum(double resonance)

Create a mode time-series from mode properties and sum them together.

Name Type Description
resonance double The object's audio resonance value. This affects the decay times of audio generated by this object.

AdjustPowers

public void AdjustPowers(Random rng)

Adjust the powers.

Name Type Description
rng Random The random number generator.

AddAmpToDecayTimes

public void AddAmpToDecayTimes(double amp)

Add an amp value to the decay times array.

Name Type Description
amp double The amp value.