Slur bezier-x/y from start element gets overwritten by stop element's values
维护者通常 1 天内回复
@bingliscodes 已经在做这个了。
开始于 2026年10月6日。
评估
调研方向
The issue points to xmlNotationsToSpanners in musicxml/xmlToM21.py and setStyleAttributes. Read how start and stop <slur> elements route their bezier attributes, then check the slur style fields for the separate bezierX2/bezierY2 slots. Add or run a regression test using the provided MusicXML example; done means both elements’ values are preserved in their respective slots.
由索引模型根据 Issue 内容生成。
描述
When a slur has bezier control points on both its start and stop elements in MusicXML, parsing only keeps the stop element's values, the start element's bezier-x/bezier-y get silently overwritten instead of landing in the (separately named) bezierX2/bezierY2 slots.
Repro:
import music21
xml = '''<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE score-partwise PUBLIC "-//Recordare//DTD MusicXML 4.0 Partwise//EN" "http://www.musicxml.org/dtds/partwise.dtd">
<score-partwise version="4.0">
<part-list><score-part id="P1"><part-name>Music</part-name></score-part></part-list>
<part id="P1">
<measure number="1">
<attributes>
<divisions>1</divisions>
<time><beats>2</beats><beat-type>4</beat-type></time>
<clef><sign>G</sign><line>2</line></clef>
</attributes>
<note>
<pitch><step>C</step><octave>5</octave></pitch>
<duration>1</duration><type>quarter</type>
<notations><slur number="1" type="start" bezier-x="11" bezier-y="-22"/></notations>
</note>
<note>
<pitch><step>D</step><octave>5</octave></pitch>
<duration>1</duration><type>quarter</type>
<notations><slur number="1" type="stop" bezier-x="-33" bezier-y="44"/></notations>
</note>
</measure>
</part>
</score-partwise>'''
slur = music21.converter.parse(xml, format="musicxml").recurse().getElementsByClass(music21.spanner.Slur)[0]
print(slur.style.bezierX, slur.style.bezierY) # -33 44 -- should be 11 -22, the START tag's own values
Looks like it's coming from xmlNotationsToSpanners in musicxml/xmlToM21.py, it calls setStyleAttributes once per element found, writing into bezierX/bezierY regardless of whether the element is the start or the stop tag, so whichever one gets processed second wins. The bezier-x2/bezier-y2 attribute names exist and would land in the right slot, but nothing ever routes the stop element's own bezier attributes there.
- 主要语言
- 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 天内回复
-
难度 2/5 1-3 小时 新手友好度 74/100
cuthbertLab/music21#1986 · 1 条评论 ·
维护者通常 1 天内回复
查看 cuthbertLab/music21 的全部 Issue
相似的 Issue
-
Workflow.schedule stops when a cron deadline passes before sleep可能已有人在做 @HuaTNA 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
[Bug] HiveDialect shares its colspecs dict with SQLAlchemy's DefaultDialect (python/pyhive)可能已有人在做 @rusackas 今天认领。 未关闭
难度 1/5 1 小时以内 新手友好度 80/100
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 80/100
维护者通常 1 天内回复
-
[20.0] hr_work_entry: Duration column of Export Time Entries is truncated to whole hours可能已有人在做 @odooaktiv 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
fix formatting of the sample database page of the docs可能已有人在做 @Aaqibhafeezkhan 今天认领。 未关闭documentation good first issue help wanted
难度 1/5 1 小时以内 新手友好度 72/100
chaoss/CollectOSS#544 · 1 条评论 ·
维护者通常 1 天内回复