paulrosen / abcjs

javascript for rendering abc music notation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The triangle note head appears one note up

alensiljak opened this issue · comments

Hi! I've just been writing the Weinberg notation example in ABC and noticed that the cowbell appears one note up. This seems to happen because the triangle note head is rendered a bit higher.
It should be rendered lower so that it fits the space of the note it is used on (i.e. d vs e).

Below is an example of using notes e and d with and without the triangle note head:

image

In ABC syntax the example above is:

%abc
%%percmap ^e  cowbell          triangle
%%percmap ^d  cowbell          triangle
L:1/4
K: perc
e ^e d ^d

And here's the original snip from the Weinberg's article:
image

Yes, the origin of the triangle in the SVG is too high, and should be fixed in the JS.
In the meantime, I did a little patch in CSS. The keyboard codes in the percmap table are inserted into the svg element, so I used these in selectors in the <style> part of my HTML, thus:
path[data-name="^e"]
, path[data-name="^B"]
, path[data-name="^c"]
, path[data-name="^d"]
, path[data-name="^a"]
{ transform: translateY(3px); /* push triangles 3px down */ }

This will be fixed in v6.2.4