vexflow icon indicating copy to clipboard operation
vexflow copied to clipboard

Articulation positions

Open amitgur opened this issue 8 years ago • 4 comments

Look at the marccato positioning done by finale 1

Now the vexflow way 2

  1. Any way I can place the marccato out of the staff as Finale is positioning it?
  2. Any way to get the marccato with straight lines and not curved?

amitgur avatar Jul 28 '17 04:07 amitgur

@mscuthbert which one is the right one. Now that I have been modifying the formatting of Articulations I think it would be easy to get the finale result.

rvilarl avatar Feb 05 '22 06:02 rvilarl

Articulations are broken into groups: those that fit into a line space, and those that don't. The definitions are here: Tables.articulationCodes(this.type);.

So you could change the value in that table. You could also make an 'options' to articulation that let you override the default.

Ideally though, you'd have the actual height of the glyph determine it. We could add a metric for it that varies by font, rather than have the lookup in a static table. I see the finale accents are just bigger in that finale font, which is true of Petaluma, so I think that would make the most sense. Petaluma accents look a little sloppy stuffed into the lines.

If an articulation does fit between the lines, as in this case, I think you'd want to put it there I'll check BB when I'm near a device, to see what the recommendation is, but that is what every piece of music in my house seems to do.

Also according to music I've seen, the stem side articulations are always above/below the staff. The decision is only done when the articulation is by the note head.

AaronDavidNewman avatar Feb 05 '22 18:02 AaronDavidNewman

@AaronDavidNewman thanks for the explanation. BB makes a recommendation to have articulations outside the stave but then it provides examples with them inside. :p

rvilarl avatar Feb 05 '22 18:02 rvilarl

@AaronDavidNewman I was thinking in something like (but I will look into Tables.articulationCodes:

      if (articulation.getPosition() === ABOVE) {
        let noteLine = note.getLineNumber(true);
        if (stemDirection === Stem.UP) {
          noteLine += stemHeight;
        }
+        state.top_text_line = Math.max(noteLine + state.top_text_line, 5) - noteLine;
        let increment = getIncrement(articulation, state.top_text_line, ABOVE);
        const curTop = noteLine + state.top_text_line + 0.5;
        // If articulation must be above stave, add lines between note and stave top
        if (!articulation.articulation.between_lines && curTop < lines) {
          increment += lines - curTop;
        }
        articulation.setTextLine(state.top_text_line);
        state.top_text_line += increment;
      } else if (articulation.getPosition() === BELOW) {
        let noteLine = Math.max(lines - note.getLineNumber(), 0);
        if (stemDirection === Stem.DOWN) {
          noteLine += stemHeight;
        }
+        state.text_line = Math.max(noteLine + state.text_line, 5) - noteLine;
        let increment = getIncrement(articulation, state.text_line, BELOW);
        const curBottom = noteLine + state.text_line + 0.5;
        // if articulation must be below stave, add lines from note to stave bottom
        if (!articulation.articulation.between_lines && curBottom < lines) {
          increment += lines - curBottom;
        }
        articulation.setTextLine(state.text_line);
        state.text_line += increment;
      }

And you get: Articulation Articulation___Accent_Tenuto Bravura_current

rvilarl avatar Feb 05 '22 18:02 rvilarl

Look at the marccato positioning done by finale

1

Now the vexflow way

2

  1. Any way I can place the marccato out of the staff as Finale is positioning it?

Articulation.setBetweenLines(false) will provide The finale positioning.

  1. Any way to get the marccato with straight lines and not curved?

The constructor of Articulation allows now to specify the Glyph code.

rvilarl avatar Dec 24 '22 11:12 rvilarl

Thanks for getting this done! And I believe that bravura uses marcato signs that are bigger than gonville (too small) but smaller than this Finale font (Maestro? Too big).

mscuthbert avatar Dec 27 '22 07:12 mscuthbert

@mscuthbert I believe that this is a glyph mapping issue that I decided not to fix in order to keep the differences small. If you look into the source OTF Gonville-18_20200703.otf with for example FontForge, you will see that we are using Glyph E1B0 which is classified as arrow head and not E100 which is classified as forzato. The same applies to marcatos, they should use E10B rather than the arrow heads.

rvilarl avatar Dec 27 '22 07:12 rvilarl