As an amateur programmer using Delphi 10.2 I am "working" on a program to clarify the many different scales (dromoi) of greek music.
From a tabulature file I have created a midi-file.
Starting with some basis bytes including header, track, meta-events for key- and time-signature, I build the melody from my tabulature-file (notes + duration).
I would like to be able to change instrument in the midi-file. I have read that this is done by a "Program Change" midi-event coded by Cx + instrument hex value (where x is channel. So what I did was to put these two bytes C0 18 in the end of my basisbytes (after the meta-events) to change to a nylon string guitar.
Unfortunately this does not work. Where do I place the to Program Change bytes? Are they not correct? (I guess that the default channel is zero).