Open EricDuminil opened 1 year ago
It will be a great feature to add :+1: , thank you a lot for the effort and the time spent !
We maybe need to add another function name to this feature as the fingering also handle the "no" or "mute" string (the X
in the diagram). Also if we want in the future to add the barre chords with a new element like for example a rounded rectangle the function may do too much things. What do you think ?
The refactoring is mostly done. There may still be small changes because there is some duplication of code that I couldn't remove (I may have use a wrong abstraction) between the vertical
and horizontal
fretboard.
Thanks for the feedback.
Yes, muting strings already work (e.g. first_position = [None, [5, 7], [5, 7], [5, 7], [5, 8], [5, 8]]
), but the naming could probably be improved.
I have no idea how the API could look like for barres. Possibly define the fingering in multiple steps?
I'll first look at the new structure from refactoring branch, and try to integrate multiple notes per string.
It now can be done with the following example
from fretboardgtr.fretboard import FretBoard
A_MINOR_SCALE_POSITION = [[None], [5, 7], [5, 7], [5, 7], [5, 8], [5, 8]]
fretboard = FretBoard()
fretboard.add_scale(A_MINOR_SCALE_POSITION, root="A")
fretboard.export("my_fretboard.svg", format="svg")
However, I have no idea how to implement the barres as we have to define a new shape like a rectangle with rounded edges. It could be complex
As mentioned in the README's todo-list:
Here's an example code:
And the desired output:
The current master fails with
TypeError: '>' not supported between instances of 'list' and 'int'
.Just as an example, this feature has been implemented in https://github.com/EricDuminil/fretboardgtr/tree/experimental/multiple_fingering
It's just a proof-of-concept, and not yet an official Pull Request.
Once you're done with the
refactoring
branch, and if you're interested, I'd be happy to integrate https://github.com/EricDuminil/fretboardgtr/blob/experimental/multiple_fingering/fretboardgtr/fingering.py