Closed Rajon010 closed 2 years ago
Percussion isn't currently supported in MIDI output.
We can patch this with a pull-request but since it's not likely to happen soon, I'll close it, since additional percussion support is on the tracking items.
I can take a look at this for v8, since we've made a lot of progress with Unpitched
and PercussionChord
recently.
I'm wondering what is the right way to write percussion to midi files.
My code:
from music21 import *
myScore = stream.Score()
percussionPart = stream.Part()
pm = midi.percussion.PercussionMapper()
percussionPart.append(pm.midiPitchToInstrument(36))
myScore.insert(0, percussionPart)
myScore.write('midi', fp='lalala.midi')
always runs into the error:
midi.base.py: WARNING: Conversion error for <MidiEvent PROGRAM_CHANGE, t=0, track=1, channel=1>: Got incorrect data for <MidiEvent PROGRAM_CHANGE, t=0, track=1, channel=1> in .data: None,cannot parse Program Change; ignored.
How can I assign channel 10 (for percussion) of midi to notes in the percussion part or the percussion part itself?