AudioEffect

Audio effects are used to modify the final output of the audio mixer. They come in different flavors such as reverb, echo, chorus etc... Once placed on an effect slot they affect the way the mixer is modulating the final results. Depending on their slot order audio effect can prioritized; in addition each effect can have their own independent gain that will dictate how much they affect the output. Audio effects are a great way to add an extra level of realism to your world as they are simulating real environmental audio phenomenon.

By default the Sound system allow you to place up to four concurrent effect that will modify the mixer final result. The audio effects placed on theses slot can also be tuned dynamically at runtime. Learn more about the audio effect API by reading the help sections below.

See Also

Static Variables


Name Description
asset The Asset structure the current AudioEffect is associated to.
slot_index The active slot index the AudioEffect is attached to.
data Data structure to access the properties available for the active AudioEffect EffectType.

Functions


Name Description
SetType Changes the type of the current AudioEffect.
SetReverbPreset Use a ReverbPreset to setup the properties of a kEAXReverb or kReverb AudioEffect.

EffectType


The base types used when creating a new AudioEffect.

  • kEAXReverb: EAX Reverb parameter set is a superset of the standard environmental reverb effect.
  • kReverb: Standard environmental reverb effect.
  • kAutowah: Emulates the sound of a wah-wah pedal used with an electric guitar, or a mute on a brass instrument.
  • kChorus: Essentially replays the input audio accompanied by another slightly delayed version of the signal, creating a doubling effect.
  • kCompressor: Performs the same task as a studio compressor; evening out the audio dynamic range of an input sound.
  • kDistortion: Simulates turning up the gain stage on a guitar amplifier or adding a distortion pedal to an instrument's output.
  • kEcho: Generates discrete, delayed instances of the input signal.
  • kEqualizer: Provies tonal control over four different adjustable frequency ranges.
  • kFlanger: Creates a tearing or whooshing sound (like a jet flying overhead).
  • kModulator: Multiplies an input signal by a carrier signal in the time domain, resulting in tremolo or inharmonic effects.
  • kLowFrequency: Is a single-sideband modulator, which translates all the component frequencies of the input signal by an equal amount.
  • kDialogue: Consists of a pair of 4-band formant filters, used to impose vocal tract effects upon the input signal.

Example

Lua
-- You can access a specific type using the AudioEffect base like this: print( "The value of kReverb is " .. AudioEffect.EffectType.kReverb )

ReverbPreset


Available preset to use in conjunction with the reverb audio effect. Each preset have predefined reverb values that will be affected to the parameters of the AudioEffect when it is assigned.

kPresetkPadCellkRoomkBathroomkLivingRoomkStoneRoom
kAuditoriumkConcertHallkCavekArenakHangarkCarpetedHallway
kHallwaykStoneCorridorkAlleykForestkCitykMountains
kQuarrykPlainkParkingLotkSewerPipekUnderwaterkDrugged
kDizzykPsychotickCastleSmallRoomkCastleShortPassagekCastleMediumRoomkCastleLargeRoom
kCastleLongPassagekCastleHallkCastleCupboardkCastleCourtyardkCastleAlcovekFactorySmallRoom
kFactoryShortPassagekFactoryMediumRoomkFactoryLargeRoomkFactoryLongPassagekFactoryHallkFactorySmallRoom
kFactoryCupboardkFactoryCourtyardkFactoryAlcovekIceSmallRoomkIceShortPassagekIceMediumRoom
kIceLargeRoomkIceLongPassagekIceHallkIceCupboardkIceCourtyardkIceAlcove
kStationSmallRoomkStationShortPassagekStationMediumRoomkStationLargeRoomkStationLongPassagekStationHall
kStationCupboardkStationAlcovekWoodenSmallRoomkWoodenShortPassagekWoodenMediumRoomkWoodenLargeRoom
kWoodenLongPassagekWoodenHallkWoodenCupboardkWoodenCourtyardkWoodenAlcovekEmptyStadium
kSquashCourtkSmallSwimmingPoolkLargeSwimmingPoolkGymnasiumkFullStadiumkStadiumTannoy
kWorkshopkSchoolRoomkPracticeRoomkOuthousekCaravankDomeTomb
kPipeSmallkDomeStPaulkPipeLongThinkPipeLargekResonantkBackyard
kRollingPlainskDeepCanyonkCreekkValleykHeavenkHell
kMemorykCommentatorkPitGaragekIncarRacerkIncarSportskIncarLuxury
kFullGranStandkEmptyGranStandkUndergroundPassagekStreetkSubwaykMuseum
kLibrarykUnderpasskAbandonedkDustyRoomkChapelkSmallWaterRoom

Example

Lua
-- Reverb presets can be accessed as follow: print( "The value of kWoodenSmallRoom is " .. AudioEffect.ReverbPreset.kWoodenSmallRoom )

EAXReverbEffect

Extended environmental reverb effect.

Variables


Name Description
density Controls the coloration of the late reverb.
diffusion Controls the echo density in the reverberation decay.
gain Master volume control for the reflected sound (both early reflections and reverberation) that the reverb effect adds to all sound sources.
gain_hf Tweaks reflected sound by attenuating it at high frequencies.
gain_lf Tweaks reflected sound by attenuating it at low frequencies.
decay_time Sets the reverberation decay time.
decay_hf_ratio Adjusts the high frequencies spectral quality of the decay_time parameter.
decay_lf_ratio Adjusts the low frequencies spectral quality of the decay_time parameter.
reflections_gain Controls the overall amount of initial reflections relative to the gain property.
reflections_delay The amount of delay between the arrival time of the direct path from the source to the first reflection from the source.
reflections_pan A 3d vector that controls the spatial distribution of the cluster of early reflections.
late_reverb_gain Controls the overall amount of later reverberation relative to the Gain property.
late_reverb_delay Defines the begin time of the late reverberation relative to the time of the initial reflection (the first of the early reflections).
late_reverb_pan 3d vector that controls the spatial distribution of the late reverb.
echo_time Controls the rate at which the cyclic echo repeats itself along the reverberation decay.
echo_depth Control how long the echo effect will persist along the reverberation decay.
modulation_time Controls the speed of the vibrato (rate of periodic changes in pitch).
modulation_depth Controls the amount of pitch change.
hf_reference Frequency at which the high-frequency effects.
lf_reference Frequency at which the low-frequency effects.
room_rolloff_factor Property is one of two methods available (either 0.0 or 1.0) to attenuate the reflected sound according to source-listener distance.
air_absorb_gain_hf Controls the distance-dependent attenuation at high frequencies caused by the propagation medium.
decay_hf_limit When this flag is set, the high-frequency decay time automatically stays below a limit value that's derived from the setting of the property air_absorb_gain_hf.

ReverbEffect


Environmental reverb effect.

Variables


Name Description
density Controls the coloration of the late reverb. Lowering the value adds more coloration to the late reverb.
diffusion Controls the echo density in the reverberation decay.
gain Master volume control for the reflected sound (both early reflections and reverberation) that the reverb effect adds to all sound sources.
gain_hf Tweaks reflected sound by attenuating it at high frequencies.
decay_time Sets the reverberation decay time.
decay_hf_ratio Adjusts the high frequencies spectral quality of the decay_time parameter.
reflections_gain Controls the overall amount of initial reflections relative to the gain property.
reflections_delay The amount of delay between the arrival time of the direct path from the source to the first reflection from the source.
late_reverb_gain Controls the overall amount of later reverberation relative to the Gain property.
late_reverb_delay Defines the begin time of the late reverberation relative to the time of the initial reflection (the first of the early reflections).
room_rolloff_factor Property is one of two methods available (either 0.0 or 1.0) to attenuate the reflected sound according to source-listener distance.
air_absorb_gain_hf Controls the distance-dependent attenuation at high frequencies caused by the propagation medium.
decay_hf_limit When this flag is set, the high-frequency decay time automatically stays below a limit value that's derived from the setting of the property air_absorb_gain_hf.

AutowahEffect


Emulates the sound of a wah-wah pedal generally used with an electric guitar.

Variables


Name Description
attack_time Controls the time the filtering effect takes to sweep from minimum to maximum center frequency when it is triggered by input signal.
release_time Controls the time the filtering effect takes to sweep from maximum back to base center frequency, when the input signal ends.
peak_gain controls the input signal level at which the band-pass filter will be fully opened.
resonance Controls the resonant peak, sometimes known as emphasis, of the auto-wah band-pass filter.

ChorusEffect


Replays the input audio accompanied by another slightly delayed version of the signal.

Variables


Name Description
waveform Sets the waveform shape of the LFO that controls the delay time of the delayed signals.
phase Controls the phase difference between the left and right LFO.
rate Sets the modulation rate of the LFO that controls the delay time of the delayed signals.
depth Controls the amount by which the delay time is modulated by the LFO.
feedback Controls the amount of processed signal that is fed back to the input of the chorus effect.
delay Controls the average amount of time the sample is delayed before it is played back, and with feedback, the amount of time between iterations of the sample.

CompressorEffect


Evening out the audio dynamic range of an input sound.

Variables


Name Description
enable Toggle the compressor on/off; no adjustment is possible.

DistortionEffect


Simulates turning up the gain stage on a guitar amplifier.

Variables


Name Description
edge The shape of the distortion; the higher the dirtier the lower fuzzier.
gain Allows you to attenuate the distorted sound.
lowpass_cutoff Limit the amount of high frequency signal feeding into the distortion effect.
eq_center Controls the frequency at which the post-distortion attenuation.
eq_bandwidth Controls the bandwidth of the post-distortion attenuation.

EchoEffect


Generates discrete, delayed instances of the input signal.

Variables


Name Description
delay Controls the delay between the original sound and the first echo instance.
lr_delay Controls the delay between the first "tap" and the second "tap".
damping Controls the amount of high frequency damping applied to each echo.
feedback Controls the amount of feedback the output signal fed back into the input.
spread Controls how hard panned the individual echoes are.

EqualizerEffect


Provides tonal control over four different adjustable frequency ranges.

Variables


Name Description
low_cutoff Low frequency below which signal will be cut off.
low_gain Controls amount of cut / boost on the low frequency range.
mid1_gain Allows you to cut or boost signal on the mid1 range.
mid1_center Sets the center frequency for the mid1 range.
mid1_width Controls the width of the mid1 range.
mid2_gain Allows you to cut or boost signal on the mid2 range.
mid2_center Sets the center frequency for the mid2 range.
mid2_width Controls the width of the mid2 range.
high_cutoff High frequency above which signal will be cut off.
high_gain Allows you to cut or boost the signal at high frequencies.

FlangerEffect


Creates a "tearing" or "whooshing" sound.

Variables


Name Description
waveform Low frequency below which signal will be cut off.
phase Changes the phase difference between the left and right LFO.
rate Number of times per second the LFO controlling the amount of delay repeats.
depth Ratio by which the delay time is modulated by the LFO.
feedback Amount of the output signal level fed back into the effect's input.
delay The amount of time between iterations of the sample.

ModulatorEffect


Multiplies an input signal by a carrier signal in the time domain, resulting in tremolo or inharmonic effects.

Variables


Name Description
frequency Low frequency below which signal will be cut off.
high_pass_cutoff Controls the cutoff frequency at which the input signal is high-pass filtered before being ring modulated.
waveform Controls which waveform is used as the carrier signal.

DedicatedEffect


Used by either kLowFrequency and kDialogue to control the gain level of the effect.

Variables


Name Description
gain Control the master gain level of the effect.

EffectData


Container used to store the necessary data based on the EffectType the AudioEffect have been created with.

Static Variables


Name Description
type The current EffectType type the active AudioEffect.
eaxreverb Gain access to the EAXReverbEffect properties.
reverb Gain access to the ReverbEffect properties.
autowah Gain access to the AutowahEffect properties.
chorus Gain access to the ChorusEffect properties.
compressor Gain access to the CompressorEffect properties.
distortion Gain access to the DistortionEffect properties.
echo Gain access to the EchoEffect properties.
equalizer Gain access to the EqualizerEffect properties.
flanger Gain access to the EchoEffect properties.
modulator Gain access to the ModulatorEffect properties.
low_frequency Gain access to the DedicatedEffect properties.
dialogue Gain access to the DedicatedEffect properties.




NRG - API 2022.4.384543 - Fri Nov 4 2022
Copyright © 2022 nrgcore.com. All Rights Reserved. Terms of Service - Privacy Policy - EULA