Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Measure.rightBarline not being correctly set when appending bar.Repeat

オープン
#1,703 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
python
領域
backend

調査の方向性

The report points at Measure._getRightBarline(), which only checks _endElements, so start there and run the reproduction script to see which barline append() actually sets. Decide first whether an end-direction bar.Repeat appended to a measure should become its rightBarline, since the reporter flags that as unresolved. Done means m2.rightBarline returns the end repeat in the reproduction, with a regression test added.

索引モデルが issue の本文から書いたものです。

説明

music21 version

9.1.0

Problem summary
When appending an object like bar.Repeat(direction="end") to a measure object, the barline attributes of that measure object aren't being correctly set.

Steps to reproduce

>>> m1 = stream.Measure()
>>> m2 = stream.Measure()
>>> repeat_b = bar.Repeat(direction="start")
>>> repeat_e = bar.Repeat(direction="end")
>>> m1.append(repeat_b)
>>> m1.leftBarline
<music21.bar.Repeat direction=start>
>>> m1.rightBarline
>>> m2.append(repeat_e)
>>> m2.rightBarline
>>> m2.leftBarline
<music21.bar.Repeat direction=end>
>>> r1 = note.Rest("whole")
>>> r2 = note.Rest("whole")
>>> m1 = stream.Measure()
>>> m2 = stream.Measure()
>>> m1.append(repeat_b)
>>> m1.append(r1)
>>> m2.append(r2)
>>> m2.append(repeat_e)
>>> m1.leftBarline
<music21.bar.Repeat direction=start>
>>> m1.rightBarline
>>> m2.rightBarline
>>> m2.leftBarline
>>> 

Expected vs. actual behavior
When appending a bar.Repeat object with direction=="end" to a measure, the rightBarline attribute should receive it as its value. Instead, it sets leftBarline sometimes and not rightBarline.

OS is Linux Mint 21.2. I'd fix it myself, but I can't find where the attributes are being set when appending the bar.Repeat object. If anyone can help in that regard, that would be much appreciated.

Edit: Apparently this is because Measure._getRightBarline() only checks for elements of _endElements, and I'm assuming append() doesn't modify this attribute. Not sure if this is the intended behavior.

主要言語
Python
スター
2.6k
フォーク
459
平均マージ
1日 7時間
マージ済み PR(30日)
40

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

cuthbertLab/music21 のほかの issue

cuthbertLab/music21 の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。