Attention: Here be dragons

This is the latest (unstable) version of this documentation, which may document features not available in or compatible with released stable versions of Godot.

AudioEffectChorus

繼承: AudioEffect < Resource < RefCounted < Object

向音訊總線新增合唱音訊效果。

營造出多重音訊源的聽感。

說明

合唱(Chorus)效果會生成原始音訊的多個副本(稱為“聲部”),並對這些副本的音高進行細微的變化處理,然後將它們疊加在原始音訊之上,從而營造出聲音來自多個不同聲源的聽感。這會產生一種頻譜和空間上的流動感。

每個聲部都會在原始音訊播放後的一小段時間後才開始播放,這個時間差由 delay(延遲)來控制。一個內部的低頻振蕩器(LFO)負責控制它們的音高變化,而 depth(深度)則決定了 LFO 的最大作用量。

在現實世界中,這種效果常見於鋼琴、合唱團以及各類樂器合奏中。

這種效果也可以用來拓寬單聲道(Mono)音訊的聲場,並讓數字生成的聲音聽起來更具自然感或模擬裝置的質感。

教學

屬性

float

dry

1.0

float

voice/1/cutoff_hz

8000.0

float

voice/1/delay_ms

15.0

float

voice/1/depth_ms

2.0

float

voice/1/level_db

0.0

float

voice/1/pan

-0.5

float

voice/1/rate_hz

0.8

float

voice/2/cutoff_hz

8000.0

float

voice/2/delay_ms

20.0

float

voice/2/depth_ms

3.0

float

voice/2/level_db

0.0

float

voice/2/pan

0.5

float

voice/2/rate_hz

1.2

float

voice/3/cutoff_hz

float

voice/3/delay_ms

float

voice/3/depth_ms

float

voice/3/level_db

float

voice/3/pan

float

voice/3/rate_hz

float

voice/4/cutoff_hz

float

voice/4/delay_ms

float

voice/4/depth_ms

float

voice/4/level_db

float

voice/4/pan

float

voice/4/rate_hz

int

voice_count

2

float

wet

0.5

方法

float

get_voice_cutoff_hz(voice_idx: int) const

float

get_voice_delay_ms(voice_idx: int) const

float

get_voice_depth_ms(voice_idx: int) const

float

get_voice_level_db(voice_idx: int) const

float

get_voice_pan(voice_idx: int) const

float

get_voice_rate_hz(voice_idx: int) const

void

set_voice_cutoff_hz(voice_idx: int, cutoff_hz: float)

void

set_voice_delay_ms(voice_idx: int, delay_ms: float)

void

set_voice_depth_ms(voice_idx: int, depth_ms: float)

void

set_voice_level_db(voice_idx: int, level_db: float)

void

set_voice_pan(voice_idx: int, pan: float)

void

set_voice_rate_hz(voice_idx: int, rate_hz: float)


屬性說明

float dry = 1.0 🔗

原始音訊的音量比例。取值範圍為 0 到 1。


float voice/1/cutoff_hz = 8000.0 🔗

  • void set_voice_cutoff_hz(voice_idx: int, cutoff_hz: float)

  • float get_voice_cutoff_hz(voice_idx: int) const

語音低通濾波器的頻率閾值,單位為 Hz。


float voice/1/delay_ms = 15.0 🔗

  • void set_voice_delay_ms(voice_idx: int, delay_ms: float)

  • float get_voice_delay_ms(voice_idx: int) const

該聲部相對於原始音訊的延遲時間,單位為毫秒(ms)。


float voice/1/depth_ms = 2.0 🔗

  • void set_voice_depth_ms(voice_idx: int, depth_ms: float)

  • float get_voice_depth_ms(voice_idx: int) const

語音低頻振蕩器的深度,以毫秒為單位。


float voice/1/level_db = 0.0 🔗

  • void set_voice_level_db(voice_idx: int, level_db: float)

  • float get_voice_level_db(voice_idx: int) const

語音的增益,單位為分貝。


float voice/1/pan = -0.5 🔗

  • void set_voice_pan(voice_idx: int, pan: float)

  • float get_voice_pan(voice_idx: int) const

語音的聲像位置。


float voice/1/rate_hz = 0.8 🔗

  • void set_voice_rate_hz(voice_idx: int, rate_hz: float)

  • float get_voice_rate_hz(voice_idx: int) const

該聲部低頻振蕩器(low-frequency oscillator)的速率,單位為赫茲(Hz)。


float voice/2/cutoff_hz = 8000.0 🔗

  • void set_voice_cutoff_hz(voice_idx: int, cutoff_hz: float)

  • float get_voice_cutoff_hz(voice_idx: int) const

語音低通濾波器的頻率閾值,單位為 Hz。


float voice/2/delay_ms = 20.0 🔗

  • void set_voice_delay_ms(voice_idx: int, delay_ms: float)

  • float get_voice_delay_ms(voice_idx: int) const

該聲部相對於原始音訊的延遲時間,單位為毫秒(ms)。


float voice/2/depth_ms = 3.0 🔗

  • void set_voice_depth_ms(voice_idx: int, depth_ms: float)

  • float get_voice_depth_ms(voice_idx: int) const

語音低頻振蕩器的深度,以毫秒為單位。


float voice/2/level_db = 0.0 🔗

  • void set_voice_level_db(voice_idx: int, level_db: float)

  • float get_voice_level_db(voice_idx: int) const

語音的增益,單位為分貝。


float voice/2/pan = 0.5 🔗

  • void set_voice_pan(voice_idx: int, pan: float)

  • float get_voice_pan(voice_idx: int) const

語音的聲像位置。


float voice/2/rate_hz = 1.2 🔗

  • void set_voice_rate_hz(voice_idx: int, rate_hz: float)

  • float get_voice_rate_hz(voice_idx: int) const

該聲部低頻振蕩器(low-frequency oscillator)的速率,單位為赫茲(Hz)。


float voice/3/cutoff_hz 🔗

  • void set_voice_cutoff_hz(voice_idx: int, cutoff_hz: float)

  • float get_voice_cutoff_hz(voice_idx: int) const

語音低通濾波器的頻率閾值,單位為 Hz。


float voice/3/delay_ms 🔗

  • void set_voice_delay_ms(voice_idx: int, delay_ms: float)

  • float get_voice_delay_ms(voice_idx: int) const

該聲部相對於原始音訊的延遲時間,單位為毫秒(ms)。


float voice/3/depth_ms 🔗

  • void set_voice_depth_ms(voice_idx: int, depth_ms: float)

  • float get_voice_depth_ms(voice_idx: int) const

語音低頻振蕩器的深度,以毫秒為單位。


float voice/3/level_db 🔗

  • void set_voice_level_db(voice_idx: int, level_db: float)

  • float get_voice_level_db(voice_idx: int) const

語音的增益,單位為分貝。


float voice/3/pan 🔗

  • void set_voice_pan(voice_idx: int, pan: float)

  • float get_voice_pan(voice_idx: int) const

語音的聲像位置。


float voice/3/rate_hz 🔗

  • void set_voice_rate_hz(voice_idx: int, rate_hz: float)

  • float get_voice_rate_hz(voice_idx: int) const

該聲部低頻振蕩器(low-frequency oscillator)的速率,單位為赫茲(Hz)。


float voice/4/cutoff_hz 🔗

  • void set_voice_cutoff_hz(voice_idx: int, cutoff_hz: float)

  • float get_voice_cutoff_hz(voice_idx: int) const

語音低通濾波器的頻率閾值,單位為 Hz。


float voice/4/delay_ms 🔗

  • void set_voice_delay_ms(voice_idx: int, delay_ms: float)

  • float get_voice_delay_ms(voice_idx: int) const

該聲部相對於原始音訊的延遲時間,單位為毫秒(ms)。


float voice/4/depth_ms 🔗

  • void set_voice_depth_ms(voice_idx: int, depth_ms: float)

  • float get_voice_depth_ms(voice_idx: int) const

語音低頻振蕩器的深度,以毫秒為單位。


float voice/4/level_db 🔗

  • void set_voice_level_db(voice_idx: int, level_db: float)

  • float get_voice_level_db(voice_idx: int) const

語音的增益,單位為分貝。


float voice/4/pan 🔗

  • void set_voice_pan(voice_idx: int, pan: float)

  • float get_voice_pan(voice_idx: int) const

語音的聲像位置。


float voice/4/rate_hz 🔗

  • void set_voice_rate_hz(voice_idx: int, rate_hz: float)

  • float get_voice_rate_hz(voice_idx: int) const

該聲部低頻振蕩器(low-frequency oscillator)的速率,單位為赫茲(Hz)。


int voice_count = 2 🔗

  • void set_voice_count(value: int)

  • int get_voice_count()

該效果中的聲部數量。取值範圍為 1 到 4。


float wet = 0.5 🔗

所有聲部的音量比例。取值範圍為 0 到 1。


方法說明

float get_voice_cutoff_hz(voice_idx: int) const 🔗

回傳指定 voice_idx(聲部索引)的低通濾波器的頻率閾值(以赫茲 Hz 為單位)。高於該值的頻率將會從該聲部中被移除。


float get_voice_delay_ms(voice_idx: int) const 🔗

回傳指定 voice_idx(聲部索引)的低通濾波器的頻率閾值(以赫茲 Hz 為單位)。高於該值的頻率將會從該聲部中被移除。


float get_voice_depth_ms(voice_idx: int) const 🔗

回傳給定 voice_idx 的低頻振蕩器深度,以毫秒為單位。


float get_voice_level_db(voice_idx: int) const 🔗

回傳給定 voice_idx 的增益,單位為分貝。


float get_voice_pan(voice_idx: int) const 🔗

回傳指定 voice_idx(聲部索引)的聲像(Pan)位置。負值代表左聲道,正值代表右聲道。


float get_voice_rate_hz(voice_idx: int) const 🔗

回傳指定 voice_idx(聲部索引)的低頻振蕩器(low-frequency)的速率,單位為赫茲(Hz)。


void set_voice_cutoff_hz(voice_idx: int, cutoff_hz: float) 🔗

以赫茲(Hz)為單位,設定指定 voice_idx(聲部索引)的低通濾波器的頻率閾值。高於 cutoff_hz 的頻率將會從該 voice_idx(聲部)中被移除。該值的取值範圍是 1 到 20500。


void set_voice_delay_ms(voice_idx: int, delay_ms: float) 🔗

設定指定 voice_idx 相對於原始音訊的延遲,以毫秒為單位。取值範圍為 0 到 50。


void set_voice_depth_ms(voice_idx: int, depth_ms: float) 🔗

以毫秒(ms)為單位,設定指定 voice_idx(聲部索引)的低頻振蕩器(low-frequency oscillator)的深度。該值的取值範圍是 0 到 20。


void set_voice_level_db(voice_idx: int, level_db: float) 🔗

設定指定 voice_idx 的增益,單位為分貝。取值範圍為 -60 至 24。


void set_voice_pan(voice_idx: int, pan: float) 🔗

設定指定 voice_idx(聲部索引)的聲像(pan)位置。負值會將聲音偏向左側,正值會將聲音偏向右側。該值的取值範圍是 -1 到 1。


void set_voice_rate_hz(voice_idx: int, rate_hz: float) 🔗

以赫茲(Hz)為單位,設定指定 voice_idx(聲部索引)的低頻振蕩器(low-frequency oscillator)的速率。該值的取值範圍是 0.1 到 20。