MIDI import: makeTies()/makeMeasures() permanently desyncs later note offsets by whole bars when simultaneous notes of different length collide
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
Start by reproducing the supplied MIDI example with mido and music21.converter.parse(..., quantizePost=False), then trace midiTrackToStream and its makeMeasures()/makeTies() processing. Compare the resulting note offsets with the raw MIDI event timing; done means the final note lands at offset 12.0 rather than 16.0 and later offsets remain synchronized.
由索引模型根据 Issue 内容生成。
描述
music21 version: 10.5.0
MIDI import permanently desyncs note offsets by one bar once a short tied note ends while a longer tied note is still sounding — every later note shifts one bar late from there on. Seen on real orchestral MIDI, inflating a track's measure count.
Minimal reproduction
import mido, music21
t = 480
mid = mido.MidiFile(ticks_per_beat=t, type=1)
trk = mido.MidiTrack(); mid.tracks.append(trk)
M = mido.Message
trk.extend([
M('note_on', note=58, velocity=100, time=0),
M('note_on', note=62, velocity=100, time=0),
M('note_on', note=55, velocity=100, time=0),
M('note_off', note=58, velocity=0, time=t*8),
M('note_off', note=62, velocity=0, time=0),
M('note_off', note=55, velocity=0, time=t*4),
M('note_on', note=60, velocity=100, time=0),
M('note_off', note=60, velocity=0, time=t),
])
mid.save('repro.mid')
raw = music21.converter.parse('repro.mid', quantizePost=False)
for n in sorted(raw.flatten().notes, key=lambda x: x.offset):
print(n.offset, n.quarterLength, n.tie)
Last note should land at offset 12.0; it lands at 16.0:
0.0 4.0 <Tie start>
0.0 4.0 <Tie start>
8.0 4.0 <Tie stop>
8.0 4.0 <Tie continue>
12.0 4.0 <Tie stop>
16.0 1.0 None
Workaround: cross-check against a raw mido decode and rebuild when it disagrees; real fix likely belongs in midiTrackToStream's makeMeasures()/makeTies().
- 主要语言
- Python
- 星标
- 2.6k
- 派生
- 459
- 平均合并
- 1 天 7 小时
- 30 天内合并 PR
- 40
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
cuthbertLab/music21 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
cuthbertLab/music21#2084 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 75/100
cuthbertLab/music21#2082 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
cuthbertLab/music21#2074 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
cuthbertLab/music21#2055 · 3 条评论 ·
维护者通常 1 天内回复
-
Slur bezier-x/y from start element gets overwritten by stop element's values可能重新可做 @bingliscodes 于 9 天前认领,目前没有进行中的 PR。 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
cuthbertLab/music21#2019 · 3 条评论 ·
维护者通常 1 天内回复
查看 cuthbertLab/music21 的全部 Issue
相似的 Issue
-
python triage
难度 2/5 1-3 小时 新手友好度 72/100
microsoft/semantic-kernel#14615 ·
维护者通常 3 天内回复
-
难度 2/5 1-3 小时 新手友好度 65/100
-
bug
难度 2/5 1-3 小时 新手友好度 74/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
shackett/shackett-utils#19 ·
-
难度 2/5 1-3 小时 新手友好度 72/100
UKGovernmentBEIS/control-arena#917 ·
维护者通常 1 天内回复