antscloud / fretboardgtr

Python package for creating fretboard and chord diagram image in svg format
GNU Affero General Public License v3.0
112 stars 17 forks source link

show intervals of fingerings #27

Open brusand opened 10 months ago

brusand commented 10 months ago

Describe the bug A clear and concise description of what the bug is. add a fingering and with display_in_degee = True and display the note name To Reproduce Steps to reproduce the behavior:

config = {
    "general": {
        "first_fret": 0,
        "last_fret": 24,
        "show_tuning": False,
        "show_frets": True,
        "show_note_name": False,
        "show_degree_name": True,
        "open_color_scale": True,
        "fretted_color_scale": True,
        "fretted_colors": {
            "root": "rgb(255,255,255)",
        },
        "open_colors": {
            "root": "rgb(255,255,255)",
        },
        "enharmonic": True,
    },
    "background": {"color": "rgb(0,0,50)", "opacity": 0.4},
    "frets": {"color": "rgb(150,150,150)"},
    "fret_numbers": {"color": "rgb(150,150,150)", "fontsize": 20, "fontweight": "bold"},
    "strings": {"color": "rgb(200,200,200)", "width": 2},
}

fretboard_config = FretBoardConfig.from_dict(config)
fretboard = FretBoard(config=fretboard_config)
c_major = [0, 3, 2, 0, 1, 0]
fretboard.add_fingering(c_major)
fretboard.export("my_custom_fretboard.svg", format="svg")

Expected behavior A clear and concise description of what you expected to happen. i want the interval value of the note in the chord Screenshots If applicable, add screenshots to help explain your problem.

antscloud commented 10 months ago

Hi, i'm sorry i don't get it, doesn't show_degree_name=True do exactly what you describe ?

brusand commented 9 months ago

chords_fretboard no it doesn t work . it display the note name not the degree of the note. i think in the new api of add_fingering, the root param had disapeared so you can t set interval. def add_fingering(self, fingering: List[Optional[int]]) -> None: ` config = { "general": { "first_fret": 0, "last_fret": 16, "fret_width": 50, "show_note_name": False, "show_degree_name": True, } } fretboard_config = FretBoardConfig.from_dict(config) fretboard = FretBoard(config=fretboard_config) c_major = [0, 3, 2, 0, 1, 0]

fretboard.add_fingering(c_major)
fretboard.export("chords_fretboard.svg", format="svg")`
antscloud commented 9 months ago

Hi, thank for the details, are you currently using the latest version ? As of the current version 0.2.5 the signature of the add_fingering method contains the root parameter https://github.com/antscloud/fretboardgtr/blob/05d7300c13ee20b7b5480d30f6a9d2a9eb3fab19/fretboardgtr/fretboard.py#L281-L283

brusand commented 9 months ago

i have the version 0.2.7 of fretboardgtr and i have root parameter in add_fingering, how to install your fretboardgtr lib ?

brusand commented 9 months ago

s (from rlPyCairo<1,>=0.2.0->reportlab<=4->fretboardgtr) (1.25.1) Installing collected packages: fretboardgtr Successfully installed fretboardgtr-0.2.7