我使用的默认合成器的音库包含各种不同的乐器。例如,这段代码片段...
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)