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

Changing accent position #981

Open
jagrg opened this issue Dec 27, 2023 · 4 comments
Open

Changing accent position #981

jagrg opened this issue Dec 27, 2023 · 4 comments

Comments

@jagrg
Copy link

jagrg commented Dec 27, 2023

Hi, how can I add all accents above the notes with stem set to up?

X:1
M:4/4
L:1/8
V:1 stem=up
K:C perc
%%stretchlast
Lc2 c2 c2 z2 | Lc2 z2 c2 z2 |
@paulrosen
Copy link
Owner

That's not possible directly. You have two choices that I can think of: you can use a different accent or you can do some post-processing programming. So, if it is acceptable to use marcato instead of the accent, you could write !^! instead of L.

Or, if this is for your own website where you can run javascript, you could find those marks after the fact and move them. That could look weird if there isn't room for them already, but you could do something like:

abcjs.renderAbc("paper", abcString, { add_classes: true})`
const accents = document.querySelectorAll('[data-name="scripts.sforzato"]')
accents.forEach(accent => {
  const d = accent.getAttribute("d")
  // d will contain something like "M 71.25 57.792c 0.06 -0.03 0.15 etc..."
  // change the second number to change where the vertical placement is.
})

@jagrg
Copy link
Author

jagrg commented Jan 8, 2024

I don't want to use a different symbol and I wasn't able to get your second solution to work. The accent is always placed at the top left corner with a line connected to the note. Do you have any plans of adding this feature? AFAIK this common practice in the percussion literature. Thanks!

@paulrosen
Copy link
Owner

I looked around and I don't see any syntax already existing for specifying this. I can create a parameter, something like:

renderAbc("paper", abcString, { accentsAbove: true })

I'm going to be doing a small release soon and I'll see if I can add that.

In the meantime - are you using chord symbols? If not, you could specify it as " >". (Notice the extra space before the greater than sign.)

@jagrg
Copy link
Author

jagrg commented Apr 30, 2024

Looks reasonable. Were you able to push those changes?

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

2 participants