元编程参考文档

音乐渲染

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
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
音乐渲染
所属包
音乐