Closed petepm closed 7 years ago
Pete,
Yes, the way to specify the instrument is via the program change event (documented here). Two things to keep in mind:
The synthesizer you're connecting to has to be able to map the program number you choose to the sound you want. Usually this is done via the General MIDI specification. So, for example, a wood block would be program number 116.
MIDIUtil is zero-origin, whereas most instruments lists start at 1. Thus, to specify instrument 116, you would actually use 115 in the function call, ie.:
MIDIFile.addProgramChange(track, channel, time, 115)
Many soft-synths understand the general MIDI mapping, but if yours doesn't you can choose any program change number you want, but you'll have to program the synth to play the wood block when it receives a program change for that number.
Thanks very much for your help!
No problem. If you have other questions, feel free to ask!
I'm looking to create a MIDI file that will serve as a click track, so selecting the General MIDI woodblock would be useful.