audio_effects.rst 6.0 KB

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