chordbook / chordbook

Chord sheets and tab for guitar and ukulele.
https://chordbook.app
MIT License
68 stars 13 forks source link

Support SongPro format #107

Open bkeepers opened 2 years ago

bkeepers commented 2 years ago

The SongPro format looks interesting. It'd be nice to support it as a file format and in the editor.

cc @spilth

spilth commented 2 years ago

Do you have a preference for how you'd like to specify/determine the format of a song that a user is providing?

A couple of options I can think of:

  1. Check for attributes set in either ChordPro or SongPro style in the source of a songsheet.
    • For example: {t: Losing My Religion } vs @title=Losing My Religion
    • It would probably be good to have a format attribute we manage internally to "cache" the answer of this whenever a Songsheet is created/updated.
  2. Make the user specify which format they are using via a dedicate form field.
    • For example, a select option or radio button selection
    • Requires more user work and potentially something they could get wrong.
bkeepers commented 2 years ago

There is currently a very rudimentary heuristic for deciding which parser to use that could be quickly added to, but there are a few caveats:

  1. Both the displaying of songsheets and editing currently assume a ChordSheetJS parser and directly use the returned Song model. So the new parser either needs to be implemented in ChordSheetJS, or some kind of new model is needed that both are convert into.
  2. The editor currently has logic to convert to chordpro on paste. There's nothing in the server-side storage that currently requires chordpro, so it wouldn't be difficult to support other formats as long as they can provide metadata.
  3. The editor has a mode for chordpro with snippets, chord completion, and metadata completion. It'd be nice to have the same features for SongPro.

So that first one is really the biggest lift.