Skip to content

feat: built-in ChordPro (chopro/chordpro) lead-sheet rendering - #15

Closed
KnobeDev wants to merge 3 commits into
kpaede:masterfrom
KnobeDev:chordpro-leadsheets
Closed

KnobeDev wants to merge 3 commits into
kpaede:masterfrom
KnobeDev:chordpro-leadsheets

Conversation

@KnobeDev

@KnobeDev KnobeDev commented Jul 10, 2026 •

Copy link
Copy Markdown

Summary

Adds built-in ChordPro lead-sheet rendering to the plugin — chord-and-lyric sheets from chopro / chordpro code blocks, alongside the existing engraved notation. Two commits:

  1. Feature — a self-contained renderer (src/chordpro/chordProBlock.ts, no dependencies) registered as chopro/chordpro code-block processors in main.ts, plus lead-sheet styling in styles.css. It renders independently of the Verovio engraving engine (ChordPro carries no pitch/rhythm to engrave).
  2. Docs — a (NEW) ChordPro Lead Sheets README section (syntax + accessibility), and a credit under Additionally Used (With Many Thanks).

What it renders

```chopro
{title: Sweet Home Alabama}
{key: D}

[D]Big wheels keep on [C]turnin'
[G]Carry me home to see my [D]kin
```

Supports inline [chords], directives ({title:}, {key:}, {comment:}, arbitrary key: value), and labelled {start_of_chorus} / verse / bridge / tab sections.

Accessibility

Screen-reader-first: DOM order is chord-then-syllable (a reader hears "G chord, Carry me home to see my, D chord, kin"), chords carry an aria-label so Am isn't read as the word "am", the title is a heading, choruses/verses are labelled groups, and chords are set apart by weight + position — never colour alone (WCAG 1.4.1).

Credit

The renderer is an independent reimplementation — seeing ChordPro Viewer by jheddings is what sparked the idea, and it's built in this plugin's own way (no code shared). Because both claim the chopro/chordpro code-block languages, the README notes you'd disable one or the other. Credited in the README as a shout-out.

Notes

  • Contributed by jdhori.
  • Type-checks cleanly against the base (adds 0 new tsc errors).
  • Excludes version bumps and the built main.js bundle — those are the maintainer's call to rebuild/release.

AniYeah added 2 commits July 9, 2026 20:05
Adds a "(NEW) ChordPro Lead Sheets" section describing the integrated
chopro/chordpro code-block rendering, and credits jheddings' ChordPro
Viewer plugin (https://github.com/jheddings/obsidian-chopro) — whose
chopro/chordpro code-block convention the renderer follows — under
"Additionally Used (With Many Thanks)".

Contributed by jdhori.
Implements the feature the accompanying README section documents: a
self-contained ChordPro renderer (src/chordpro/chordProBlock.ts, no
dependencies) registered as `chopro`/`chordpro` code-block processors in
main.ts, with lead-sheet styles in styles.css. Renders chord-and-lyric
lead sheets independently of the Verovio engraving engine.

Screen-reader-first: chord-then-syllable DOM order, aria-labelled chords,
labelled verse/chorus groups, distinguished by weight + position (not
colour alone).

Independent reimplementation, inspired by jheddings' ChordPro Viewer
(https://github.com/jheddings/obsidian-chopro) — credited in the README.

Contributed by jdhori.
@KnobeDev KnobeDev changed the title docs: add (NEW) ChordPro lead sheets section + credit ChordPro Viewer feat: built-in ChordPro (chopro/chordpro) lead-sheet rendering Jul 10, 2026
Bump the patch version because chord names were not reliably announced by screen readers and proportional/wrapping tablature lost column alignment.

Use hidden readable chord text, monospace nonwrapping tablature, and keyboard-accessible horizontal scrolling. Add browser regressions and WCAG 2.1 A/AA axe checks in CI.

Validation: both browser tests pass; lint passes with test-harness warnings; production build passes. Live Obsidian screen-reader and dictation validation remains outstanding.
@kpaede

kpaede commented Oct 11, 2026

Copy link
Copy Markdown
Owner

Hi, thanks for the contribution!

I'm not entirely sure whether ChordPro rendering fits the scope of this plugin. Since it works independently of Verovio, it wouldn't benefit from most of the existing functionality, such as score editing, MEI conversion, MIDI playback, or interactive notation. It would basically be a separate plugin wrapped together with this one. I'm wondering whether this functionality might be better suited to a dedicated ChordPro plugin, especially since those already exist for Obsidian.

Could you share your thoughts on why you think this should be integrated this plugin? From a user's perspective, I think it would be quite confusing to suddenly have a different code block logic, especially when most of the features that make this plugin useful wouldn't be available with that format.

Of course, one could consider expanding the plugin to support all kinds of other formats and rendering systems. But the whole idea behind its current state is that (since it's using Verovio) everything is internally converted to MEI and managed through that common representation. That's what allows the different formats to benefit from the same features and workflows.

Introducing a separate rendering system that bypasses this architecture would basically break that and make the plugin less consistent overall. So while I appreciate the contribution, I'm not convinced that this approach fits the plugin's architecture and intended scope.

@kpaede kpaede closed this Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants