- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 307
Added a reference to GraphicalNote
from Note
#659
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
Added a reference to GraphicalNote
from Note
#659
Conversation
Hey, i basically answered this in a new issue in #660. |
How does this PR going? 👀 |
@Jack-Works As i said, we do not want a direct reference to graphical classes in our sheet model classes, but hopefully #660 will get resolved and then you will have a way to find a GraphicalNote from a Note that is almost as easy as a reference in Note. |
@praisethemoon this is a great feature, when you design an interactive sheet music app. @sschmidTU this library is a bridge layer between Maybe we can add a With @praisethemoon 's change, we can access HTML element from the note data happily like this.
If we dig the code deeper, I think there is no reason for |
After rethinking, maybe we just need to add a This can solve many ui interaction problems. |
@ice6 thanks for your comments here also. |
After more digging, I found that @matt-uib it is ok to use dictionary to solve the problem. and the final api is clean. If it is already implemented, I would not discuss here. :P |
@ice6 AJAX is used in OpenSheetMusicDisplay.ts:load() to retrieve a MusicXML file asynchronously from a website. |
@sschmidTU sure, I know. just from the architecture perspective. below is the code I use to retrieve file by url, it provides more flexibility some time.
|
There is now the static See #660. |
There is an even easier method now: |
Hello!
I believe that this tiny change would really prove usefull as it is strongly related to #549 in the sense that it would be easier to get the graphical note object from, for example cursor using
osmd.cursor.iterator.currentVoiceEntries[0].notes[0].graphicalNote.getSVGGElement().id
which is more convinient than fetching it fromosmd.GraphicSheet.MeasureList[0][0].staffEntries[0].graphicalVoiceEntries[0].notes[0]
. If there is something that already exists and solves this problem, please let me know!For me this is the best way to hack into the low-level SVG generated objects to change their style, and I do hope you find it useful!
Cheers!