humdrum-tools / verovio-humdrum-viewer

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

Link text and dynamics together #130

Open jacekiwaszko1 opened 6 years ago

jacekiwaszko1 commented 6 years ago

When dynamics and text directions are supposed to be placed together on the same line close to each other, such as:

p-espr1

Create a layout command to insert the text into the dynamic spine rather than a kern spine:

**kern  **kern  **dynam
*part1  *part1  *part1
*staff2 *staff1 *
*clefF4 *clefG2 *
*k[b-e-a-d-g-]  *k[b-e-a-d-g-]  *
*M6/4   *M6/4   *
*   *   *
!   !   !LO:TX:af:t=espr:
4r  (8bb-L  p
.   8ccc    .
4r  8ddd-   .
.   8aan    .
4r  8bb-    .
.   8gg-J   .
=1  =1  =1

The layout command is LO:TX:af:t=espr:

Where the parameter af means to place the text after the dynamic the layout command is associated with, and bf would mean before the attached dynamic.

jacekiwaszko1 commented 6 years ago

Here is an example of linked text being done at the same time as the dynamic is moved to a lower staff:

sempre-p-below

**kern  **kern  **dynam
*   *   *^
!   !   !   !LO:DY:b=2
!   !   !   !LO:TX:bf:t=sempre. 
8D-L    [1.ff^ [>1.dd-  fz  p
*   *   *v  *v
8A- .   .
8d- .   .
8A- .   .
8D- .   .
(8AAnJ  .   .
8D-L    .   .
8An .   .
8d-)    .   .
8A  .   .
8D- .   .
8AA-XJ  .   .
*-  *-  *-
craigsapp commented 6 years ago

Dependent on question https://github.com/music-encoding/music-encoding/issues/540

craigsapp commented 4 years ago

Example target encoding:

**kern  **kern  **dynam
*   *   *^
!   !   !   !LO:DY:b=2
!   !   !   !LO:DY:t=sempre. %s 
8D-L    [1.ff^ [>1.dd-  fz  p
*   *   *v  *v
8A- .   .
8d- .   .
8A- .   .
8D- .   .
(8AAnJ  .   .
8D-L    .   .
8An .   .
8d-)    .   .
8A  .   .
8D- .   .
8AA-XJ  .   .
*-  *-  *-

Where %s is the dynamic which will be placed within the string. This makes it easier to insert the dynamic into the middle of text as well.

And

**kern  **kern  **dynam
*part1  *part1  *part1
*staff2 *staff1 *
*clefF4 *clefG2 *
*k[b-e-a-d-g-]  *k[b-e-a-d-g-]  *
*M6/4   *M6/4   *
*   *   *
!   !   !LO:DY:t=%s espr:
4r  (8bb-L  p
.   8ccc    .
4r  8ddd-   .
.   8aan    .
4r  8bb-    .
.   8gg-J   .
=1  =1  =1

The default style will be Roman, add :i: if italic or :B: for bold. Also, the default position is determined by the dynamic (which is usually placed below the staff).

craigsapp commented 4 years ago

Partial implementation in commit https://github.com/rism-ch/verovio/commit/176907531c7f10ddf6f697fc1d49ae13dbd156a8

Limitation is that the text will only be displayed currently in italics.

Example:

**kern  **dynam
*M4/4   *
=1  =1
!   !LO:DY:i:t=sempre %s
4c  pp
4d  .
4e  .
4f  .
=   =
4g  .
4a  .
4b  .
4cc .
=   =
*-  *-
Screen Shot 2020-08-15 at 10 40 10 PM

Text can follow the dynamic, but another current limitation is that there must be spaces around the dyanmic.

**kern  **dynam
*M4/4   *
=1  =1
!   !LO:DY:i:t=sempre %s e legato
4c  pp
4d  .
4e  .
4f  .
=   =
4g  .
4a  .
4b  .
4cc .
=   =
*-  *-
Screen Shot 2020-08-15 at 10 45 53 PM