Skip to content

[Bug] Lilypond export writes invalid note names for octave 0 notes and extraneous spaces for octaves 1 and 2 #9698

Open

Description

@codedbyanup

Description

When exporting a project containing notes in octave 0 (such as A0, B♭0, or B0 from standard piano keyboard range) to LilyPond via "Save as Lilypond", the pitch converter does not recognize octave 0. It outputs invalid strings like a04 instead of sub-contra pitch marks (a,,,4). LilyPond fails compilation with a syntax error upon encountering a0.

Additionally, octaves 1 and 2 insert an extra space (c,, 4 and c, 4) between the pitch and note duration, unlike octaves 3 through 10.

Expected Behavior

  • Octave 0 notes should export with sub-contra octave marks (3 commas: ,,,), e.g., A0 with duration 4 becomes a,,,4.
  • Octave 1 and 2 notes should export without extraneous trailing spaces before the duration number (c,,4 and c,4).
  • Generated .ly files compile cleanly in LilyPond.

Screenshots

N/A

How to Reproduce

  1. Create a project with a note block set to pitch A0 (octave 0) with quarter-note duration.
  2. Add notes at octaves C1, C2, and C3.
  3. Export to LilyPond ("Save as Lilypond").
  4. Inspect the generated notes in the .ly file: notice a04 c,, 4 c, 4 c4.

Console log Errors:

When compiling the generated file with LilyPond:

error: syntax error, unexpected UNSIGNED, expecting NOTENAME_PITCH or TONICNAME_PITCH or ']'
a04

Environment:

  • Operating System: Windows / Linux / macOS
  • Version of Software/Project: master (v3.8.0)

Checklist

  • I have read and followed the project's code of conduct.
  • I have searched for similar issues before creating this one.
  • I have provided all the necessary information to understand and reproduce the issue.
  • I am willing to contribute to the resolution of this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions