Desbeers / Chord-Provider

A ChordPro file parser and editor for macOS Sonoma. Show the song with the chords for guitar, guitalele or ukulele and export them to PDF.
https://desbeers.github.io/Chord-Provider/
GNU General Public License v3.0
69 stars 10 forks source link

Some fixes from previous pull request #10

Closed SaschaMzH closed 2 years ago

SaschaMzH commented 2 years ago

Fixed some parts of my previous pull request:

- The macOS target does not compile because it's missing your new ChordPosition extension file. The 'QLextension' is not part of the 'Target Membership'. Fixed by you. I have renamed the file in terms of a wording.

- If you use a 'custom chord', the base name will be used in the song view because 'major' is the default suffix in the 'processChord' function. It will always be found. That 'base chord' is also added to the chord list. The problem is that the custom defined chord was later defined than usage of that standard chord. There are two ways to solve that problem.

  1. Write the definition of a chord at the beginning.
  2. Parse the file in the first step to catch up all definitions and then parse the file line by line to use the custom chords instead of the standard chord.

How should this be working? What's you opinion?

- A 'custom define' will not override a default define; it will be added. It should override it in my opinion. Fixed

- When you click on a 'custom define' it will not find it and will show the 'C' chords instead, because that's the fallback (lazy code from my side, haha!). Fixed

- The first found chord is not used anymore as the key when the key is not set manually. What do you mean? I did not see the problem.

That's my test result

image

` {title: Chord Tests} {subtitle: Testing}

{define: Epower base-fret 5 frets x 3 2 3 1 x}

Bla [Epower]lalal [A]lala [C]dumdidum

{define: A base-fret 3 frets x 5 2 3 1 x} {define: Epower base-fret 5 frets 1 3 2 3 1 x} `

Desbeers commented 2 years ago

Custom Chords

  1. Write the definition of a chord at the beginning.
  2. Parse the file in the first step to catch up all definitions and then parse the file line by line to use the custom chords instead of the standard chord.

I prefer to go for option one; keep it simple. When you edit a song, with every keystroke, the file will be parsed. I made '#' ignored by the SongView; we might add a small introduction how Chord Provider deals with custom chords in the template when opening a new file.

As you wrote; you can 'redefine' a chord using the song.

The first found chord is not used anymore as the key when the key is not set manually

One of my 'magic tricks', haha! If there was no {key: [key]} defined, it used the first chord found. Saw you your issue about 'end_of_xxx' of course; this is of the same kind. Let's forget about it; the first chord doesn't have to be the key. A bit of 'magic' is great, but not this one...

ChordPosition extension

It would be great if this becomes a part of the 'Swifty Chords' package. He is open for pull requests and just merged my first one.