Change instrument on a track #396
-
I have initial midi file with its own track and instrument, my goal is to add new mid = MidiFile("input1.mid")
mid.add_track("new_track")
track = mid.tracks[-1]
# here I set the instrument to kalimba
track.append(Message('control_change', control=0, value=0x79, channel=0, time=0))
track.append(Message('control_change', control=32, value=0x00, channel=0, time=0))
track.append(Message('program_change', program=0x6c, channel=0, time=0))
# here goes code with adding notes to new_track |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Pretty sure your original file already uses the first channel. |
Beta Was this translation helpful? Give feedback.
Pretty sure your original file already uses the first channel.
If that's the case, it doesn't matter that the data is in a different track it will end up in the same place on your sound generator.
Maybe use a channel that is not already used in the file you're trying to modify?