class_audioeffectdistortion.rst 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the AudioEffectDistortion.xml source instead.
  3. .. The source is found in doc/classes or modules/<name>/doc_classes.
  4. .. _class_AudioEffectDistortion:
  5. AudioEffectDistortion
  6. =====================
  7. **Inherits:** :ref:`AudioEffect<class_audioeffect>` **<** :ref:`Resource<class_resource>` **<** :ref:`Reference<class_reference>` **<** :ref:`Object<class_object>`
  8. **Category:** Core
  9. Brief Description
  10. -----------------
  11. Adds a Distortion audio effect to an Audio bus.
  12. Modify the sound to make it dirty.
  13. Member Functions
  14. ----------------
  15. +----------------------------+--------------------------------------------------------------------------------------------------------------------+
  16. | :ref:`float<class_float>` | :ref:`get_drive<class_AudioEffectDistortion_get_drive>` **(** **)** const |
  17. +----------------------------+--------------------------------------------------------------------------------------------------------------------+
  18. | :ref:`float<class_float>` | :ref:`get_keep_hf_hz<class_AudioEffectDistortion_get_keep_hf_hz>` **(** **)** const |
  19. +----------------------------+--------------------------------------------------------------------------------------------------------------------+
  20. | :ref:`int<class_int>` | :ref:`get_mode<class_AudioEffectDistortion_get_mode>` **(** **)** const |
  21. +----------------------------+--------------------------------------------------------------------------------------------------------------------+
  22. | :ref:`float<class_float>` | :ref:`get_post_gain<class_AudioEffectDistortion_get_post_gain>` **(** **)** const |
  23. +----------------------------+--------------------------------------------------------------------------------------------------------------------+
  24. | :ref:`float<class_float>` | :ref:`get_pre_gain<class_AudioEffectDistortion_get_pre_gain>` **(** **)** const |
  25. +----------------------------+--------------------------------------------------------------------------------------------------------------------+
  26. | void | :ref:`set_drive<class_AudioEffectDistortion_set_drive>` **(** :ref:`float<class_float>` drive **)** |
  27. +----------------------------+--------------------------------------------------------------------------------------------------------------------+
  28. | void | :ref:`set_keep_hf_hz<class_AudioEffectDistortion_set_keep_hf_hz>` **(** :ref:`float<class_float>` keep_hf_hz **)** |
  29. +----------------------------+--------------------------------------------------------------------------------------------------------------------+
  30. | void | :ref:`set_mode<class_AudioEffectDistortion_set_mode>` **(** :ref:`int<class_int>` mode **)** |
  31. +----------------------------+--------------------------------------------------------------------------------------------------------------------+
  32. | void | :ref:`set_post_gain<class_AudioEffectDistortion_set_post_gain>` **(** :ref:`float<class_float>` post_gain **)** |
  33. +----------------------------+--------------------------------------------------------------------------------------------------------------------+
  34. | void | :ref:`set_pre_gain<class_AudioEffectDistortion_set_pre_gain>` **(** :ref:`float<class_float>` pre_gain **)** |
  35. +----------------------------+--------------------------------------------------------------------------------------------------------------------+
  36. Member Variables
  37. ----------------
  38. .. _class_AudioEffectDistortion_drive:
  39. - :ref:`float<class_float>` **drive** - Distortion power. Value can range from 0 to 1. Default value: ``0``.
  40. .. _class_AudioEffectDistortion_keep_hf_hz:
  41. - :ref:`float<class_float>` **keep_hf_hz** - High-pass filter. Frequencies higher than this value will not be affected by the distortion. Value can range from 1 to 20000. Default value: ``16000``.
  42. .. _class_AudioEffectDistortion_mode:
  43. - :ref:`int<class_int>` **mode** - Distortion type. Default value: ``MODE_CLIP``.
  44. .. _class_AudioEffectDistortion_post_gain:
  45. - :ref:`float<class_float>` **post_gain** - Increases or decreases the volume after the effect. Value can range from -80 to 24. Default value: ``0``.
  46. .. _class_AudioEffectDistortion_pre_gain:
  47. - :ref:`float<class_float>` **pre_gain** - Increases or decreases the volume before the effect. Value can range from -60 to 60. Default value: ``0``.
  48. Numeric Constants
  49. -----------------
  50. - **MODE_CLIP** = **0** --- Digital distortion effect which cuts off peaks at the top and bottom of the waveform.
  51. - **MODE_ATAN** = **1**
  52. - **MODE_LOFI** = **2** --- Low-resolution digital distortion effect. You can use it to emulate the sound of early digital audio devices.
  53. - **MODE_OVERDRIVE** = **3** --- Emulates the warm distortion produced by a field effect transistor, which is commonly used in solid-state musical instrument amplifiers.
  54. - **MODE_WAVESHAPE** = **4** --- Waveshaper distortions are used mainly by electronic musicians to achieve an extra-abrasive sound.
  55. Description
  56. -----------
  57. Modify the sound and make it dirty. Different types are available : clip, tan, lofi (bit crushing), overdrive, or waveshape.
  58. By distorting the waveform the frequency content change, which will often make the sound "crunchy" or "abrasive". For games, it can simulate sound coming from some saturated device or speaker very efficiently.
  59. Member Function Description
  60. ---------------------------
  61. .. _class_AudioEffectDistortion_get_drive:
  62. - :ref:`float<class_float>` **get_drive** **(** **)** const
  63. .. _class_AudioEffectDistortion_get_keep_hf_hz:
  64. - :ref:`float<class_float>` **get_keep_hf_hz** **(** **)** const
  65. .. _class_AudioEffectDistortion_get_mode:
  66. - :ref:`int<class_int>` **get_mode** **(** **)** const
  67. .. _class_AudioEffectDistortion_get_post_gain:
  68. - :ref:`float<class_float>` **get_post_gain** **(** **)** const
  69. .. _class_AudioEffectDistortion_get_pre_gain:
  70. - :ref:`float<class_float>` **get_pre_gain** **(** **)** const
  71. .. _class_AudioEffectDistortion_set_drive:
  72. - void **set_drive** **(** :ref:`float<class_float>` drive **)**
  73. .. _class_AudioEffectDistortion_set_keep_hf_hz:
  74. - void **set_keep_hf_hz** **(** :ref:`float<class_float>` keep_hf_hz **)**
  75. .. _class_AudioEffectDistortion_set_mode:
  76. - void **set_mode** **(** :ref:`int<class_int>` mode **)**
  77. .. _class_AudioEffectDistortion_set_post_gain:
  78. - void **set_post_gain** **(** :ref:`float<class_float>` post_gain **)**
  79. .. _class_AudioEffectDistortion_set_pre_gain:
  80. - void **set_pre_gain** **(** :ref:`float<class_float>` pre_gain **)**