元編程參考文件

樂器

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
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
資料流 函數 事件 例程 藍圖 狀態機狀態
宣告於
樂器
所屬包
音樂