You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
p = stream.Part()
p.insert(instrument.Instrument())
p.write('midi')
Traceback
Traceback (most recent call last):
File "/Users/jwalls/music21/music21/midi/translate.py", line 2533, in streamToMidiFile
midiTracks = streamHierarchyToMidiTracks(s,
File "/Users/jwalls/music21/music21/midi/translate.py", line 2420, in streamHierarchyToMidiTracks
updatePacketStorageWithChannelInfo(packetStorage, channelByInstrument)
File "/Users/jwalls/music21/music21/midi/translate.py", line 2357, in updatePacketStorageWithChannelInfo
initCh = channelByInstrument[instObj.midiProgram]
KeyError: None
More information
Only a problem if there are no notes.
I think we assume parts with no notes are Conductor tracks. Simple fix.
Noticed responding to a m21 list thread May 2021.
The text was updated successfully, but these errors were encountered:
jacobtylerwalls
changed the title
Stream without notes containing generic Instrument crashes when writing MIDI
Stream with instrument but no notes crashes when writing MIDI
May 11, 2021
music21 version
dev
Steps to reproduce
Traceback
More information
Only a problem if there are no notes.
I think we assume parts with no notes are Conductor tracks. Simple fix.
Noticed responding to a m21 list thread May 2021.
The text was updated successfully, but these errors were encountered: