【发布时间】:2023-04-05 08:48:01
【问题描述】:
我在尝试在 music21 工具包中组合顺序和并行和弦时注意到并出现问题。
ch = stream.Part([
stream.Measure([note.Rest(duration=duration.Duration(type='eighth'))]),
stream.Measure([note.Note('C4'), note.Note('F4')]),
stream.Measure([note.Rest(duration=duration.Duration(type='half'))]),
stream.Measure([chord.Chord([note.Note('C4'), note.Note('F4')], duration=duration.Duration(type='half'))])
])
当ch.write('musicxml.png) 时,上面的代码给了我正确的分数
但是当保存为 MIDI 时:ch.write('midi') 一次播放所有音符。 (我不能附加 MIDI,所以 hexdump)
00000000 4d 54 68 64 00 00 00 06 00 01 00 01 04 00 4d 54 |MThd..........MT|
00000010 72 6b 00 00 00 3f 00 ff 03 00 00 e0 00 40 00 90 |rk...?.......@..|
00000020 45 5a 00 90 42 5a 00 90 46 5a 00 90 45 5a 00 90 |EZ..BZ..FZ..EZ..|
00000030 42 5a 00 90 46 5a 88 00 80 45 00 00 80 42 00 00 |BZ..FZ...E...B..|
00000040 80 46 00 88 00 80 45 00 00 80 42 00 00 80 46 00 |.F....E...B...F.|
00000050 88 00 ff 2f 00 |.../.|
00000055
这是music21 中的错误吗?还是我搞砸了什么?
【问题讨论】: