MIDI import only detects overlaps from same start time (rather than same end time also)
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
Start by running the reproduction snippet on the attached repro-src.mid and comparing repro-exported.mid against it. The title points at MIDI import detecting overlaps by shared start time but not shared end time, so check how tied notes are grouped when a bass note joins the chord. Done means the exported file holds the C3/E5 chord through beat one of measure 2 without re-attacking it, and the single-track case matches the multi-track workaround.
由索引模型根据 Issue 内容生成。
描述
music21 version
9.9.1
Operating System(s) checked
macOS 26.2
Problem summary
In some cases, importing then re-exporting a MIDI file with a note tied across a measure causes the note to repeat.
Steps to reproduce
from music21 import *
f = converter.parse('repro-src.mid')
f.write('midi', "repro-exported.mid")
Where:
repro-src.midis a MIDI type 1 file with a single track, rendering this:
Expected vs. actual behavior
- Expected: The exported MIDI file represents the same musical intention as the source--that is, the C3/E5 chord is held through the first beat of the 2nd measure.
- Actual: The exported MIDI file doesn't tie the C3/E5 chord, but rather plays it again at the beginning of the measure, as if it was written:
More information
I've tried multiple variations of this and found a few different behaviors that all seem to be related, but I'm not sure what the actual expected behavior should be given the structure of the source MIDI. Is my program required to "clean up" or parse the MIDI file into separate tracks somehow before having music21 export it?
- If you
show()the file, the score looks even different from the exported MIDI: it plays the A4 notes in series with the C3/E5 chord, not simultaneously
- If I edit the MIDI file to have the E5 and the A4 notes on one track, and the C3 on a second track (e.g., export the C3 onto a bass clef), everything works as expected. The exported file has 3 tracks, with the E5 and A4 notes on track 2, and the C3 on track 3.
- If I remove the C3 note so that only the E5 is tied, the export works as expected. It seems like something about adding the bottom note is causing the midi export to be wonky. (Note however that in this case,
show()still renders the A4 notes in series with the E5, rather than simultaneously with it.)
- The MIDI files in question are mechanically generated, so there shouldn't be any question of duration variance causing problems.
I've attached the source and exported MIDI files for context.
- 主要语言
- Python
- 星标
- 2.6k
- 派生
- 459
- 平均合并
- 1 天 1 小时
- 30 天内合并 PR
- 42
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
cuthbertLab/music21 的其他 Issue
-
enhancement
难度 2/5 1-3 小时 新手友好度 68/100
cuthbertLab/music21#2088 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
cuthbertLab/music21#2084 ·
维护者通常 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 于 18 天前认领,目前没有进行中的 PR。 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
cuthbertLab/music21#2019 · 3 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
cuthbertLab/music21#1714 ·
维护者通常 1 天内回复
查看 cuthbertLab/music21 的全部 Issue
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 72/100
slavakurilyak/awesome-ai-agents#845 ·
维护者通常 1 天内回复
-
tests: pin that the atomic writers in utils/paths.py stage the temporary file in the target's directory可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭difficulty:2 enhancement good first issue
难度 1/5 1-3 小时 新手友好度 92/100
MakazhanAlpamys/Soup#2178 ·
维护者通常 1 天内回复
-
[BUG] dcg.waggr permutation p-values are folded twice, so near-zero scores get the smallest p-values未关闭
难度 2/5 1-3 小时 新手友好度 75/100
scverse/rapids-singlecell#854 ·
维护者通常 1 天内回复
-
Slang input: int8_t4_packed and uint8_t4_packed are copied into CrossGL可能已有人在做 @ninglinLiu 今天认领。 未关闭area:frontend backend:slang bug direction:input
难度 2/5 1-3 小时 新手友好度 70/100
维护者通常 1 天内回复
-
random_elements(unique=True) on an OrderedDict: ZeroDivisionError once only zero weights remain, AssertionError with use_weighting=False可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 13 天内回复