humdrum-tools / verovio-humdrum-viewer

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

unwanted double text #181

Closed sannedubois closed 5 years ago

sannedubois commented 5 years ago

I can't figure out why the 'Fine' which is entered here, is displayed twice: fine_double

Code:

**kern  **mxhm
*clefG2 *
*k[b-e-a-d-g-c-]    *
*M2/4   *
=1- =1-
!LO:TX:a:Bi:t=Moderato  !
2r  G- major
=2  =2
2r  D- major
.   G- major
=3  =3
2r  .
=4  =4
4r  D- major
8r  G- major
8d- .
=5  =5
!!linebreak:original
8d-L    G- major
8g-J    .
8fL D- dominant
8cc-J   .
=6  =6
16b-LL  G- major
16dd-   .
16b-    .
16g-JJ  .
8d-L    .
8b-J    .
=7  =7
8.a-L   D- dominant
16fJk   .
8g- G- major
8r  .
=8  =8
4.r D- dominant/F
8d- G- major
=9  =9
!!linebreak:original
8d-L    G- major
8g-J    .
8fL D- dominant
8cc-J   .
=10 =10
16b-LL  G- major
16dd-   .
16b-    .
16g-JJ  .
8d-L    .
8b-J    .
=11 =11
8.a-L   D- dominant
16fJk   .
8g- G- major
8r  .
=12 =12
4.r D- dominant/F
16g-LL  G- major
16a-JJ  .
=13 =13
!!linebreak:original
8b-L    .
8a-J    G- major/F
8g-L    E- minor
8fJ B- major/D
=14 =14
16g-LL  E- minor
16a-    .
16g-    .
16fJJ   .
8e-L    .
16fL    .
16g-JJ  .
=15 =15
8a-L    D- major/F
8g-J    A- dominant/E-
8fL D- major
8e-J    A- major/C
=16 =16
16fLL   D- major
16g-    .
16f .
16e-JJ  .
8d-L    D- major/F
8d-J    .
=17 =17
!!linebreak:original
4cc-    D- dominant
8b-L    G- major
16cc-L  .
16b-JJ  .
=18 =18
4a- D- dominant/F
8g- G- major
8d- .
=19 =19
4cc-    D- dominant
8b-L    G- major
16cc-L  .
16b-JJ  .
=20 =20
4a- D- major/F
8g- G- major
8r  .
=21 =21
!!linebreak:original
2r  .
=22 =22
2r  D- major
.   G- major
!!LO:TX:a:Bi:rj:t=Fine
=23 =23
2r  .
=24||   =24||
2r  D- major
.   G- major
==  ==
*-  *-
craigsapp commented 5 years ago

Fixed with commit https://github.com/rism-ch/verovio/commit/2c81ea619a3719250f5f70ce0301ce9741b83923

The problem was that whole-measure rests were also processing the starting barline (but placing the text of the previous measure on the next barline).

Here is what it looks like in VHV now:

screen shot 2018-12-20 at 9 04 30 pm

Pressing alt-w several times will fix the chord collision problem related to issue https://github.com/rism-ch/verovio/issues/960

screen shot 2018-12-20 at 9 05 08 pm

This can be done semi-automatically using this URL:

http://verovio.humdrum.org/?k=wwwwwwww

The k=wwwwwwww will automatically type the alt-w command 8 times to widen the spacing of the notation:

screen shot 2018-12-20 at 9 10 09 pm

You can also use the Humdrum notation plugin to directly control the spacing in the notation.

screen shot 2018-12-20 at 9 28 20 pm

The above page was created with this HTML text:

<html>
<head>
<title>My Song</title>
<script src="https://verovio-script.humdrum.org/scripts/verovio-toolkit.js"></script>
<script src="/scripts/humdrum-notation-plugin.js"></script>
<script>var vrvToolkit = new verovio.toolkit()</script>
</head>
<body>
<p>My Song:</p>
<script>
displayHumdrum({
    source: "example",
    spacingLinear: "0.60",
    spacingNonLinear: "0.65",
    autoResize: true
})
</script>
<script type="text/x-humdrum" id="example">
!!!OMD: Moderato
**kern  **mxhm
*clefG2 *
*k[b-e-a-d-g-c-]    *
*M2/4   *
=1- =1-
2r  G- major
=2  =2
2r  D- major
.   G- major
=3  =3
2r  .
=4  =4
4r  D- major
8r  G- major
8d- .
=5  =5
!!linebreak:original
8d-L    G- major
8g-J    .
8fL D- dominant
8cc-J   .
=6  =6
16b-LL  G- major
16dd-   .
16b-    .
16g-JJ  .
8d-L    .
8b-J    .
=7  =7
8.a-L   D- dominant
16fJk   .
8g- G- major
8r  .
=8  =8
4.r D- dominant/F
8d- G- major
=9  =9
!!linebreak:original
8d-L    G- major
8g-J    .
8fL D- dominant
8cc-J   .
=10 =10
16b-LL  G- major
16dd-   .
16b-    .
16g-JJ  .
8d-L    .
8b-J    .
=11 =11
8.a-L   D- dominant
16fJk   .
8g- G- major
8r  .
=12 =12
4.r D- dominant/F
16g-LL  G- major
16a-JJ  .
=13 =13
!!linebreak:original
8b-L    .
8a-J    G- major/F
8g-L    E- minor
8fJ B- major/D
=14 =14
16g-LL  E- minor
16a-    .
16g-    .
16fJJ   .
8e-L    .
16fL    .
16g-JJ  .
=15 =15
8a-L    D- major/F
8g-J    A- dominant/E-
8fL D- major
8e-J    A- major/C
=16 =16
16fLL   D- major
16g-    .
16f .
16e-JJ  .
8d-L    D- major/F
8d-J    .
=17 =17
!!linebreak:original
4cc-    D- dominant
8b-L    G- major
16cc-L  .
16b-JJ  .
=18 =18
4a- D- dominant/F
8g- G- major
8d- .
=19 =19
4cc-    D- dominant
8b-L    G- major
16cc-L  .
16b-JJ  .
=20 =20
4a- D- major/F
8g- G- major
8r  .
=21 =21
!!linebreak:original
2r  .
=22 =22
2r  D- major
.   G- major
=23 =23
2r  .
!!LO:TX:a:Bi:rj:t=Fine
=24||   =24||
2r  D- major
.   G- major
==  ==
*-  *-
</script>
</body>
</html>

Notice that I moved the Fine text to be attached to measure 24 (which is probably where you wanted it).

Also for the "Moderato" text, it should be encoded currently as !!!OMD at the top of the file so that it is placed above the time signature rather than above the first note of the piece. The MusicXML to Humdrum convert needs to be adjusted to do that for you.

The options:

    spacingLinear: "0.60",
    spacingNonLinear: "0.65",

are used to control the spacing in the music. The first one (spacingLinear) is used to control the overall compactness of the notation. The default is 0.25, and I increase it here to widen the space between notes so that there is less collision of the chords. The second option (spacingNonLinear) is used to control the ratio of compression between rhythmic values. In this case the ratio is set to 0.8. The means that a note will be 80% of the width of two notes that are 1/2 of the note's duration. The default is 0.6.

This example also includes a new Humdrum notation plugin option:

    autoResize: true

which will redraw the notation when the web browser is resized. This will allos the notation to always fill up the size of the window (for this case where the width of the <body> will resize with the window).

sannedubois commented 5 years ago

Hi Craig,

Thanks a lot. Very helpful, also the horizontal spacing solutions. Very happy with it.

Best, Derk

Op vr 21 dec. 2018 om 03:30 schreef Craig Stuart Sapp < notifications@github.com>:

Fixed with commit rism-ch/verovio@2c81ea6 https://github.com/rism-ch/verovio/commit/2c81ea619a3719250f5f70ce0301ce9741b83923

The problem was that whole-measure rests were also processing the starting barline (but placing the text of the previous measure on the next barline).

Here is what it looks like in VHV now:

[image: screen shot 2018-12-20 at 9 04 30 pm] https://user-images.githubusercontent.com/3487289/50320540-db2aca00-049a-11e9-90c9-41672cfdc8ff.png

Pressing alt-w several times will fix the chord collision problem related to issue rism-ch/verovio#960 https://github.com/rism-ch/verovio/issues/960

[image: screen shot 2018-12-20 at 9 05 08 pm] https://user-images.githubusercontent.com/3487289/50320653-5a200280-049b-11e9-8bd6-7fa74526f4f0.png

This can be done semi-automatically using this URL:

http://verovio.humdrum.org/?k=wwwwwwww

The k=wwwwwwww will automatically type the alt-w command 8 times to widen the spacing of the notation:

[image: screen shot 2018-12-20 at 9 10 09 pm] https://user-images.githubusercontent.com/3487289/50320708-a23f2500-049b-11e9-8233-554cf798fb79.png

You can also use the Humdrum notation plugin https://plugin.humdrum.org to directly control the spacing in the notation.

[image: screen shot 2018-12-20 at 9 28 20 pm] https://user-images.githubusercontent.com/3487289/50321290-327e6980-049e-11e9-9fee-1a67fad85405.png

The above page was created with this HTML text:

My Song

My Song:

Notice that I moved the Fine text to be attached to measure 24 (which is probably where you wanted it).

Also for the "Moderato" text, it should be encoded currently as !!!OMD at the top of the file so that it is placed above the time signature rather than above the first note of the piece. The MusicXML to Humdrum convert needs to be adjusted to do that for you.

The options:

spacingLinear: "0.60", spacingNonLinear: "0.65",

are used to control the spacing in the music. The first one (spacingLinear) is used to control the overall compactness of the notation. The default is 0.25, and I increase it here to widen the space between notes so that there is less collision of the chords. The second option (spacingNonLinear) is used to control the ratio of compression between rhythmic values. In this case the ratio is set to 0.8. The means that a note will be 80% of the width of two notes that are 1/2 of the note's duration. The default is 0.6.

This example also includes a new Humdrum notation plugin option:

autoResize: true

which will redraw the notation when the web browser is resized. This will allos the notation to always fill up the size of the window (for this case where the width of the will resize with the window).

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/humdrum-tools/verovio-humdrum-viewer/issues/181#issuecomment-449219795, or mute the thread https://github.com/notifications/unsubscribe-auth/APa0EyVsvh_TR77h54bShT9jWoMh_QvMks5u7EengaJpZM4ZXPIj .