Open hhaiwwww opened 8 months ago
ABCjs is great,I would like to add a notation display function that can be switched to display with the staff notation. I'm not sure if this feature is available
It would be possible to extend abcjs to do this, but it isn't available out of the box.
There is a way to run abc through the parser only without doing output. Then you have a structure you could step through to do your own drawing.
So, what I'd do:
const visualObj = abcjs.renderAbc("*", abcString)
Then write a function that steps through visualObj[0].lines
and writes the output.
I still don't quite understand. Will you improve this feature on your end
i need this function too how can i user abcjs to draw NMN
I need this function too. I'm using joplin, and which use abcjs. Staff (music) is hard to me, while numbered musical notation is easy.
May you make it is available out of the box?
@paulrosen I would like to incorporate numbered musical notation. Could you please assign this task to me? However, before I commence work on it, I have a few questions for discussion:
Which approach would be more advantageous?
According to the picture, there isn't anything in common with the drawing of standard notation so I think the way to handle it is probably to have a separate drawing function.
If you want to render any existing abc file as numbered notation I'd suggest the first option of retaining the existing code notation. Then you can do this:
const visualObj = abcjs.renderAbc("*", abcString)
to take advantage of the existing parser.
Then write a function with a signature something like this:
engraveNumbered(selector, visualObj[0])
That function would look for the element specified in selector
and create an <svg>
element in that. Then it would go through visualObj[0].lines
and convert the notes to numbers and insert them into the svg
.
In other words, you don't need to modify any of the existing abcjs code - just write your own function to extend it.
Thank you, I will try it today.