python - 在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
解决方案
这在以后的版本中得到了修复。最新版本是 6.7.1。
推荐阅读
- python - 获取多只股票昨天的收盘价
- proxy - 是否可以升级 Registry 智能合约?
- angular - Angular:在弹出窗口中显示组件
- javascript - 尝试加载 Chrome 配置文件时 Puppeteer “无法移动 ShaderCache”
- reactjs - 如何使 div 仅可从一小部分拖动?
- python - 查看以前的时间序列
- java - Java bean 实例化方法
- angular - 如何自动生成通用 Angular 文件?
- javascript - 您可以或应该使用委托(函数指针)吗?
- qt - Windows 上的 Qt 部署错误 0xc0000007b