I use the track to play noteOn / noteOff events, and everything works as planned, the problem I am facing is that I would like to change the tools that are used in the track.
I came up with the following code, which is designed to invoke the βprogram changeβ command on all MIDI channels with a new instrument, the problem I am facing is how to apply this to the track so that the instruments are 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 saw that you can send the PROGRAM_CHANGE event to the track to show that the tool is changing, but I'm not sure how to do this to create an object to store the necessary information and add it to the Track. Many thanks.
source share