元編程參考文件

生成

7 個節點

本頁內容 7

噪聲

函數

Random noise of a chosen colour.

簽名
噪聲 -> AudioBuffer
    顏色: Noise Color
    時長: 數字
    振幅: 數字
    種子: 整數
    取樣率: 整數
AudioBuffer Noise(
    NoiseColor color = NoiseColor.White,
    double duration = 1,
    double amplitude = 0.5,
    int seed = 1,
    int sampleRate = 44100)

參數

名稱型別預設值說明
顏色Noise Color白噪聲White hisses, pink sounds like rain, brown rumbles.
時長數字1Length, in seconds.
振幅數字0.5Peak level, from 0 to 1.
種子整數1Which take of the noise.
取樣率整數44100Samples per second.

返回

音訊AudioBuffer

備註

The same seed gives the same noise every time, so a document sounds the same on every run; change the seed for a different take.

所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
資料流 函數 事件 例程 藍圖 狀態機狀態
宣告於
生成
所屬包
音訊處理

音符頻率

函數

The frequency of a note named the way a musician writes it: A4, C#5, Eb3.

簽名
音符頻率(音符: 文字) -> 數字
double NoteFrequency(string note = "A4")

參數

名稱型別預設值說明
音符文字A4A letter A to G, an optional # or b, and an octave number.

返回

頻率數字

備註

Equal temperament with A4 at 440 Hz; middle C is C4. A sharp is # and a flat is b.

所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
資料流 函數 事件 例程 藍圖 狀態機狀態
宣告於
生成
所屬包
音訊處理

靜音

函數

Nothing, for a length of time - a gap between sounds, or a bed to mix them onto.

簽名
靜音(時長: 數字, 聲道數: 整數, 取樣率: 整數) -> AudioBuffer
AudioBuffer Silence(
    double duration = 1,
    int channels = 1,
    int sampleRate = 44100)

參數

名稱型別預設值說明
時長數字1Length, in seconds.
聲道數整數1How many channels: 1 for mono, 2 for stereo.
取樣率整數44100Samples per second.

返回

音訊AudioBuffer
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
資料流 函數 事件 例程 藍圖 狀態機狀態
宣告於
生成
所屬包
音訊處理

音效

函數

A synthesized game sound effect - a coin, a laser, an explosion, footsteps, rain - from the built-in recipe library.

簽名
音效(名稱: 文字, 種子: 整數) -> AudioBuffer
AudioBuffer SoundEffect(
    string name = "Pickup/Coin",
    int seed = 1)

參數

名稱型別預設值說明
名稱文字Pickup/CoinThe effect's name, such as Pickup/Coin, Weapon/Laser or Ambient/Rain.
種子整數1Which take of the effect.

返回

音訊AudioBuffer

備註

Every effect is made from oscillators, noise and filters as it is rendered; nothing is a recording. Each seed is a slightly different take of the same effect, which is what stops a sound played a hundred times from sounding like one sample played a hundred times. AudioGenerators.SoundEffectNames lists every name.

所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
資料流 函數 事件 例程 藍圖 狀態機狀態
宣告於
生成
所屬包
音訊處理

音效名稱

函數

The name of every effect AudioGenerators.SoundEffect can make.

簽名
音效名稱() -> 文字陣列
string[] SoundEffectNames()

返回

名稱文字陣列
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
資料流 函數 事件 例程 藍圖 狀態機狀態
宣告於
生成
所屬包
音訊處理

掃頻

函數

A tone whose pitch glides from one frequency to another, evenly in musical terms - each octave takes the same time.

簽名
掃頻 -> AudioBuffer
    起始頻率: 數字
    結束頻率: 數字
    時長: 數字
    振幅: 數字
    波形: Waveform
    取樣率: 整數
AudioBuffer Sweep(
    double startFrequency = 100,
    double endFrequency = 8000,
    double duration = 3,
    double amplitude = 0.5,
    Waveform waveform = Waveform.Sine,
    int sampleRate = 44100)

參數

名稱型別預設值說明
起始頻率數字100Where the glide starts, in hertz.
結束頻率數字8000Where it ends, in hertz.
時長數字3Length, in seconds.
振幅數字0.5Peak level, from 0 to 1.
波形Waveform正弦波The tone's shape.
取樣率整數44100Samples per second.

返回

音訊AudioBuffer

備註

A sweep is the standard test signal for a filter or an effect: every frequency passes through it once, so its spectrogram is a single rising line and anything the effect does to one part of the spectrum shows as a change in that line.

所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
資料流 函數 事件 例程 藍圖 狀態機狀態
宣告於
生成
所屬包
音訊處理

音調

函數

A steady tone of one pitch.

簽名
音調 -> AudioBuffer
    頻率: 數字
    時長: 數字
    振幅: 數字
    波形: Waveform
    取樣率: 整數
AudioBuffer Tone(
    double frequency = 440,
    double duration = 1,
    double amplitude = 0.5,
    Waveform waveform = Waveform.Sine,
    int sampleRate = 44100)

參數

名稱型別預設值說明
頻率數字440Pitch, in hertz. 440 is the A above middle C.
時長數字1Length, in seconds.
振幅數字0.5Peak level, from 0 (silent) to 1 (full scale).
波形Waveform正弦波Sine is pure; square, triangle and saw add harmonics and sound brighter.
取樣率整數44100Samples per second.

返回

音訊AudioBuffer
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
資料流 函數 事件 例程 藍圖 狀態機狀態
宣告於
生成
所屬包
音訊處理