Skip to content

Latest commit

 

History

History
211 lines (121 loc) · 7.75 KB

class_audioeffectdistortion.rst

File metadata and controls

211 lines (121 loc) · 7.75 KB
github_url:hide

AudioEffectDistortion

Inherits: :ref:`AudioEffect<class_AudioEffect>` < :ref:`Resource<class_Resource>` < :ref:`RefCounted<class_RefCounted>` < :ref:`Object<class_Object>`

Adds a distortion audio effect to an Audio bus.

Modifies the sound to make it distorted.

.. rst-class:: classref-introduction-group

Description

Different types are available: clip, tan, lo-fi (bit crushing), overdrive, or waveshape.

By distorting the waveform the frequency content changes, which will often make the sound "crunchy" or "abrasive". For games, it can simulate sound coming from some saturated device or speaker very efficiently.

.. rst-class:: classref-introduction-group

Tutorials

.. rst-class:: classref-reftable-group

Properties

:ref:`float<class_float>` :ref:`drive<class_AudioEffectDistortion_property_drive>` 0.0
:ref:`float<class_float>` :ref:`keep_hf_hz<class_AudioEffectDistortion_property_keep_hf_hz>` 16000.0
:ref:`Mode<enum_AudioEffectDistortion_Mode>` :ref:`mode<class_AudioEffectDistortion_property_mode>` 0
:ref:`float<class_float>` :ref:`post_gain<class_AudioEffectDistortion_property_post_gain>` 0.0
:ref:`float<class_float>` :ref:`pre_gain<class_AudioEffectDistortion_property_pre_gain>` 0.0
.. rst-class:: classref-section-separator


.. rst-class:: classref-descriptions-group

Enumerations

.. rst-class:: classref-enumeration

enum Mode: :ref:`🔗<enum_AudioEffectDistortion_Mode>`

.. rst-class:: classref-enumeration-constant

:ref:`Mode<enum_AudioEffectDistortion_Mode>` MODE_CLIP = 0

Digital distortion effect which cuts off peaks at the top and bottom of the waveform.

.. rst-class:: classref-enumeration-constant

:ref:`Mode<enum_AudioEffectDistortion_Mode>` MODE_ATAN = 1

There is currently no description for this enum. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
.. rst-class:: classref-enumeration-constant

:ref:`Mode<enum_AudioEffectDistortion_Mode>` MODE_LOFI = 2

Low-resolution digital distortion effect (bit depth reduction). You can use it to emulate the sound of early digital audio devices.

.. rst-class:: classref-enumeration-constant

:ref:`Mode<enum_AudioEffectDistortion_Mode>` MODE_OVERDRIVE = 3

Emulates the warm distortion produced by a field effect transistor, which is commonly used in solid-state musical instrument amplifiers. The :ref:`drive<class_AudioEffectDistortion_property_drive>` property has no effect in this mode.

.. rst-class:: classref-enumeration-constant

:ref:`Mode<enum_AudioEffectDistortion_Mode>` MODE_WAVESHAPE = 4

Waveshaper distortions are used mainly by electronic musicians to achieve an extra-abrasive sound.

.. rst-class:: classref-section-separator


.. rst-class:: classref-descriptions-group

Property Descriptions

.. rst-class:: classref-property

:ref:`float<class_float>` drive = 0.0 :ref:`🔗<class_AudioEffectDistortion_property_drive>`

.. rst-class:: classref-property-setget

Distortion power. Value can range from 0 to 1.

.. rst-class:: classref-item-separator


.. rst-class:: classref-property

:ref:`float<class_float>` keep_hf_hz = 16000.0 :ref:`🔗<class_AudioEffectDistortion_property_keep_hf_hz>`

.. rst-class:: classref-property-setget

High-pass filter, in Hz. Frequencies higher than this value will not be affected by the distortion. Value can range from 1 to 20000.

.. rst-class:: classref-item-separator


.. rst-class:: classref-property

:ref:`Mode<enum_AudioEffectDistortion_Mode>` mode = 0 :ref:`🔗<class_AudioEffectDistortion_property_mode>`

.. rst-class:: classref-property-setget

Distortion type.

.. rst-class:: classref-item-separator


.. rst-class:: classref-property

:ref:`float<class_float>` post_gain = 0.0 :ref:`🔗<class_AudioEffectDistortion_property_post_gain>`

.. rst-class:: classref-property-setget

Increases or decreases the volume after the effect, in decibels. Value can range from -80 to 24.

.. rst-class:: classref-item-separator


.. rst-class:: classref-property

:ref:`float<class_float>` pre_gain = 0.0 :ref:`🔗<class_AudioEffectDistortion_property_pre_gain>`

.. rst-class:: classref-property-setget

Increases or decreases the volume before the effect, in decibels. Value can range from -60 to 60.