首页 > 解决方案 > 在music21中,我怎样才能让它不忽略速度标记?

问题描述

我在 music21 中生成乐谱,并通过显示乐谱并使用 stream.show('midi') 来查看乐谱。但我发现流中的 music21.tempo.MetronomeMark 对象被简单地忽略了。无论速度对象的值是多少,它都会以大概 120 bpm 的速度播放。

这是重现问题的简短示例:

import music21

tempo_test = music21.stream.Stream()
tempo_test.append(music21.tempo.MetronomeMark(number=20))
tempo_test.append(note.Note('C4', type='quarter'))
tempo_test.append(note.Note('F4', type='quarter'))
tempo_test.append(note.Note('B4', type='quarter'))
tempo_test.show('midi')

它以大约 120 bpm 的速度播放。(它也不播放第一个音符,这是一个不同的问题。)

如果我以不同的速度再做一次:

tempo_test = music21.stream.Stream()
tempo_test.append(music21.tempo.MetronomeMark(number=200))
tempo_test.append(note.Note('C4', type='quarter'))
tempo_test.append(note.Note('F4', type='quarter'))
tempo_test.append(note.Note('B4', type='quarter'))
tempo_test.show('midi')

节奏完全一样,大概是120。

我在 jupyter notebook 中工作,运行 python 3.6.13 和 music21 5.5.0

标签: pythonmusic21

解决方案


这在以后的版本中得到了修复。最新版本是 6.7.1。


推荐阅读