spilth / chord_diagrams

Generate SVGs for Guitar and Ukulele Chord Diagrams
https://rubygems.org/gems/chord_diagrams
MIT License
6 stars 1 forks source link

Generating fingerings dynamically #12

Open stufro opened 1 year ago

stufro commented 1 year ago

This is more of a discussion point. I was wondering if it would be possible to generate the fingerings dynamically rather than hard coding each chord/variant in the CSV file.

My thought process is that if we provided the list of variations (m, 7sus4) along with how those variations modify the root chord (flatten major third, flatten 7th and augment 4th) then we could modify the relevant fingerings from the root chord diagram.

I don't know, now I write it out it sounds like more of a long shot, but I'd be interested in your thoughts. I'll keep thinking it over...

stufro commented 1 year ago

I think this might have legs, I've been playing around in this repo and i've got it working for all chords A-G with the following variations, m, m7, maj7 sus4, sus2, dim, aug.

I think there's always going to be the need for hard coded special cases but you could cover of a couple hundred variations dynamically.

spilth commented 1 year ago

@stufro Hey Stuart. Sorry I didn't see your Issue earlier - for some reason I didn't get a notification about it.

I think your idea has legs! Funny enough I think the test suite would eventually look like the CSV in chord_diagrams :-)

I wonder if you could take it even a step further and just provide the number of strings and tuning of each string... and calculate which frets to play given any combination (though I suspect some might be physically difficult to play). This would allow you to also create Ukulele, Banjo and Mandolin chords from the same library.