元编程参考文档

乐器

8 个节点

本页内容 8

FM 乐器

函数

A General MIDI voice on an emulated OPL FM chip.

签名
FM 乐器 -> Instrument
    乐器: General Midi Instrument
    芯片: OplChipType
Instrument FmInstrument(
    GeneralMidiInstrument instrument = GeneralMidiInstrument.AcousticGrandPiano,
    OplChipType chip = OplChipType.Opl3)

参数

名称类型默认值说明
乐器General Midi InstrumentAcoustic grand pianoWhich voice.
芯片OplChipTypeOpl3OPL2 or OPL3.

返回

乐器Instrument
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
乐器
所属包
音乐

演奏声部

函数

Music played on one instrument, whatever instruments it names: a part, ready for the mixer.

签名
演奏声部 -> AudioBuffer
    音乐: Music
    乐器: Instrument
    每分钟拍数: 数字
    尾音: 数字
    采样率: 整数
AudioBuffer PlayPart(
    Music music,
    Instrument instrument,
    double beatsPerMinute = 120,
    double tail = 1,
    int sampleRate = 44100)

参数

名称类型默认值说明
音乐Music—The part.
乐器Instrument—What plays it.
每分钟拍数数字120Quarter notes a minute.
尾音数字1Seconds after the last note.
采样率整数44100Output rate.

返回

音频AudioBuffer
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
乐器
所属包
音乐

拨弦乐器

函数

A plucked string: each note a burst of noise ringing at its pitch, dying away high harmonics first, damped when the key lifts.

签名
拨弦乐器 -> Instrument
    衰减: 数字
    亮度: 数字
    释音: 数字
    增益: 数字
Instrument PluckedInstrument(
    double decay = 3,
    double brightness = 0.6,
    double release = 0.08,
    double gain = 0.6)

参数

名称类型默认值说明
衰减数字3Seconds for a held note to fall 60 dB.
亮度数字0.60 to 1: a soft finger to a hard pick; louder notes are brighter.
释音数字0.08Seconds a lifted note takes to be damped.
增益数字0.6The voice's level.

返回

乐器Instrument
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
乐器
所属包
音乐

预设乐器

函数

Any preset of a SoundFont - another bank's variation, or a drum kit, which plays by key.

签名
预设乐器 -> Instrument
    预设: Sound Font Preset
    音色库: Sound Font Bank
Instrument PresetInstrument(
    SoundFontPreset preset,
    SoundFontBank soundFont)

参数

名称类型默认值说明
预设Sound Font Preset—The preset, from Presets or Find Preset.
音色库Sound Font Bank—The font it belongs to; the default when not connected.

返回

乐器Instrument
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
乐器
所属包
音乐

采样器乐器

函数

A recording played at every pitch: the root note at its own speed, the rest faster or slower.

签名
采样器乐器 -> Instrument
    采样: AudioBuffer
    根音: 文本
    起音: 数字
    释音: 数字
    循环: 真否
Instrument SamplerInstrument(
    AudioBuffer sample,
    string rootNote = "C4",
    double attack = 0.002,
    double release = 0.1,
    bool loop = false)

参数

名称类型默认值说明
采样AudioBuffer—The recording.
根音文本C4The note it sounds at, such as C4.
起音数字0.002Seconds to fade in.
释音数字0.1Seconds to fade out after each note.
循环真否FalseWhether a long note loops the recording.

返回

乐器Instrument
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
乐器
所属包
音乐

音色库乐器

函数

A General MIDI instrument from a SoundFont.

签名
音色库乐器 -> Instrument
    乐器: General Midi Instrument
    音色库: Sound Font Bank
Instrument SoundFontInstrument(
    GeneralMidiInstrument instrument = GeneralMidiInstrument.AcousticGrandPiano,
    SoundFontBank soundFont)

参数

名称类型默认值说明
乐器General Midi InstrumentAcoustic grand pianoWhich instrument.
音色库Sound Font Bank—The font; the default General MIDI one when not connected.

返回

乐器Instrument
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
乐器
所属包
音乐

合成器乐器

函数

A subtractive synthesizer: detuned band-limited oscillators through a resonant ladder filter that the envelope opens.

签名
合成器乐器 -> Instrument
    波形: Oscillator Shape
    失谐: 数字
    截止频率: 数字
    共振: 数字
    滤波包络: 数字
    起音: 数字
    衰减: 数字
    延音: 数字
    释音: 数字
    增益: 数字
Instrument SynthInstrument(
    OscillatorShape shape = OscillatorShape.Saw,
    double detune = 8,
    double cutoff = 600,
    double resonance = 0.3,
    double filterEnvelope = 2400,
    double attack = 0.005,
    double decay = 0.25,
    double sustain = 0.5,
    double release = 0.2,
    double gain = 0.4)

参数

名称类型默认值说明
波形Oscillator ShapeSawThe oscillators' waveform.
失谐数字8Cents between the two oscillators; 0 for one.
截止频率数字600The filter's resting cutoff, hertz.
共振数字0.30 to 1.
滤波包络数字2400Hertz the envelope opens the filter by.
起音数字0.005Seconds to rise.
衰减数字0.25Seconds to settle.
延音数字0.5The level held, 0 to 1.
释音数字0.2Seconds to die away.
增益数字0.4The voice's level.

返回

乐器Instrument
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
乐器
所属包
音乐

波表乐器

函数

A wavetable synthesizer: each note plays the table at its pitch while the envelope sweeps the position, so the timbre moves as the note sounds.

签名
波表乐器 -> Instrument
    波表: Wavetable
    位置: 数字
    扫描: 数字
    截止频率: 数字
    起音: 数字
    衰减: 数字
    延音: 数字
    释音: 数字
    增益: 数字
Instrument WavetableInstrument(
    Wavetable table,
    double position = 0,
    double sweep = 0.6,
    double cutoff = 6000,
    double attack = 0.01,
    double decay = 0.4,
    double sustain = 0.6,
    double release = 0.3,
    double gain = 0.4)

参数

名称类型默认值说明
波表Wavetable—The waves; sine, triangle, saw and square when not connected.
位置数字0Where across the waves a note rests, 0 to 1.
扫描数字0.6How far the envelope moves the position at its peak.
截止频率数字6000The lowpass cutoff, hertz.
起音数字0.01Seconds to rise.
衰减数字0.4Seconds to settle.
延音数字0.6The level held, 0 to 1.
释音数字0.3Seconds to die away.
增益数字0.4The voice's level.

返回

乐器Instrument
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
乐器
所属包
音乐