Hello,
I am using a track to play my noteOn/noteOff events and everything works as intended, the problem I am having is that I would like to change the instruments that is being used within the track.
I've come up with the following code which is designed invoke the "program change" command on all the MIDI channels with the new instrument, the problem I am having is working out how to apply this to the track so the instruments is different.
public void LoadInstrument() { for(int i = 0; i < instruments.length; i++) { if(instruments[i].getName() == "Clean Guitar") { instrumentToLoad = instruments[i]; } } drumPatch = instrumentToLoad.getPatch(); }
I've seen that you can send the Track a PROGRAM_CHANGE event to signify the instrument is changing but I'm not sure how to go about creating the object to hold the necessary information and adding it to the Track.
Many Thanks.