How Do I Add Note to Track with a Channel Number? #592
Unanswered
JeffRocchio
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am trying to add notes to a MIDI track in a mido.MidiFile. The pre-existing track I am trying to add notes to has all it's note on channel 1 (there are two tracks in the file, track-0 is using channel-0, track-1 is using channel-1 - the original file was exported from a score in Musescore).
The append method, with the 'note_on' message, only takes note, velocity and time. And the result of adding notes track-1 is that all my added notes then show up as having been assigned to channel-0.
So: How do I control which channel 'note_on' / 'note_off' get assigned to?
UPDATE on 7/27:
Update: I did find a workaround for this. I noticed there is a 'private' function on the mido.Message object that allows you to set a specific parameter of a message instance, so I am using that to set the channel parameter for my added notes. When I do this everything seems to now work OK in terms of my modified .mid file playing ok in MIDI players.
fwiw, below is the source from the function where I am adding my notes:
Beta Was this translation helpful? Give feedback.
All reactions