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

Keyboard braille: extractHeading passes a KeySignature where a TimeSignature is expected (isinstance tested on the container)

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

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

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

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
74/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
静か
技術スタック
python
領域
backend

調査の方向性

braille/segment.py の BrailleGrandSegment.extractHeading を読み、SIGNATURE 分岐を追ってください。issue では、失敗するケースは KeySignature のみを含むグループ化として特定されています。まず、説明されている2パートのキーボード譜の再現ケースを braille.translate.keyboardPartsToBraille 経由で実行するか構築してください。そのケースが報告された AttributeError なしで点訳されれば完了です。関連する handleArticulations の警告経路も調査対象として挙げられています。

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

説明

Environment: music21 10.5.0, Python 3.14, macOS.

Summary: BrailleGrandSegment.extractHeading (braille/segment.py, the SIGNATURE branch) tests isinstance on the grouping container instead of the element:

try:
    keySignature, timeSignature = useElement[0], useElement[1]
except IndexError:
    if isinstance(useElement, key.KeySignature):   # container, never true
        keySignature = useElement[0]
    else:
        timeSignature = useElement[0]              # a lone KeySignature lands here

useElement is a grouping (list-like), never a KeySignature, so a mid-piece key change with no simultaneous meter change (a SIGNATURE grouping holding only a KeySignature) falls into the else, is passed to transcribeSignatures, which reads m21TimeSignature.symbol (braille/basic.py) → AttributeError: 'KeySignature' object has no attribute 'symbol', aborting the transcription.

Fix sketch: test the element rather than the container: isinstance(useElement[0], key.KeySignature).

Reproduction sketch: a two-part keyboard score with a key change (no meter change) at an interior measure, transcribed via braille.translate.keyboardPartsToBraille.

Related, found while tracing: the warning path of handleArticulations (braille/basic.py) references music21Note.editorial.fingering, which does not exist — the except branch itself raises AttributeError when a fingering fails to transcribe.

主要言語
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 を短くまとめたダイジェスト。