Anonymous
Unregistered
|
|
Wonderful article
|
Jeff Friesen
Unregistered
|
|
Thanks. I'm glad you enjoyed it.
Jeff
|
Anonymous
Unregistered
|
|
Hi,
I found your Javano article while trying to figure out how to show a list of Midi instruments. While I know how it's supposed to work, my synth's default soundbank is always null and the synth's Loaded and Available instrument arrays are always empty (yes, I open the synth first).
I tried your entire javano app just to see if maybe there was some trick that I kept missing, but even your code throws an NPE when loading all instruments (because the default soundbank is null).
Do you know of any way to get the instrument list when the default soundbank is null? BTW, I can play midi events just fine (I use a midi sequencer in my app).
Thanks, -Rick
|
Jeff Friesen
Unregistered
|
|
Hi Rick,
Unless you've already done this, you might want to invoke javax.sound.midi.Synthesizer's public Soundbank getDefaultSoundbank() method, which returns null if there is no default sound bank. If null returns, I would assume that there is something seriously wrong with your MIDI system.
According to the getDefaultSoundbank() documentation, "If a synthesizer doesn't have a default soundbank, instruments must be loaded explicitly from an external soundbank." I found a Website with the source code to a program that loads a soundbank from an external file -- if you can find such a file on the Net, perhaps this can help you. The program source file is LoadSoundBank.java, and it is available from http://www.jsresources.org/examples/LoadSoundbank.html.
Hope this helps.
Jeff
|