class_audioeffectpitchshift.rst 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  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/3.6/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/3.6/doc/classes/AudioEffectPitchShift.xml.
  6. .. _class_AudioEffectPitchShift:
  7. AudioEffectPitchShift
  8. =====================
  9. **Inherits:** :ref:`AudioEffect<class_AudioEffect>` **<** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
  10. Adds a pitch-shifting audio effect to an Audio bus.
  11. Raises or lowers the pitch of original sound.
  12. .. rst-class:: classref-introduction-group
  13. Description
  14. -----------
  15. Allows modulation of pitch independently of tempo. All frequencies can be increased/decreased with minimal effect on transients.
  16. .. rst-class:: classref-reftable-group
  17. Properties
  18. ----------
  19. .. table::
  20. :widths: auto
  21. +------------------------------------------------------+------------------------------------------------------------------------+---------+
  22. | :ref:`FFT_Size<enum_AudioEffectPitchShift_FFT_Size>` | :ref:`fft_size<class_AudioEffectPitchShift_property_fft_size>` | ``3`` |
  23. +------------------------------------------------------+------------------------------------------------------------------------+---------+
  24. | :ref:`int<class_int>` | :ref:`oversampling<class_AudioEffectPitchShift_property_oversampling>` | ``4`` |
  25. +------------------------------------------------------+------------------------------------------------------------------------+---------+
  26. | :ref:`float<class_float>` | :ref:`pitch_scale<class_AudioEffectPitchShift_property_pitch_scale>` | ``1.0`` |
  27. +------------------------------------------------------+------------------------------------------------------------------------+---------+
  28. .. rst-class:: classref-section-separator
  29. ----
  30. .. rst-class:: classref-descriptions-group
  31. Enumerations
  32. ------------
  33. .. _enum_AudioEffectPitchShift_FFT_Size:
  34. .. rst-class:: classref-enumeration
  35. enum **FFT_Size**:
  36. .. _class_AudioEffectPitchShift_constant_FFT_SIZE_256:
  37. .. rst-class:: classref-enumeration-constant
  38. :ref:`FFT_Size<enum_AudioEffectPitchShift_FFT_Size>` **FFT_SIZE_256** = ``0``
  39. Use a buffer of 256 samples for the Fast Fourier transform. Lowest latency, but least stable over time.
  40. .. _class_AudioEffectPitchShift_constant_FFT_SIZE_512:
  41. .. rst-class:: classref-enumeration-constant
  42. :ref:`FFT_Size<enum_AudioEffectPitchShift_FFT_Size>` **FFT_SIZE_512** = ``1``
  43. Use a buffer of 512 samples for the Fast Fourier transform. Low latency, but less stable over time.
  44. .. _class_AudioEffectPitchShift_constant_FFT_SIZE_1024:
  45. .. rst-class:: classref-enumeration-constant
  46. :ref:`FFT_Size<enum_AudioEffectPitchShift_FFT_Size>` **FFT_SIZE_1024** = ``2``
  47. Use a buffer of 1024 samples for the Fast Fourier transform. This is a compromise between latency and stability over time.
  48. .. _class_AudioEffectPitchShift_constant_FFT_SIZE_2048:
  49. .. rst-class:: classref-enumeration-constant
  50. :ref:`FFT_Size<enum_AudioEffectPitchShift_FFT_Size>` **FFT_SIZE_2048** = ``3``
  51. Use a buffer of 2048 samples for the Fast Fourier transform. High latency, but stable over time.
  52. .. _class_AudioEffectPitchShift_constant_FFT_SIZE_4096:
  53. .. rst-class:: classref-enumeration-constant
  54. :ref:`FFT_Size<enum_AudioEffectPitchShift_FFT_Size>` **FFT_SIZE_4096** = ``4``
  55. Use a buffer of 4096 samples for the Fast Fourier transform. Highest latency, but most stable over time.
  56. .. _class_AudioEffectPitchShift_constant_FFT_SIZE_MAX:
  57. .. rst-class:: classref-enumeration-constant
  58. :ref:`FFT_Size<enum_AudioEffectPitchShift_FFT_Size>` **FFT_SIZE_MAX** = ``5``
  59. Represents the size of the :ref:`FFT_Size<enum_AudioEffectPitchShift_FFT_Size>` enum.
  60. .. rst-class:: classref-section-separator
  61. ----
  62. .. rst-class:: classref-descriptions-group
  63. Property Descriptions
  64. ---------------------
  65. .. _class_AudioEffectPitchShift_property_fft_size:
  66. .. rst-class:: classref-property
  67. :ref:`FFT_Size<enum_AudioEffectPitchShift_FFT_Size>` **fft_size** = ``3``
  68. .. rst-class:: classref-property-setget
  69. - void **set_fft_size** **(** :ref:`FFT_Size<enum_AudioEffectPitchShift_FFT_Size>` value **)**
  70. - :ref:`FFT_Size<enum_AudioEffectPitchShift_FFT_Size>` **get_fft_size** **(** **)**
  71. The size of the `Fast Fourier transform <https://en.wikipedia.org/wiki/Fast_Fourier_transform>`__ buffer. Higher values smooth out the effect over time, but have greater latency. The effects of this higher latency are especially noticeable on sounds that have sudden amplitude changes.
  72. .. rst-class:: classref-item-separator
  73. ----
  74. .. _class_AudioEffectPitchShift_property_oversampling:
  75. .. rst-class:: classref-property
  76. :ref:`int<class_int>` **oversampling** = ``4``
  77. .. rst-class:: classref-property-setget
  78. - void **set_oversampling** **(** :ref:`int<class_int>` value **)**
  79. - :ref:`int<class_int>` **get_oversampling** **(** **)**
  80. The oversampling factor to use. Higher values result in better quality, but are more demanding on the CPU and may cause audio cracking if the CPU can't keep up.
  81. .. rst-class:: classref-item-separator
  82. ----
  83. .. _class_AudioEffectPitchShift_property_pitch_scale:
  84. .. rst-class:: classref-property
  85. :ref:`float<class_float>` **pitch_scale** = ``1.0``
  86. .. rst-class:: classref-property-setget
  87. - void **set_pitch_scale** **(** :ref:`float<class_float>` value **)**
  88. - :ref:`float<class_float>` **get_pitch_scale** **(** **)**
  89. The pitch scale to use. ``1.0`` is the default pitch and plays sounds unaltered. :ref:`pitch_scale<class_AudioEffectPitchShift_property_pitch_scale>` can range from ``0.0`` (infinitely low pitch, inaudible) to ``16`` (16 times higher than the initial pitch).
  90. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  91. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  92. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  93. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`