question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Dynamic coloring / getting SVG of notes of a chord

See original GitHub issue

Based on the description found in https://github.com/opensheetmusicdisplay/opensheetmusicdisplay/wiki/Exploring-the-Demo and using the SVG version (getSVGGElement()) so as not to not have to re-render.

I am storing the NoteToGraphicalNoteObjectId for each note and I get different IDs for each notehead within the chord.

However when I use: osmd.EngravingRules.NoteToGraphicalNoteMap.getValue(gId)getSVGGElement(); I get the pointer to the same vf-stavenote for the diffent noteheads.

How can I figure out which notehead is the appropriate one?

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
rvilarlcommented, Oct 1, 2022

Thanks I meant in OSMD. And as said, I will make a PR in VexFlow to easily access the different SVGElements.

0reactions
sschmidTUcommented, Oct 1, 2022

Actually this might be a very useful function, and you might be the second person to ask about it 😃 so maybe we’ll also implement it in OSMD for vexflow 1.2.93. (though it will be great to have it naturally in vexflow 4, so thanks!)

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to use SVG with Dynamic colors in React Native
How to use SVG with Dynamic colors in React Native. Dynamically Change SVG fill color. What is SVG? Scalable Vector ...
Read more >
Creating a smooth color legend with an SVG gradient
Legends are very important in data visualization and in this blog I'll show you how to create a color legend for a gradually...
Read more >
Plug-in Developer's Notebook: The Colored Notehead Style ...
In this post about colored notehead styles, Bob describes his process working around Sibelius's limitations in order to create a way to color...
Read more >
Fills and Strokes - SVG: Scalable Vector Graphics | MDN
Basic coloring can be done by setting two attributes on the node: fill and stroke . Using fill sets the color inside the...
Read more >
chord encoding tutorial | VHV documentation
A tutorial on how to encode chords in **kern data. ... Rhythms and articulations of each note should be duplicated, but not slurs,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found