Tuplet and Parenthesis Handling Issues in ABC converter (abcFormat)
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
Start in music21/abcFormat, where lastTupletToken is set and "Tuplet" is pushed onto self.activeParens, and trace how ABCParenStop pops that stack. Run the reproduction snippet from the issue and check that the slur closes after F and that G is not included. Done means the (C(3DEF)G example yields a slur over C, D, E, F only, with the tuplet timing unchanged.
索引モデルが issue の本文から書いたものです。
説明
music21 version
9.7.1
Operating System(s) checked
MacOS 15.5
Problem summary
Hi music21 developers! Thank you for maintaining such a great project!
While working with the ABC converter in music21/abcFormat, I noticed some issues related to how tuplets and parentheses (used for slurs and cresc./dim.) are handled. Here’s what I’ve found:
- ABC tuplet symbols like
(3are tokenized and applied to following notes via thelastTupletTokenvariable. However, at the same time, the string"Tuplet"is pushed onto theself.activeParensstack and only removed upon encountering anABCParenStoptoken. This is problematic because in ABC notation, tuplets are not structured like slurs—they don’t require a closing parenthesis. - Slur stops and crescendo/diminuendo stops are all tokenized as
ABCParenStop, without distinguishing their types. This could cause issues when these constructs appear in alternating patterns. One possible fix is to use separate token types and maintain separate stacks for each construct.
I’m happy to help address these issues! I actually have already done some work to support ABC v2.1 (like multi-voice and inline clef/key/meter change)—but I’m still refining it.
Additionally, the current ABC parsing logic is quite complex. Have we considered building on top of existing tools like abc2xml.py, which already provides a fairly complete ABC parser?
Steps to reproduce
Here is an example:
from music21 import converter
abc_str="""X:1
M:4/4
K:C
L:1/4
(C(3DEF)G|"""
score = converter.parse(abc_str)
score.show('text')
Expected vs. actual behavior
Actual behavior:
{0.0} <music21.metadata.Metadata object at 0x14a13ffee480>
{0.0} <music21.stream.Part 0x14a13fe47b30>
{0.0} <music21.clef.TrebleClef>
{0.0} <music21.key.Key of C major>
{0.0} <music21.meter.TimeSignature 4/4>
{0.0} <music21.spanner.Slur <music21.note.Note C><music21.note.Note D><music21.note.Note E><music21.note.Note F><music21.note.Note G>>
{0.0} <music21.note.Note C>
{1.0} <music21.note.Note D>
{1.6667} <music21.note.Note E>
{2.3333} <music21.note.Note F>
{3.0} <music21.note.Note G>
Expected behavior:
{0.0} <music21.metadata.Metadata object at 0x14a13ffee480>
{0.0} <music21.stream.Part 0x14a13fe47b30>
{0.0} <music21.clef.TrebleClef>
{0.0} <music21.key.Key of C major>
{0.0} <music21.meter.TimeSignature 4/4>
{0.0} <music21.spanner.Slur <music21.note.Note C><music21.note.Note D><music21.note.Note E><music21.note.Note F>>
{0.0} <music21.note.Note C>
{1.0} <music21.note.Note D>
{1.6667} <music21.note.Note E>
{2.3333} <music21.note.Note F>
{3.0} <music21.note.Note G>
The closing parenthesis) should end the slur that starts before C. However, due to interaction with the tuplet parsing, it incorrectly includes the note G in the slur.
More information
I’d be happy to help with:
- Introducing distinct close tokens and separate stacks for each construct (tuplets, slurs, etc.)
- Add new features to support ABC v2.1
- Refactoring or rewriting parts of the ABC parser to improve clarity and modularity if needed
- 主要言語
- Python
- スター
- 2.6k
- フォーク
- 459
- 平均マージ
- 1日 7時間
- マージ済み PR(30日)
- 40
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- 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 が 10 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
cuthbertLab/music21#2019 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
cuthbertLab/music21 の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
lidofinance/diffyscan#239 ·
メンテナーはふだん 1 日以内に返信
-
docs: the dev-setup table and AGENTS.md name the reviewed_by guard that CI's Changelog job runsオープンarea: tools documentation good first issue ready for a contributor
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
eyalgolan/statecraft-israel#873 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
GET rooms API returns 500 due to nonexistent Room.is_active attribute対応中かも @Mars-60 が今日担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 5 日以内に返信
-
Harmony OPeNDAP SubSetter (HOSS) Geographic production rssmif16d 7 XYZ_PROV
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
nasa/harmony-autotester#341 ·