audio_effects.rst 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. :article_outdated: True
  2. .. _doc_audio_effects:
  3. Audio effects
  4. =============
  5. Godot includes several audio effects that can be added to an audio bus to
  6. alter every sound file that goes through that bus.
  7. .. image:: img/audio_buses4.png
  8. Try them all out to get a sense of how they alter sound. Here follows a short
  9. description of the available effects:
  10. Amplify
  11. ~~~~~~~
  12. Amplify changes the amplitude of the signal. Some care needs to be taken.
  13. Setting the level too high can make the sound clip, which is usually
  14. undesirable.
  15. BandLimit and BandPass
  16. ~~~~~~~~~~~~~~~~~~~~~~
  17. These are resonant filters which block frequencies around the *Cutoff* point.
  18. BandPass can be used to simulate sound passing through an old telephone line or
  19. megaphone. Modulating the BandPass frequency can simulate the sound of a wah-wah
  20. guitar pedal, think of the guitar in Jimi Hendrix's *Voodoo Child (Slight
  21. Return)*.
  22. Capture
  23. ~~~~~~~
  24. The Capture effect copies the audio frames of the audio bus that it is on into
  25. an internal buffer. This can be used to capture data from the microphone
  26. or to transmit audio over the network in real-time.
  27. Chorus
  28. ~~~~~~
  29. The Chorus effect duplicates the incoming audio, delays the duplicate slightly
  30. and uses an LFO to continuously modulate the pitch of the duplicated signal
  31. before mixing the duplicated signal(s) and the original together again. This
  32. creates a shimmering effect and adds stereo width to the sound.
  33. Compressor
  34. ~~~~~~~~~~
  35. A dynamic range compressor automatically attenuates the level of the incoming
  36. signal when its amplitude exceeds a certain threshold. The level of attenuation
  37. applied is proportional to how far the incoming audio exceeds the threshold.
  38. The compressor's Ratio parameter controls the degree of attenuation.
  39. One of the main uses of a compressor is to reduce the dynamic range of signals
  40. with very loud and quiet parts. Reducing the dynamic range of a signal
  41. can make it easier to mix.
  42. The compressor has many uses. For example:
  43. - It can be used in the Master bus to compress the whole output.
  44. - It can be used in voice channels to ensure they sound as even as possible.
  45. - It can be *sidechained*. This means it can reduce the sound level
  46. of one signal using the level of another audio bus for threshold detection.
  47. This technique is very common in video game mixing to "duck" the level of
  48. music or sound effects when voices need to be heard.
  49. - It can accentuate transients by using a slower attack.
  50. This can make sound effects more punchy.
  51. .. note::
  52. If your goal is to prevent a signal from exceeding a given amplitude
  53. altogether, rather than to reduce the dynamic range of the signal,
  54. a :ref:`limiter <doc_audio_buses_limiter>` is likely a better choice
  55. than a compressor.
  56. Delay
  57. ~~~~~
  58. Adds an "echo" effect with a feedback loop. It can be used together
  59. with *Reverb* to simulate wide rooms, canyons, etc. where sound bounces
  60. are far apart.
  61. Distortion
  62. ~~~~~~~~~~
  63. Makes the sound distorted. Godot offers several types of distortion: *overdrive*,
  64. *tan* and *bit crushing*. Distortion can be used to simulate sound coming through
  65. a low-quality speaker or device.
  66. EQ
  67. ~~
  68. EQ is what all other equalizers inherit from. It can be extended with Custom
  69. scripts to create an equalizer with a custom number of bands.
  70. EQ6, EQ10, EQ21
  71. ~~~~~~~~~~~~~~~
  72. Godot provides three equalizers with different numbers of bands. An equalizer on
  73. the Master bus can be useful to cut frequencies that the device's speakers can't
  74. reproduce well (e.g. a mobile phone's speakers won't reproduce bass content
  75. well). The equalizer effect can be disabled when headphones are plugged in.
  76. Filter
  77. ~~~~~~
  78. Filter is what all other filters inherit from and should not be used directly.
  79. HighPassFilter
  80. ~~~~~~~~~~~~~~
  81. Cuts frequencies below a specific *Cutoff* frequency.
  82. HighPassFilter is used to reduce the bass content of a
  83. signal.
  84. HighShelfFilter
  85. ~~~~~~~~~~~~~~~
  86. Reduces all frequencies above a specific *Cutoff* frequency.
  87. .. _doc_audio_buses_limiter:
  88. Limiter
  89. ~~~~~~~
  90. A limiter is similar to a compressor, but it's less flexible and designed to
  91. prevent a signal's amplitude exceeding a given dB threshold. Adding a limiter to
  92. the Master bus is a safeguard against clipping.
  93. LowPassFilter
  94. ~~~~~~~~~~~~~
  95. Cuts frequencies above a specific *Cutoff* frequency and can also resonate
  96. (boost frequencies close to the *Cutoff* frequency). Low pass filters can be
  97. used to simulate "muffled" sound. For instance, underwater sounds, sounds
  98. blocked by walls, or distant sounds.
  99. LowShelfFilter
  100. ~~~~~~~~~~~~~~
  101. Reduces all frequencies below a specific *Cutoff* frequency.
  102. NotchFilter
  103. ~~~~~~~~~~~
  104. The opposite of the BandPassFilter, it removes a band of sound from the
  105. frequency spectrum at a given *Cutoff* frequency.
  106. Panner
  107. ~~~~~~
  108. The Panner allows the stereo balance of a signal to be adjusted between
  109. the left and right channels (wear headphones to audition this effect).
  110. Phaser
  111. ~~~~~~
  112. It probably does not make much sense to explain that this effect is formed by
  113. two signals being dephased and cancelling each other out. You can make a Darth
  114. Vader voice with it, or jet-like sounds.
  115. PitchShift
  116. ~~~~~~~~~~
  117. This effect allows the adjustment of the signal's pitch independently of its
  118. speed. All frequencies can be increased/decreased with minimal effect on
  119. transients. PitchShift can be useful to create unusually high or deep voices.
  120. Record
  121. ~~~~~~
  122. The Record effect allows the user to record sound from a microphone.
  123. Reverb
  124. ~~~~~~
  125. Reverb simulates rooms of different sizes. It has adjustable parameters that can
  126. be tweaked to obtain the sound of a specific room. Reverb is commonly outputted
  127. from :ref:`Area3Ds <class_Area3D>`
  128. (see :ref:`Reverb buses <doc_audio_streams_reverb_buses>`), or to apply
  129. a "chamber" feel to all sounds.
  130. SpectrumAnalyzer
  131. ~~~~~~~~~~~~~~~~
  132. This effect doesn't alter audio, instead, you add this effect to buses you want
  133. a spectrum analysis of. This would typically be used for audio visualization. A
  134. demo project using this can be found `here <https://github.com/godotengine/godot-demo-projects/tree/master/audio/spectrum>`__.
  135. StereoEnhance
  136. ~~~~~~~~~~~~~
  137. This effect uses a few algorithms to enhance a signal's stereo spectrum.