DDMAL / Neon

A web-based MEI neume editor.
https://ddmal.music.mcgill.ca/Neon
MIT License
25 stars 9 forks source link

If a staff is tilted, inserted glyphs do not go where you click #1158

Closed JoyfulGen closed 11 months ago

JoyfulGen commented 11 months ago

This one took a while to track down, but @PhoebeDM and @annamorphism figured it out! I'm just the messenger. Here is a demo:

https://github.com/DDMAL/Neon/assets/83373378/e14c584d-f590-49a5-b2d6-7834885cbf6a

We can't be sure, but we suspect that the problem is that when the user tilts the staff and inserts a glyph, Neon does the following:

  1. Calculate the pitch of the new glyph based on where the staff used to be.
  2. Add the glyph on the tilted staff based on the calculated pitch.

Because of this, glyphs are not added where the user clicks, but higher if the staff is tilted up, and lower if it's tilted down. We don't get staves as tilted as in my extreme example, but we do often need to increase the staff tilt enough that this issue causes problems.

@yinanazhou would it be possible to make it so that a glyph is inserted where the user clicks and then pitch is calculated from there while accounting for the staff tilt, instead of the other way around?

yinanazhou commented 11 months ago

Hi @JoyfulGen I've pushed the changes.

JoyfulGen commented 11 months ago

@yinanazhou, fixed!! Issue can be closed now :)