SwiftyGuitarChords icon indicating copy to clipboard operation
SwiftyGuitarChords copied to clipboard

Data Clean

Open BeauNouvelle opened this issue 3 years ago • 7 comments

At the moment all chords are kept within a single file. This requires all of them to be initialized at once, and searching through this list can be slow on older hardware.

Ideally the data would be categorized into separate areas, or perhaps managed in an actual database. Until then, we can split the data into sections as follows:

Instrument > Key > Suffix

The reason for why this wasn't done before is that some users of the library may want to search based on a suffix, rather than the instrument. This definitely needs to be considered.

BeauNouvelle avatar Oct 09 '21 03:10 BeauNouvelle

I think as a first pass it'll be okay to sort the data into the suggested format. This will cover 90% of use cases. In the future, we can take a look at flattening it again into a dedicated database. The only other option would be to repeat the data in different formats.

BeauNouvelle avatar Oct 09 '21 03:10 BeauNouvelle

On the last day of October; here are my comments/suggestions.

First of all; the database should be manageable. I was missing 'G#' and find-out there was a 'Fb'. The are the same, but not realy. Just almost. Altered the JSON file to add it...

Of course not a very pleasant experience; hacking a file.

So, I wrote a quick and dirty macOS Ventura application to manage the database.

screenshot

https://github.com/Desbeers/Chords-Database

One step at the time.

Please have a read at the README.

Desbeers avatar Oct 31 '22 00:10 Desbeers

This is amazing and perfect for this project. wow! We should update the readme here to link to it.

Giving me more ideas too. I wonder if we should also add a way to play those midi sounds!

This is so cool.

BeauNouvelle avatar Oct 31 '22 08:10 BeauNouvelle

If you get the PR up for the addition of those chords, will gladly merge that in for you.

BeauNouvelle avatar Oct 31 '22 08:10 BeauNouvelle

Thanks, it was fun to make! The app is a bit rough and has a few extensions to SwiftyChords to get the job done. I would really like to have them in your package instead. Once it's a bit cleaner app I can send it as PR. Ideal, it should be part of your package instead of a separate item in another GitHub account.

It also gave me a few ideas:

  • Yes, play the midi sound, that would be cool!
  • Add the keys at the bottom of the diagram
  • Calculate the 'barres'? Then chord definitions are truly compatible with a ChordPro {define} and that can be used as unique ID

I send a PR with the first pits and pieces.

Desbeers avatar Oct 31 '22 13:10 Desbeers

It can play a chord with MIDi now, so cool!

It sounds a bit artificial, to be honest, but that's MIDI.... You can select your kind of 'instrument'; some are better than others...

Desbeers avatar Nov 05 '22 18:11 Desbeers

Excellent! I'll check it out!

BeauNouvelle avatar Nov 07 '22 05:11 BeauNouvelle