元編程參考文件

音樂渲染

14 個節點

本頁內容 14

Default Sample Rate

函數

The rate everything renders at unless asked otherwise.

簽名
DefaultSampleRate() -> 整數
int DefaultSampleRate()

返回

結果整數
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
資料流 函數 事件 例程 藍圖 狀態機狀態
宣告於
音樂渲染
所屬包
音樂

Music Styles

函數

The styles Render Generated Music composes in.

簽名
MusicStyles() -> 文字陣列
string[] MusicStyles()

返回

Styles文字陣列
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
資料流 函數 事件 例程 藍圖 狀態機狀態
宣告於
音樂渲染
所屬包
音樂

渲染生成音樂

函數

Composes a piece in a style and renders it through a SoundFont.

簽名
渲染生成音樂 -> AudioBuffer
    風格: 文字
    長度: MusicLength
    種子: 整數
    秒數: 數字
    音色庫: Sound Font Bank
    取樣率: 整數
AudioBuffer RenderGeneratedMusic(
    string style = "Cinematic",
    MusicLength length = MusicLength.Short,
    int seed = 1,
    double seconds = 0,
    SoundFontBank soundFont,
    int sampleRate = 44100)

參數

名稱型別預設值說明
風格文字CinematicA style from Music Styles, such as Cinematic, BattleDrive or Ambient.
長度MusicLengthShortThe shape: a stinger, a short piece, a full song, or a seamless loop.
種子整數1Which piece; the same seed always composes the same one.
秒數數字0About how long it should run; zero lets the style decide.
音色庫Sound Font Bank—The font; the default General MIDI one when not connected.
取樣率整數44100Output rate.

返回

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

渲染 MIDI

函數

Renders a MIDI document built in the graph through a SoundFont.

簽名
渲染 MIDI -> AudioBuffer
    MIDI: MidiDocument
    音色庫: Sound Font Bank
    尾音: 數字
    取樣率: 整數
AudioBuffer RenderMidi(
    MidiDocument midi,
    SoundFontBank soundFont,
    double tail = 2,
    int sampleRate = 44100)

參數

名稱型別預設值說明
MIDIMidiDocument—The document.
音色庫Sound Font Bank—The font; the default General MIDI one when not connected.
尾音數字2Seconds rendered after the last event.
取樣率整數44100Output rate.

返回

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

渲染 MIDI 位元組

函數

Renders a Standard MIDI File already in memory through a SoundFont.

簽名
渲染 MIDI 位元組 -> AudioBuffer
    位元組: 位元組陣列
    音色庫: Sound Font Bank
    尾音: 數字
    取樣率: 整數
AudioBuffer RenderMidiBytes(
    byte[] bytes,
    SoundFontBank soundFont,
    double tail = 2,
    int sampleRate = 44100)

參數

名稱型別預設值說明
位元組位元組陣列—The whole .mid file.
音色庫Sound Font Bank—The font; the default General MIDI one when not connected.
尾音數字2Seconds rendered after the last event.
取樣率整數44100Output rate.

返回

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

用 FM 晶片渲染 MIDI

函數

Renders a MIDI document built in the graph on an emulated OPL FM chip.

簽名
用 FM 晶片渲染 MIDI -> AudioBuffer
    MIDI: MidiDocument
    晶片: OplChipType
    取樣率: 整數
AudioBuffer RenderMidiDocumentOnFm(
    MidiDocument midi,
    OplChipType chip = OplChipType.Opl3,
    int sampleRate = 44100)

參數

名稱型別預設值說明
MIDIMidiDocument—The document.
晶片OplChipTypeOpl3OPL2 (mono) or OPL3 (stereo).
取樣率整數44100Output rate.

返回

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

渲染 MIDI 檔案

函數

Renders a Standard MIDI File through a SoundFont.

簽名
渲染 MIDI 檔案 -> AudioBuffer
    路徑: 文字
    音色庫: Sound Font Bank
    尾音: 數字
    取樣率: 整數
AudioBuffer RenderMidiFile(
    string path,
    SoundFontBank soundFont,
    double tail = 2,
    int sampleRate = 44100)

參數

名稱型別預設值說明
路徑文字—A .mid file.
音色庫Sound Font Bank—The font; the default General MIDI one when not connected.
尾音數字2Seconds rendered after the last event, so the last notes ring out.
取樣率整數44100Output rate.

返回

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

用 FM 渲染 MIDI

函數

Renders a Standard MIDI File on an emulated Yamaha OPL FM chip - the sound of 1990s PC games - with its General MIDI instrument bank. Nothing is sampled: every note is two sine-wave operators, one modulating the other.

簽名
用 FM 渲染 MIDI -> AudioBuffer
    位元組: 位元組陣列
    晶片: OplChipType
    取樣率: 整數
AudioBuffer RenderMidiOnFm(
    byte[] bytes,
    OplChipType chip = OplChipType.Opl3,
    int sampleRate = 44100)

參數

名稱型別預設值說明
位元組位元組陣列—The whole .mid file.
晶片OplChipTypeOpl3OPL2 (nine voices, mono) or OPL3 (eighteen voices, stereo).
取樣率整數44100Output rate.

返回

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

渲染音樂

函數

Renders music written with the Euterpea nodes through a SoundFont: every instrument it names, drums on the General MIDI kit.

簽名
渲染音樂 -> AudioBuffer
    音樂: Music
    音色庫: Sound Font Bank
    每分鐘拍數: 數字
    尾音: 數字
    取樣率: 整數
AudioBuffer RenderMusic(
    Music music,
    SoundFontBank soundFont,
    double beatsPerMinute = 120,
    double tail = 2,
    int sampleRate = 44100)

參數

名稱型別預設值說明
音樂Music—The music.
音色庫Sound Font Bank—The font; the default General MIDI one when not connected.
每分鐘拍數數字120Quarter notes a minute; a Tempo node inside the music speeds its part further.
尾音數字2Seconds rendered after the last note, so it rings out.
取樣率整數44100Output rate.

返回

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

用 FM 渲染音樂

函數

Renders music written with the Euterpea nodes on an emulated OPL FM chip.

簽名
用 FM 渲染音樂 -> AudioBuffer
    音樂: Music
    每分鐘拍數: 數字
    晶片: OplChipType
    取樣率: 整數
AudioBuffer RenderMusicOnFm(
    Music music,
    double beatsPerMinute = 120,
    OplChipType chip = OplChipType.Opl3,
    int sampleRate = 44100)

參數

名稱型別預設值說明
音樂Music—The music.
每分鐘拍數數字120Quarter notes a minute.
晶片OplChipTypeOpl3OPL2 (mono) or OPL3 (stereo).
取樣率整數44100Output rate.

返回

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

渲染音符

函數

One note played on one SoundFont preset: pressed, held, then released and left to ring.

簽名
渲染音符 -> AudioBuffer
    音色庫: Sound Font Bank
    音色號: 整數
    鍵: 整數
    力度: 整數
    時長: 數字
    釋音: 數字
    音色組: 整數
    取樣率: 整數
AudioBuffer RenderNote(
    SoundFontBank soundFont,
    int program = 0,
    int key = 60,
    int velocity = 100,
    double duration = 1,
    double release = 1,
    int bank = 0,
    int sampleRate = 44100)

參數

名稱型別預設值說明
音色庫Sound Font Bank—The font; the default General MIDI one when not connected.
音色號整數0The instrument: 0 is the piano, 24 nylon guitar, 40 violin, 56 trumpet, 73 flute in General MIDI. For a drum kit, the kit.
鍵整數60MIDI key: 60 is middle C, 69 the A above it. For a drum kit the key is the drum: 36 kick, 38 snare, 42 closed hi-hat.
力度整數100How hard the key is struck, 1 to 127.
時長數字1Seconds the key is held.
釋音數字1Seconds rendered after it is let go.
音色組整數00 for melodic sounds, 128 for drum kits.
取樣率整數44100Output rate.

返回

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

渲染預設音符

函數

One note played on a preset found with Find Preset or Presets.

簽名
渲染預設音符 -> AudioBuffer
    預設: Sound Font Preset
    音色庫: Sound Font Bank
    鍵: 整數
    力度: 整數
    時長: 數字
    釋音: 數字
AudioBuffer RenderPresetNote(
    SoundFontPreset preset,
    SoundFontBank soundFont,
    int key = 60,
    int velocity = 100,
    double duration = 1,
    double release = 1)

參數

名稱型別預設值說明
預設Sound Font Preset—The preset to play.
音色庫Sound Font Bank—The font the preset belongs to; the default one when not connected.
鍵整數60MIDI key, 60 is middle C.
力度整數100How hard the key is struck, 1 to 127.
時長數字1Seconds the key is held.
釋音數字1Seconds rendered after it is let go.

返回

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

渲染樂譜

函數

Renders a score sheet through a SoundFont: every part on its instrument, drums on the drum channel, vocal samples mixed in where the score places them.

簽名
渲染樂譜 -> AudioBuffer
    樂譜: Musical Score
    音色庫: Sound Font Bank
    取樣率: 整數
AudioBuffer RenderScore(
    FScoreSheet score,
    SoundFontBank soundFont,
    int sampleRate = 44100)

參數

名稱型別預設值說明
樂譜Musical Score—The score, from Parse.
音色庫Sound Font Bank—The font; the default General MIDI one when not connected.
取樣率整數44100Output rate.

返回

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

渲染樂譜文字

函數

Renders a score written in Cantus numbered notation, such as [C C G G] [A A G/2], through a SoundFont.

簽名
渲染樂譜文字 -> AudioBuffer
    樂譜: 文字
    音色庫: Sound Font Bank
    取樣率: 整數
AudioBuffer RenderScoreText(
    string score = "[C C G G] [A A G/2] [F F E E] [D D C/2]",
    SoundFontBank soundFont,
    int sampleRate = 44100)

參數

名稱型別預設值說明
樂譜文字[C C G G] [A A G/2] [F F E E] [D D C/2]The score text.
音色庫Sound Font Bank—The font; the default General MIDI one when not connected.
取樣率整數44100Output rate.

返回

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