game/godot

Godot3 API - Audio Buses

C/H 2018. 10. 26. 08:30

Audio Buses

Introduction

Beginning Godot 3.0, the audio engine has been rewritten from scratch. The aim now is to present an interface much friendlier to sound design professionals. To achieve this, the audio engine contains a virtual rack where unlimited audio buses can be created and, on each of it, unlimited amount of effect processors can be added (or more like, as long as your CPU holds up!)
Godot 3.0부터는 오디오 엔진이 처음부터 다시 작성되었습니다. 이제 목표는 건전한 디자인 전문가에게 훨씬 친숙한 인터페이스를 제시하는 것입니다. 이를 달성하기 위해 오디오 엔진에는 무제한 오디오 버스를 생성 할 수있는 가상 랙이 포함되어 있으며, 각각에 무제한의 이펙트 프로세서를 추가 할 수 있습니다 (더 비슷하게는, CPU가 작동하는 한).

The implementation in Godot is pretty efficient and has been written entirely from the ground up, without relying on any existing audio libraries.
Godot의 구현은 매우 효율적이며 기존의 오디오 라이브러리에 의존하지 않고 처음부터 완전히 작성되었습니다.

Even the effect processors were written exclusively for Godot (save for the pitch shifting library), with games in mind. This allows a efficient tradeoff between performance and sound quality.
이펙트 프로세서조차 게임을 염두에두고 Godot (독점적으로 피치 시프팅 라이브러리 제외) 용으로 작성되었습니다. 이는 성능과 음질 간의 효율적인 절충을 허용합니다.

Decibel Scale

The new audio engine works primarily using the decibel scale. We have chosen this over linear representation of amplitude because it’s more intuitive for audio professionals.
새로운 오디오 엔진은 주로 데시벨 스케일을 사용하여 작동합니다. 우리는 진폭의 선형 표현에 비해 오디오 전문가에게 보다 직관적이기 때문에 이것을 선택했습니다.

For those unfamiliar with it, it can be explained with a few facts:
익숙하지 않은 사람들을 위해 몇 가지 사실을 설명 할 수 있습니다:

  • The decibel (dB) scale is a relative scale. It represents the ratio of sound power by using 10 times the base 10 logarithm of the ratio (10×log10(P/P0)).
    데시벨 (dB) 스케일은 상대적 스케일입니다. 그것은 비율의 기본 10 로그 (10 × log10 (P / P0))의 10 배를 사용하여 사운드 파워의 비율을 나타냅니다.
  • For every 3dB, sound doubles or halves. 6dB represents a factor 4, 9dB a factor 8, 10dB a factor 10, 20dB a factor 100, etc.
    3dB마다 소리가 두배나 반으로 줄어 듭니다. 6dB는 4인자, 9dB는 8인자, 10dB은 10인자, 20dB는 100인자 등을 나타냅니다.
  • Since the scale is logarithmic, true zero (no audio) can’t be represented.
    스케일은 대수적이기 때문에 실제 0 (오디오 없음)을 표현할 수 없습니다.
  • 0dB is considered the maximum audible volume without clipping. This limit is not the human limit but a limit from the sound hardware. Your sound output simply can’t output any sound louder than 0dB without distorting it (clipping it).
    0dB은 클리핑 없이 최대 가청 볼륨으로 간주됩니다. 이 한도는 인적(가청) 제한이 아니라 사운드 하드웨어의 한계입니다. 사운드 출력은 0dB보다 큰 소리를 왜곡시키지 않고 출력 할 수 없습니다 (클리핑).
  • Because of the above, your sound mix should work in a way where the sound output of the Master Bus (more on that later), should never be above 0dB.
    위의 이유로 인해, 사운드 믹스는 마스터 버스의 사운드 출력 (나중에 자세히 설명)이 0dB를 초과해서는 안되는 방식으로 작동해야 합니다.
  • Every 3dB below the 0dB limit, sound energy is halved. It means the sound volume at -3dB is half as loud as 0dB. -6dB is half as loud as -3dB and so on.
    모든 3dB가 0dB 한도보다 낮으면 사운드 에너지가 절반으로 줄어 듭니다. -3dB의 음량은 0dB의 절반 정도입니다. -6dB는 -3dB만큼 큰 소리입니다.
  • When working with decibels, sound is considered no longer audible between -60dB and -80dB. This makes your working range generally between -60dB and 0dB.
    데시벨로 작업 할 때 소리는 더 이상 -60dB에서 -80dB 사이에서 들리지 않는 것으로 간주됩니다. 이것은 일반적으로 -60dB에서 0dB 사이의 작업 범위를 만듭니다.
  • This can take a bit getting used to, but it’s friendlier in the end and will allow you to communicate better with audio professionals.
    조금 익숙해지기는하지만, 결국에는 더 친숙하며 오디오 전문가와 더 잘 소통 할 수 있습니다.

Audio Buses

Audio buses can be found in the bottom panel of Godot Editor:
오디오 버스는 Godot Editor의 하단 패널에서 찾을 수 있습니다.

An Audio Bus bus (often called “Audio Channels” too) is a device where audio is channeled. Audio data passes through it and can be modified and re-routed. A VU-Meter (the bars that go up and down when sound is played) can measure the loudness of the sound in Decibel scale.
오디오 버스 버스 (종종 "오디오 채널"이라고도 함)는 오디오가 채널링되는 장치입니다. 오디오 데이터는이를 통과하고 수정 및 재 라우트 될 수 있습니다. VU 미터 (사운드가 재생 될 때 위아래로 움직이는 막대)는 데시벨 스케일로 사운드의 소리 크기를 측정 할 수 있습니다.

The leftmost bus is the Master Bus. This bus outputs the mix to your speakers so, as mentioned in the item above (Decibel Scale), make sure that your mix rarely or never goes above 0dB in this bus. The rest of the audio buses are used for routing. This means that, after modifying the sound, they must send it to another bus to the left. Routing is always from right to left without exception as this avoids creating infinite routing loops!
가장 왼쪽 버스는 마스터 버스입니다. 이 버스는 믹스를 스피커로 출력하므로 위의 항목 (데시벨 스케일)에서 설명한 것처럼이 버스에서 믹스가 거의 0dB 이상이되지 않도록하십시오. 나머지 오디오 버스는 라우팅에 사용됩니다. 즉, 사운드를 수정 한 후에는 다른 버스로 보내야합니다. 무제한 라우팅 루프를 만들지 않으므로 라우팅은 항상 오른쪽에서 왼쪽으로 예외없이 이루어집니다!

In the above image, Bus 2 is routing its output to Master bus.
위의 그림에서 버스 2는 마스터 버스로 출력을 라우팅합니다.

Playback of Audio to a Bus

To test playback to a bus, create an AudioStreamPlayer node, load an AudioStream and select a target bus for playback:
버스에 대한 재생을 테스트하려면 AudioStreamPlayer 노드를 만들고 AudioStream을로드 한 다음 재생할 대상 버스를 선택하십시오:

Finally toggle the “playing” property to on and sound will flow.
마지막으로 "playing"속성을 켜기로 전환하면 사운드가 흘러 나옵니다.

To learn more about Audio Streams, please read the related tutorial later! (@TODO link to audio streams tute)
오디오 스트림에 대한 자세한 내용은 나중에 관련 자습서를 읽어보십시오! (오디오 스트림에 대한 @TODO 링크 tute)

Adding Effects

Audio buses can contain all sorts of effects. These effects modify the sound in one way or another and are applied in order.
오디오 버스는 모든 종류의 효과를 포함 할 수 있습니다. 이 효과는 사운드를 한 방향 또는 다른 방향으로 수정하고 순서대로 적용됩니다.

Following is a short description of available effects:
다음은 사용 가능한 효과에 대한 간략한 설명입니다:

Amplify

It’s the most basic effect. It changes the sound volume. Amplifying too much can make the sound clip, so be wary of that.
가장 기본적인 효과입니다. 사운드 볼륨을 변경합니다. 너무 많이 증폭하면 사운드 클립을 만들 수 있으므로주의하십시오.

BandLimit and BandPass

These are resonant filters which block frequencies around the Cutoff point. BandPass is resonant, while BandLimit stretches to the sides.
이들은 컷오프 지점 주변의 주파수를 차단하는 공진 필터입니다. BandPass는 공명이며 BandLimit은 측면으로 확장됩니다.

Chorus

This effect adds extra voices, detuned by LFO and with a small delay, to add more richness to the sound harmonics and stereo width.
이 효과는 사운드 고조파 및 스테레오 폭을보다 풍부하게 추가하기 위해 LFO 및 작은 지연으로 튜닝 된 추가 보이스를 추가합니다.

Compressor

The aim of a dynamic range compressor is to reduce the level of the sound when the amplitude goes over a certain threshold in Decibels. One of the main uses of a compressor is to increase the dynamic range while clipping the least possible (when sound goes over 0dB).
다이나믹 레인지 컴프레서의 목적은 진폭이 데시벨 단위의 특정 임계 값을 초과 할 때 사운드 레벨을 낮추는 것입니다. 컴프레서의 주된 용도 중 하나는 다이나믹 레인지를 증가시키면서 최소 가능 거리 (사운드가 0dB 이상일 때)를 줄이는 것입니다.

Compressor has may uses in the mix, for example: * It can be used in the Master bus to compress the whole output (Although a Limiter is probably better) * It can be used in voice channels to ensure they sound as even as possible. * It can be Sidechained. This means, it can reduce the sound level using another audio bus for threshold detection. This technique is very common in video game mixing to download the level of Music/SFX while voices are being heard. * It can accentuate transients by using a bit wider attack, meaning it can make sound effects sound more punchy.
컴프레서는 다음과 같이 믹스에서 사용할 수 있습니다. * 마스터 버스에서 전체 출력을 압축하는 데 사용할 수 있습니다 (리미터가 더 좋을지라도) * 음성 채널에서 가능한 한 소리가 나는지 확인하는 데 사용할 수 있습니다. * 사이드 체인이 될 수 있습니다. 즉, 임계 값 감지를 위해 다른 오디오 버스를 사용하여 사운드 레벨을 낮출 수 있습니다. 이 기술은 비디오 게임 믹싱에서 보이스가 들리는 동안 Music / SFX 레벨을 다운로드하는 데 매우 일반적입니다. * 좀 더 넓은 어택을 사용하여 과도기를 강조 할 수 있습니다. 즉, 사운드 효과를 더욱 펀치감있게 들릴 수 있습니다.

There is a lot of bibliography written about compressors, and Godot implementation is rather standard.
압축기에 관한 많은 참고 문헌이 있으며 Godot 구현은 오히려 표준입니다.

Delay

Adds an “Echo” effect with a feedback loop. It can be used, together with Reverb, to simulate wide rooms, canyons, etc. where sound bounces are far apart.
피드백 루프와 함께 "에코"효과를 추가합니다. 리버브 (Reverb)와 함께 사용하면 사운드 바운스가 멀리 떨어져있는 넓은 룸, 협곡 등을 시뮬레이션 할 수 있습니다.

Distortion

Adds classical effects to modify the sound and make it dirty. Godot supports effects like overdrive, tan, or bit crushing. For games, it can simulate sound coming from some saturated device or speaker efficiently.
클래식 효과를 추가하여 사운드를 수정하고 더러운 사운드를 만듭니다. Godot는 오버 드라이브, tan, 비트 분쇄와 같은 효과를 지원합니다. 게임의 경우 포화 된 장치 나 스피커에서 효율적으로 나오는 소리를 시뮬레이션 할 수 있습니다.

EQ6, EQ10, EQ21

Godot provides three model of equalizers with different band counts. Equalizers are useful on the Master Bus to completely master a mix and give it character. They are also useful when a game is run on a mobile device, to adjust the mix to that kind of speakers (it can be added but disabled when headphones are plugged).
Godot은 다른 대역 수의 3 가지 이퀄라이저 모델을 제공합니다. 이퀄라이저는 마스터 버스에서 믹스를 완벽하게 마스터하고 캐릭터를 부여하는 데 유용합니다. 또한 모바일 장치에서 게임을 실행하고 해당 종류의 스피커로 믹스를 조정할 때 유용합니다 (헤드폰을 꽂을 때 추가 및 비활성화 할 수 있음).

HighPassFilter, HighShelfFilter

These are filters that cut frequencies below a specific Cutoff. A common use of high pass filters is to add it to effects (or voice) that were recorded too close too a mic and need to sound more realistic. It is commonly used for some types of environment like space.
특정 컷오프 아래의 주파수를 차단하는 필터입니다. 하이 패스 필터의 일반적인 사용법은 마이크에 너무 가까이 기록 된 이펙트 (또는 음성)에이를 추가하여보다 사실적인 사운드를 재생해야합니다. 그것은 일반적으로 공간과 같은 일부 유형의 환경에 사용됩니다.

Limiter

A limiter is similar to a compressor, but it’s less flexible and designed to disallow sound going over a given dB threshold. Adding one in the Master Bus is always recommended to reduce the effects of clipping.
리미터는 컴프레서와 비슷하지만 유연성이 떨어지며 주어진 dB 임계 값을 초과하는 사운드를 허용하지 않도록 설계되었습니다. 클리핑 효과를 줄이기 위해 마스터 버스에 하나를 추가하는 것이 항상 권장됩니다.

LowPassFilter, LowShelfFilter

These are the most common filters, they cut frequencies above a specific Cutoff and can also resonate. They can be used for a wide amount of effects, from underwater sound to simulating a sound coming from far away.
가장 일반적인 필터로 특정 컷오프 이상의 주파수를 차단하고 공명을 나타낼 수도 있습니다. 수중 음향에서부터 멀리 떨어진 소리의 시뮬레이션에 이르기까지 광범위한 효과에 사용할 수 있습니다.

NotchFilter

The opposite to the BandPassFilter, it removes a band of sound from the frequency spectrum at a given Cutoff.
BandPassFilter와는 반대로, 주어진 컷오프 (Cutoff)에서 주파수 스펙트럼으로부터 사운드 대역을 제거합니다.

Panner

This is a simple helper to pan sound left or right.
이것은 왼쪽이나 오른쪽으로 소리를내는 간단한 도우미입니다.

Phaser

It probably does not make much sense to explain that this effect is formed by two signals being dephased and cancelling each other out. It will be sufficient to note that you can make a Darth Vader voice with it, or jet-like sounds.
이 효과는 두 개의 신호가 디 페이즈되고 서로 상쇄 됨으로서 형성된다는 것을 설명하는 것은별로 의미가 없습니다. 다트 베이더 (Darth Vader)의 목소리를 낼 수 있거나 제트 같은 소리를 낼 수 있음을 알아두면 충분합니다.

PitchShift

This effect allows for modulating pitch independently of tempo. All frequencies can be increased/decreased with minimal effect on transients. Can be used for effects such as voice modulation.
이 효과는 템포와 독립적으로 피치를 조절할 수 있습니다. 과도 전류에 미치는 영향을 최소화하면서 모든 주파수를 높이거나 낮출 수 있습니다. 음성 변조와 같은 효과에 사용할 수 있습니다.

Reverb

Reverb simulates rooms of different sizes. It has adjustable parameters that can be tweaked to obtain the sound of a specific room. Reverb is commonly outputted from Areas (@TODO LINK TO TUTORIAL WHEN DONE), or to apply chamber feel to all sounds.
리버브는 크기가 다른 방을 시뮬레이션합니다. 특정 룸의 사운드를 얻기 위해 조정할 수있는 조정 가능한 매개 변수가 있습니다. 리버브는 일반적으로 영역 (@TODO LINK TO TUTORIAL DONE)에서 출력되거나 모든 사운드에 챔버 느낌을 적용합니다.

StereoEnhance

This effect has a few algorithms available to enhance the stereo spectrum, in case this is needed.
이 효과에는 필요한 경우 스테레오 스펙트럼을 향상시키는 데 사용할 수있는 몇 가지 알고리즘이 있습니다.

Automatic Bus Disabling

There is no need to disable buses manually when not in use, Godot detects that the bus has been silent for a few seconds and disable it (including all effects).
사용하지 않을 때 버스를 수동으로 비활성화 할 필요가 없으며, Godot는 버스가 몇 초 동안 아무 소리도 내지 않았 음을 감지하고 모든 효과를 포함하여 버스를 비활성화합니다.

Bus Rearrangement

Stream Players use bus names to identify a bus, which allows adding, removing and moving buses around while the reference to them is kept. If a bus is renamed, however, the reference will be lost and the Stream Player will output to Master. This system was chosen because rearranging buses is a more common process than renaming them.
스트림 플레이어는 버스 이름을 사용하여 버스를 식별합니다. 버스 이름을 참조하는 동안 버스를 추가, 제거 및 이동할 수 있습니다. 그러나 버스의 이름이 변경되면 참조가 손실되고 스트림 플레이어가 Master로 출력됩니다. 이 시스템은 버스를 재정렬하는 것이 버스의 이름을 바꾸는 것보다 일반적인 프로세스이기 때문에 선택되었습니다.

Default Bus Layout

The default bus layout is automatically saved to the “res://default_bus_layout.res” file. Other bus layouts can be saved/retrieved from files in case of having to change snapshots, but in most cases this is not necessary.
기본 버스 레이아웃은 자동으로 "res://default_bus_layout.res"파일에 저장됩니다. 다른 버스 레이아웃은 스냅 샷을 변경해야 할 경우를 대비해 파일에서 저장/검색 할 수 있지만 대부분의 경우에는 필요하지 않습니다.

반응형

'game > godot' 카테고리의 다른 글

Godot3 API - InputEvent  (0) 2018.10.29
Godot3 API - Audio Streams  (0) 2018.10.27
Godot3 API - StaticBody2D  (0) 2018.10.25
Godot3 API - KinematicBody2D  (0) 2018.10.24
Godot3 API - RigidBody2D  (0) 2018.10.23