humdrum-tools / verovio-humdrum-viewer

Verovio Humdrum Viewer
http://verovio.humdrum.org
37 stars 9 forks source link

Subspine dynamcs #800

Open craigsapp opened 1 year ago

craigsapp commented 1 year ago

Prevent double display of dynamics in subspines:

**kern  **kern  **dynam
*staff2 *staff1 *staff1/2
=   =   =
*   *   *^
1c  1cc f   .
*   *   *v  *v
=   =   =
*-  *-  *-

Currently renders in verovio as:

Screenshot 2023-03-11 at 9 45 53 AM

Notes probably trigger dynamics markings, so the dynamic should keep track of if it was already processed to allow only one note from causing it to be displayed.

craigsapp commented 1 year ago

Here is a more complicated case:

Screenshot 2023-03-11 at 10 36 38 AM

The ff and mf dynamics are not duplicated (probably because they are in the right subspine). The other dynamics are incorrectly duplicated. The p and mp dynamics are duplicated, but the overstrike is exact.

Perhaps the left subspine should automatically be placed above the staves that they are attached to and the right subspine should automatically be placed below the staves they are attached to.

**kern  **kern      **dynam
*staff2 *staff1     *staff1/2
=   =       =
*   *       *^
1c  1cc     .   ff
1c  1cc     f   .
.   .       p   .
*   *^      *   *
1d  2dd 1e  pp  .
.   4b  .   .   mf
.   4cc .   mp  .
*   *v  *v  *   *
*   *       *v  *v
=   =       =
*-  *-      *-

Here are the converted dynamics:

<dynam xml:id="dynam-L5F4" place="between" staff="1 2" tstamp="1.000000">ff</dynam>
<dynam xml:id="dynam-L6F3" place="between" staff="1 2" tstamp="5.000000">f</dynam>
<dynam xml:id="dynam-L6F4" place="between" staff="1 2" tstamp="5.000000">f</dynam>
<dynam xml:id="dynam-L7F3" place="between" staff="1 2" tstamp="7.000000">p</dynam>
<dynam xml:id="dynam-L7F4" place="between" staff="1 2" tstamp="7.000000">p</dynam>
<dynam xml:id="dynam-L10F5" place="between" staff="1 2" tstamp="11.000000">mf</dynam>
<dynam xml:id="dynam-L11F4" place="between" staff="1 2" tstamp="12.000000">mp</dynam>
<dynam xml:id="dynam-L11F5" place="between" staff="1 2" tstamp="12.000000">mp</dynam>
<dynam xml:id="dynam-L9F4" place="between" staff="1 2" tstamp="9.000000">pp</dynam>
<dynam xml:id="dynam-L9F5" place="between" staff="1 2" tstamp="9.000000">pp</dynam>
craigsapp commented 1 year ago

Commit https://github.com/rism-digital/verovio/commit/a4f5d00af776869e6ca1666b2cf312b348462ecf fixes many problems (not checked with single staves, and not implemented for hairpins yet).

Rendering of current tests are now as expected:

Screenshot 2023-03-12 at 2 37 12 PM Screenshot 2023-03-12 at 2 38 13 PM