Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Show chords" chords are not transposed #35

Open
dann-merlin opened this issue Jul 5, 2024 · 2 comments
Open

"Show chords" chords are not transposed #35

dann-merlin opened this issue Jul 5, 2024 · 2 comments

Comments

@dann-merlin
Copy link

When you transpose a chords, the way how you play the chords are not also transposed in the "Show chords" thingy.
I would consider this a bug. What do you think?

@kmille
Copy link
Owner

kmille commented Jul 6, 2024

Pull requests are welcome :)

@dann-merlin
Copy link
Author

Hm, looked into it a bit.
The transposed chords should obviously not just be shifted a bit. It should show the transposed chord, the way one would play it.

This is not easily doable with only JS. The way UG does it, is by sending a new request to the server and that way fetching the chord info for the transposed chords. This also means that the logic that is in ug.py:get_chord() right now, is implemented in javascript in UG.
I think the easiest way to do this with freetar's architecture would be to redirect to the same page, but with a ?transpose= parameter. Then the backend would fetch the transposed chords and serve the page with transposed chords. I'm not sure how easy it would be to scroll back to the same spot on the reload, but I think that should be possible, however that would still mean a page reload, which is kind of disruptive.

The alternative would be to have a get_chord endpoint on the backend, which serves either the raw json data of a chord for the client to parse, or it serves the html itself for the client to replace it.

I kind of prefer the "Client reads json from get_chord endpoint and changes the chordVisual html accordingly" method, but please tell me what you think, as this seems to require more than just small changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants