小编TNT*_*TNT的帖子

MIDI - MidiMessage 程序随不同银行的乐器而变化

我使用的默认合成器的音库包含各种不同的乐器。例如,这段代码片段...

Synthesizer synthesizer = MidiSystem.getSynthesizer();
synthesizer.open();
Instrument instruments = synthesizer.getDefaultSoundbank().getInstruments();
for (Instrument i : instruments)
    System.out.println(i);
Run Code Online (Sandbox Code Playgroud)

...打印以下内容:

Instrument: Piano 1      bank #0 preset #0
Instrument: Piano 2      bank #0 preset #1
[...]
Instrument: Applause     bank #0 preset #126
Instrument: Gun Shot     bank #0 preset #127
Instrument: SynthBass101 bank #128 preset #38
Instrument: Trombone 2   bank #128 preset #57
[...]
Instrument: Machine Gun  bank #128 preset #127
Instrument: Echo Pan     bank #256 preset #102
Instrument: String Slap  bank #256 preset #120 …
Run Code Online (Sandbox Code Playgroud)

java midi midi-instrument

0
推荐指数
1
解决办法
3033
查看次数

标签 统计

java ×1

midi ×1

midi-instrument ×1