MusicXML import ignores `<sound tempo>` when the direction also has a `<metronome>`
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
Start in MeasureParser.xmlDirection, where a direction's sound is only passed to setSound when no metronome was already created. Run the reproduction script and check what numberSounding holds for the sound tempo="90" case. Done when that case yields (60, 90) and matching tempos don't add a redundant numberSounding. Comparing against getQuarterBPM() is the approach the issue suggests.
索引モデルが issue の本文から書いたものです。
説明
music21 version
10.5.0
Problem summary
When a <direction> has both a <metronome> and a <sound tempo>, the importer creates the MetronomeMark from the <metronome> and skips the <sound>. Usually the two agree, but they can differ: the metronome mark is what's printed, and <sound tempo> is the tempo for playback, for example a printed "♩ = 60" played at 90.
Steps to reproduce
from music21 import converter, tempo
xml = '''<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></attributes>
<direction>
<direction-type>
<metronome><beat-unit>quarter</beat-unit><per-minute>60</per-minute></metronome>
</direction-type>
<sound tempo="90"/>
</direction>
<note><pitch><step>C</step><octave>4</octave></pitch><duration>4</duration><type>whole</type></note>
</measure></part>
</score-partwise>'''
marks = converter.parse(xml, format='musicxml').flatten().getElementsByClass(tempo.MetronomeMark)
print([(mark.number, mark.numberSounding) for mark in marks])
Expected vs. actual behavior
Expected [(60, 90)], with the printed tempo as number and the playback tempo as numberSounding. Actual:
[(60, None)]
The 90 is lost.
More information
MeasureParser.xmlDirection only passes a direction's <sound> on to setSound if the direction didn't already have a <metronome>, to avoid making two MetronomeMarks.
<sound tempo> is always in quarter notes per minute, while <metronome> uses its own beat unit, so a dotted quarter = 60 with <sound tempo="90"/> agrees. A comparison would need to go through getQuarterBPM(), and numberSounding only needs setting when they really differ.
This matters most when <per-minute> isn't a plain number. It holds text, and scores often write "c. 60" or "60-72". Then the MetronomeMark has no number, even when exporters write the tempo in <sound tempo="60"/> right next to it:
<per-minute>c. 60</per-minute> with <sound tempo="60"/> → number None, getQuarterBPM() None
Reading <sound tempo> would give these marks a usable tempo.
- 主要言語
- 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 が 9 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
cuthbertLab/music21#2019 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
cuthbertLab/music21 の issue をすべて見る
似ている issue
-
area:core-platform effort:S priority:P3 status:in-review type:test
難易度 2/5 1時間未満 初心者へのやさしさ 80/100
randomparity/kdive#3246 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Requantification library converts m/z to mass with the hydrogen-atom mass instead of the proton massオープンbug
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
nf-core/metaboigniter#130 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
common-workflow-language/cwl-utils#477 ·
メンテナーはふだん 1 日以内に返信
-
Add dependabotオープンfeat
難易度 2/5 1時間未満 初心者へのやさしさ 72/100
open-nudge/opentemplate#204 ·
メンテナーはふだん 1 日以内に返信
-
github-stale-ci-pr-closer: KV state is double-wrapped, never persists, and hits the depth-32 limit対応中かも @VascoSch92 が今日担当しました。 オープンpriority:medium ready-for-dev
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
OpenHands/extensions#781 ·
メンテナーはふだん 1 日以内に返信