MIDIBus: extending Advanced MIDIMessageIO to handle MIDI Patch Change output

Have been generating data which I map & output as MIDI controller change data with TheMIDIBus, no problem.

I now want to output Patch Change data, which out the box TheMIDIBus doesn’t appear to handle.

In the MIDIBus Advanced MIDIMessageIO example it looks like some byte values might be used to get the output to be a PC value.

Have been also looking through regular javax.sound.midi documentation which is completely over my head.

Also tried resources such as

very little of which makes sense to me.

Anyone who laughs at a bit of raw java got any clue here?