From 297778864c4c9eee725eeb2cae47f10bcb7b455b Mon Sep 17 00:00:00 2001 From: zagatozee <33841901+zagatozee@users.noreply.github.com> Date: Thu, 4 Jun 2026 18:25:47 +0100 Subject: [PATCH] Add staff attribute to note representation Par tof the LH/RH seperation future schema (cherry picked from commit 56ad235a1ad4875527abb69836bcace79fdadfdc) --- lib/gp2rs.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/gp2rs.py b/lib/gp2rs.py index f9d9768..c0f1b7c 100644 --- a/lib/gp2rs.py +++ b/lib/gp2rs.py @@ -69,6 +69,7 @@ class RsNote: tremolo: bool = False tap: bool = False link_next: bool = False + staff: int = -1 # Piano staff: -1=absent, 0=LH/bass clef, 1=RH/treble clef @dataclass @@ -1021,6 +1022,8 @@ def _build_xml( "tap": "1" if n.tap else "0", "ignore": "0", } + if getattr(n, 'staff', -1) != -1: + attrs["staff"] = str(n.staff) ET.SubElement(notes_el, "note", **attrs) # Chords