Skip to content

How do you put text next to notes (i.e. to the right of notes)? #1450

Discussion options

You must be logged in to vote

I was able to figure this out thanks to an idea posted by @sschmidTU in this discussion: #1424

Below is what I ended up doing. I would love to know if there is a better way. For now, I accomplished my goals. Thank you again for creating such a fantastic library.

// First draw the stave with it's voice/notes
trebleVoice.draw(renderContext, stave)

// In my case, I know there is only 1 tickable and I know it's a StaveNote
const staveNote = trebleVoice.getTickables()[0] as Vex.Flow.StaveNote
// @ts-ignore (getRightDisplacedHeadPx doesn't appear to be in the types)
const displacementPx = staveNote.getRightDisplacedHeadPx()

// Next, loop over note heads to get x/y coordinates
// This strateg…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by alindsay55661
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant