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

Is it possible to add numbered musical notation? #980

Open
hhaiwwww opened this issue Dec 21, 2023 · 7 comments
Open

Is it possible to add numbered musical notation? #980

hhaiwwww opened this issue Dec 21, 2023 · 7 comments

Comments

@hhaiwwww
Copy link

微信截图_20231221150359
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

@paulrosen
Copy link
Owner

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.

@hhaiwwww
Copy link
Author

I still don't quite understand. Will you improve this feature on your end

@cgzwyy
Copy link

cgzwyy commented May 23, 2024

i need this function too
how can i user abcjs to draw NMN

@sysescool
Copy link

sysescool commented May 30, 2024

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?

@sysescool
Copy link

@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:

  1. Should we retain the existing code notation (a, b, c, d, e, f) but render it in numbered musical notation?
  2. Is it preferable to introduce a new numbered code notation (1, 2, 3, 4, 5, 6) that is exclusively rendered as numbered musical notation?
  3. When considering a new numbered code notation (1, 2, 3, 4, 5, 6) alongside the original symbols, should both sets be capable of rendering as either Musical notation or Numbered musical notation?

Which approach would be more advantageous?

@paulrosen
Copy link
Owner

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.

@sysescool
Copy link

Thank you, I will try it today.

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

4 participants