class_audioeffectdistortion.rst 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/4.0/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/4.0/doc/classes/AudioEffectDistortion.xml.
  6. .. _class_AudioEffectDistortion:
  7. AudioEffectDistortion
  8. =====================
  9. **Inherits:** :ref:`AudioEffect<class_AudioEffect>` **<** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  10. Adds a distortion audio effect to an Audio bus.
  11. Modifies the sound to make it distorted.
  12. .. rst-class:: classref-introduction-group
  13. Description
  14. -----------
  15. Different types are available: clip, tan, lo-fi (bit crushing), overdrive, or waveshape.
  16. 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.
  17. .. rst-class:: classref-introduction-group
  18. Tutorials
  19. ---------
  20. - :doc:`Audio buses <../tutorials/audio/audio_buses>`
  21. .. rst-class:: classref-reftable-group
  22. Properties
  23. ----------
  24. .. table::
  25. :widths: auto
  26. +----------------------------------------------+--------------------------------------------------------------------+-------------+
  27. | :ref:`float<class_float>` | :ref:`drive<class_AudioEffectDistortion_property_drive>` | ``0.0`` |
  28. +----------------------------------------------+--------------------------------------------------------------------+-------------+
  29. | :ref:`float<class_float>` | :ref:`keep_hf_hz<class_AudioEffectDistortion_property_keep_hf_hz>` | ``16000.0`` |
  30. +----------------------------------------------+--------------------------------------------------------------------+-------------+
  31. | :ref:`Mode<enum_AudioEffectDistortion_Mode>` | :ref:`mode<class_AudioEffectDistortion_property_mode>` | ``0`` |
  32. +----------------------------------------------+--------------------------------------------------------------------+-------------+
  33. | :ref:`float<class_float>` | :ref:`post_gain<class_AudioEffectDistortion_property_post_gain>` | ``0.0`` |
  34. +----------------------------------------------+--------------------------------------------------------------------+-------------+
  35. | :ref:`float<class_float>` | :ref:`pre_gain<class_AudioEffectDistortion_property_pre_gain>` | ``0.0`` |
  36. +----------------------------------------------+--------------------------------------------------------------------+-------------+
  37. .. rst-class:: classref-section-separator
  38. ----
  39. .. rst-class:: classref-descriptions-group
  40. Enumerations
  41. ------------
  42. .. _enum_AudioEffectDistortion_Mode:
  43. .. rst-class:: classref-enumeration
  44. enum **Mode**:
  45. .. _class_AudioEffectDistortion_constant_MODE_CLIP:
  46. .. rst-class:: classref-enumeration-constant
  47. :ref:`Mode<enum_AudioEffectDistortion_Mode>` **MODE_CLIP** = ``0``
  48. Digital distortion effect which cuts off peaks at the top and bottom of the waveform.
  49. .. _class_AudioEffectDistortion_constant_MODE_ATAN:
  50. .. rst-class:: classref-enumeration-constant
  51. :ref:`Mode<enum_AudioEffectDistortion_Mode>` **MODE_ATAN** = ``1``
  52. .. _class_AudioEffectDistortion_constant_MODE_LOFI:
  53. .. rst-class:: classref-enumeration-constant
  54. :ref:`Mode<enum_AudioEffectDistortion_Mode>` **MODE_LOFI** = ``2``
  55. Low-resolution digital distortion effect (bit depth reduction). You can use it to emulate the sound of early digital audio devices.
  56. .. _class_AudioEffectDistortion_constant_MODE_OVERDRIVE:
  57. .. rst-class:: classref-enumeration-constant
  58. :ref:`Mode<enum_AudioEffectDistortion_Mode>` **MODE_OVERDRIVE** = ``3``
  59. 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.
  60. .. _class_AudioEffectDistortion_constant_MODE_WAVESHAPE:
  61. .. rst-class:: classref-enumeration-constant
  62. :ref:`Mode<enum_AudioEffectDistortion_Mode>` **MODE_WAVESHAPE** = ``4``
  63. Waveshaper distortions are used mainly by electronic musicians to achieve an extra-abrasive sound.
  64. .. rst-class:: classref-section-separator
  65. ----
  66. .. rst-class:: classref-descriptions-group
  67. Property Descriptions
  68. ---------------------
  69. .. _class_AudioEffectDistortion_property_drive:
  70. .. rst-class:: classref-property
  71. :ref:`float<class_float>` **drive** = ``0.0``
  72. .. rst-class:: classref-property-setget
  73. - void **set_drive** **(** :ref:`float<class_float>` value **)**
  74. - :ref:`float<class_float>` **get_drive** **(** **)**
  75. Distortion power. Value can range from 0 to 1.
  76. .. rst-class:: classref-item-separator
  77. ----
  78. .. _class_AudioEffectDistortion_property_keep_hf_hz:
  79. .. rst-class:: classref-property
  80. :ref:`float<class_float>` **keep_hf_hz** = ``16000.0``
  81. .. rst-class:: classref-property-setget
  82. - void **set_keep_hf_hz** **(** :ref:`float<class_float>` value **)**
  83. - :ref:`float<class_float>` **get_keep_hf_hz** **(** **)**
  84. High-pass filter, in Hz. Frequencies higher than this value will not be affected by the distortion. Value can range from 1 to 20000.
  85. .. rst-class:: classref-item-separator
  86. ----
  87. .. _class_AudioEffectDistortion_property_mode:
  88. .. rst-class:: classref-property
  89. :ref:`Mode<enum_AudioEffectDistortion_Mode>` **mode** = ``0``
  90. .. rst-class:: classref-property-setget
  91. - void **set_mode** **(** :ref:`Mode<enum_AudioEffectDistortion_Mode>` value **)**
  92. - :ref:`Mode<enum_AudioEffectDistortion_Mode>` **get_mode** **(** **)**
  93. Distortion type.
  94. .. rst-class:: classref-item-separator
  95. ----
  96. .. _class_AudioEffectDistortion_property_post_gain:
  97. .. rst-class:: classref-property
  98. :ref:`float<class_float>` **post_gain** = ``0.0``
  99. .. rst-class:: classref-property-setget
  100. - void **set_post_gain** **(** :ref:`float<class_float>` value **)**
  101. - :ref:`float<class_float>` **get_post_gain** **(** **)**
  102. Increases or decreases the volume after the effect, in decibels. Value can range from -80 to 24.
  103. .. rst-class:: classref-item-separator
  104. ----
  105. .. _class_AudioEffectDistortion_property_pre_gain:
  106. .. rst-class:: classref-property
  107. :ref:`float<class_float>` **pre_gain** = ``0.0``
  108. .. rst-class:: classref-property-setget
  109. - void **set_pre_gain** **(** :ref:`float<class_float>` value **)**
  110. - :ref:`float<class_float>` **get_pre_gain** **(** **)**
  111. Increases or decreases the volume before the effect, in decibels. Value can range from -60 to 60.
  112. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  113. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  114. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  115. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  116. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  117. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`