Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unmatched hairpin rendering in **dynam as cresc./dim. #123

Open
craigsapp opened this issue Jun 27, 2018 · 11 comments
Open

Unmatched hairpin rendering in **dynam as cresc./dim. #123

craigsapp opened this issue Jun 27, 2018 · 11 comments

Comments

@craigsapp
Copy link
Member

When a hairpin is started but not ended in **dynam spines, this hairpin was previously ignored in the Humdrum-to-MEI converter. Now it is converted into a "cresc." for < and "dim." for >:

screen shot 2018-06-27 at 12 37 19 am

Humdrum data:

**kern	**dynam
=	=
2c	<
2e	.
.	[
=	=
2c	>
2e	.
.	]
=	=
2c	<
2e	.
.	.
=	=
2c	>
2e	.
.	.
=	=
2c	p <
2e	[ >
.	]
=	=
*-	*-

The previous method of encoding "cresc." and "dim." was:

**kern	**dynam
=	=
2c	<
2e	.
.	[
=	=
2c	>
2e	.
.	]
=	=
!LO:TX:i:t=cresc.	!
2c	.
2e	.
.	.
=	=
!LO:TX:i:t=dim.	!
2c	.
2e	.
.	.
=	=
2c	p <
2e	[ >
.	]
=	=
*-	*-

(with the < and > often present, but this will now cause a double display of "cresc." or "dim.")

There should be a way of specifiying "crescendo" rather than "cresc.". Perhaps as << and likewise with "diminuendo" and "dimin" as alternates for "dim.".

This will allow faster entry of "cresc." and "dim." text into music and closely represents the meaning of an unclosed hairpin: < by itself means crescendo, but does not explicitly how long the crescendo is.

craigsapp referenced this issue in rism-digital/verovio Jun 27, 2018
@pe-ro
Copy link

pe-ro commented Jun 27, 2018

But what if I want a < without a corresponding >? For example, the source I'm encoding has this feature and I want to replicate the source as closely as I can?

@craigsapp
Copy link
Member Author

To produce a crescendo hairpin you need to have a < character to start it and a [ character to end it. A < character by itself is not a complete hairpin, so it cannot be converted to one in MEI for example. Previously I have ignored it, but it is useful to map it visually to "cresc." since it has a similar function: an opening hairpin with no explicit endpoint.

For replicating the source as closely as possible, there will be a need to specify what text should be displayed in such cases. "cresc." is a good default, but others could be "cres." or "crescendo" depending on the edition.

I am thinking of two possibilities for controlling the text:

(1) An RDF to indicate the text:

!!!RDF**dynam: < = "cres."

This would be a global setting for all unpaired < markers in **dynam data. To change the text for a particular case, something like this should work, using a layout command:

**dynam
!LO:HP:t=cres.
<
!LO:HP:t=crescendo
<
*-

This system could also force correctly formed hairpins to be text:

**dynam
!LO:HP:t=cres.
<
[
!LO:HP:t=crescendo
<
[
*-

In this case the hairpin would be forced to become a text direction in MEI, but it would possess both a start time and end time.

@jacekiwaszko1
Copy link
Collaborator

And what about fontstyle changes? I'm guessing that attributes i and B are going to work as in text comments (!LO:HP:i:t=xxx = xxx). But how to deal with that using !!!RDF?

!!!RDF**dynam: < = "cres.", fontstyle=normal/bold/italic/bold-italic
or simple
!!!RDF**dynam: < = "cres.", normal/bold/italic/bold-italic

(as with parentheses/bracket in #57) looks to me like convenient solution.

@craigsapp
Copy link
Member Author

Global RDF method of indicating the text for unmatched < and '>' in **dynam spines are now implemented in commit rism-digital/verovio@960b590

!!!RDF**dynam: < = "cres.", fontstyle="normal|bold|italic|bold-italic"

The quotes are optional, but if optional, then only the first non-space-containing word would be processed:

!!!RDF**dynam: < = cresc. fontstyle=normal

Example:

**kern	**dynam
*clefF4	*clefG2
1c	<
=	=
1d	.
=	=
1e	>
=	=
1f	.
==	==
*-	*-
!!!RDF**dynam: < = "get louder", fontstyle="bold"
!!!RDF**dynam: > = "get softer"  fontstyle=normal

Renders as:

screen shot 2018-07-19 at 1 05 55 pm

@jacekiwaszko1
Copy link
Collaborator

In the following example (from Chopin's Mazurka op. 30 no 1, Braitkopf & Härtel) there's a dim. sign with extention line:

dim--1

I would like to encode it as properly ended hairpin (since the end of the extention line defines the end of diminuendo) and change rendering to text (as in Comment above).

**kern	**kern	**dynam
*k[b-e-a-]	*k[b-e-a-]	*
=29	=29	=29
!!pagebreak:original
4f#X 4c 4An	(4dd	>
4f# 4c 4A	8.cc#XL	.
.	16ddk	.
4f# 4c 4A-X	8.ee-	.
.	16ddJk	.
=30	=30	=30
4Bn 4G	4g\	]
!	!	!LO:HP:t=dim.
4f#X 4An 4G	8.cc#XL	>
.	16ddk	.
4f# 4A 4G	8.ee-	.
.	16ddJk	.
=31	=31	=31
4fn 4Bn 4G	4gg	.
4f#X 4An 4G	8.cc#XL	.
.	16ddk	.
4f# 4A 4G	8.ee-	.
.	16ddJk	.
=32	=32	=32
4Bn 4G	4g\	.
4f#X 4An 4G	8.cc#XL	.
.	16ddk	.
4f# 4A 4G	8.ee-	.
.	16ddJk	.
=33	=33	=33
[2.fn [2.Bn [2.G)	4gg	.
.	8.cc#XL	.
.	16ddk	.
.	8.ee-	.
.	16ddJk	.
=34	=34	=34
!!linebreak:original
*	*^	*
2.f_ 2.BnX_> 2.G_	4g	[2.g	.
.	8.cc#XL	.	.
.	16ddk	.	.
.	8.ee-	.	.
.	16ddJk	.	.
=35	=35	=35	=35
2f] 2BnX] 2G]	4gg	2g]	]
!	!LO:TX:i:B:t=poco ritenuto.	!	!
.	8.cc#XL	.	.
.	16ddk	.	.
4r	8.ee-	4r	.
.	16ddJk	.	.
*	*v	*v	*
=36	=36	=36
2.r	2aa-	>
.	4gg)	]
*clefF4	*	*
=37	=37	=37
*	*^	*
4r	(8gL	4r	p
.	8qb-/	.	.
.	8a-	.	.
4d 4G	8g	4g	.
.	8bn	.	.
4d 4G	8cc	4f	.
.	8ddJ	.	.
=38	=38	=38	=38
.	8qff/	.	.
4r	8ee-L	4r	.
.	8ddJ	.	.
4G 4C	2cc)	4e->	.
4G 4C	.	4e->	.
=39	=39	=39	=39
4r	(8ddL	4r	.
.	8ee-J	.	.
.	8qgg/	.	.
4Bn 4G 4C	4ff	4f>	.
4d 4G 4C	8ee-L	4f>	.
.	8ddJ	.	.
*	*v	*v	*
=	=	=
*-	*-	*-

Unfortunately this kind of encoding does not work in VHV:

dim--2

This encoding should be unambiguous enough to define start and end of diminuendo, and to specify that it should be rendered as text direction.

**dynam
!LO:HP:t=dim.
>
.
]

What's more, I think that by default it should be rendered with extention line unlike this:

**dynam
!LO:HP:t=dim.
>
.
.

What do you think?

Another question is, if it is possible to encode extention lines in MEI. I can't find any information about that in MEI documentation. There's an MEI issue about that (music-encoding/music-encoding#494), but without any conclusions...

@craigsapp
Copy link
Member Author

Another question is, if it is possible to encode extention lines in MEI.

It looks like it should be encoded in MEI as:

<dir tstamp="2" tstamp2="5m+0" extender="true" lform="dashed">dim.</dir>

But dir@extender does not seem to be implemented in verovio yet.


What do you think?

Yes that is a good idea.

This example would be rendered automatically with a dashed line after dim.:

**dynam
!LO:HP:t=dim.
>
.
]

While this one would not, since the endpoint of the decrescendo is not specified:

**dynam
!LO:HP:t=dim.
>
.
.

Perhaps there would be additional parameters to control the style of the line, similar to control @lform attribute:
http://music-encoding.org/guidelines/v3/data-types/data.lineform.html

And perhaps an additional parameter such as noline to hide the line extender.

@jacekiwaszko1
Copy link
Collaborator

It's impossible to place dynamics rendered as text above the top staff. !LO:HP:a should work, as it does for !LO:HP:b=2 (last measure of example below), but it doesn't...

Kern:

**kern	**kern	**dynam
!	!	!LO:HP:a
1C	1g	>
=	=	=
!	!	!LO:DY:a
1C	1g	>
=	=	=
!	!	!LO:TX:a
1C	1g	>
=	=	=
!	!	!LO:HP:b=2
1C	1g	>
==	==	==
*-	*-	*-

current rendering:

control-dynamics-position

@craigsapp
Copy link
Member Author

It seems related to transmutation of dynamics/hairpins into text directions since plain dynamics and hairpins respond to a:

screen shot 2019-01-28 at 12 40 29 pm

When this happens, I need to check for the DY or HP layout parameters. Using !LO:TX:a was a good try, but TX are not real layout parameters (they insert text attached to a note rather than modify the note). What I need to do is basically transfer the a parameter in a manner similar to the b=2 parameter in the 4th measure.

craigsapp added a commit to rism-digital/verovio that referenced this issue Jan 29, 2019
@craigsapp
Copy link
Member Author

Fixed with commit rism-digital/verovio@56b5535.

Here is a test:

screen shot 2019-01-29 at 1 44 02 am

**kern	**kern	**dynam
=	=	=
!!LO:TX:b:t=middle:color=chartreuse
1C	1g	>
=	=	=
!	!	!LO:HP:a
!LO:TX:a:t=above:color=chartreuse	!	!
1C	1g	>
=	=	=
!!LO:TX:a:t=below:color=chartreuse
!	!	!LO:HP:b=2
1C	1g	>
==	==	==
*-	*-	*-

The parameter controls should be done with HP (not with DY or TX). This is in case the incomplete hairpin is ever completed (so if the partial one was above the staff, the complete one should be also).

@jacekiwaszko1
Copy link
Collaborator

For some reason unmatched crescendo can't be moved above the staff:

**kern	**dynam
!	!LO:HP:a
1c	>
=	=
!	!LO:HP:a
1c	<
=	=
*-	*-

cresc-above

MEI conversion:

<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="https://music-encoding.org/schema/4.0.0/mei-all.rng" type="application/xml" schematypens="http://relaxng.org/ns/structure/1.0"?>
<?xml-model href="https://music-encoding.org/schema/4.0.0/mei-all.rng" type="application/xml" schematypens="http://purl.oclc.org/dsdl/schematron"?>
<mei xmlns="http://www.music-encoding.org/ns/mei" meiversion="4.0.0">
    <meiHead>
        <fileDesc>
            <titleStmt>
                <title />
            </titleStmt>
            <pubStmt />
        </fileDesc>
        <encodingDesc>
            <appInfo>
                <application isodate="2020-04-16T18:06:04" version="2.7.0-dev-9b84e3d">
                    <name>Verovio</name>
                    <p>Transcoded from Humdrum</p>
                </application>
            </appInfo>
        </encodingDesc>
        <workList>
            <work>
                <title />
            </work>
        </workList>
    </meiHead>
    <music>
        <body>
            <mdiv xml:id="mdiv-0000000187993496">
                <score xml:id="score-0000001192889224">
                    <scoreDef xml:id="scoredef-0000000337750368" midi.bpm="400">
                        <staffGrp xml:id="staffgrp-0000001078662939">
                            <staffDef xml:id="staffdef-0000000381227533" n="1" lines="5">
                                <clef xml:id="clef-0000000282450030" shape="G" line="2" />
                            </staffDef>
                        </staffGrp>
                    </scoreDef>
                    <section xml:id="section-L1F1">
                        <measure xml:id="measure-L1">
                            <staff xml:id="staff-0000000573528090" n="1">
                                <layer xml:id="layer-L1F1N1" n="1">
                                    <note xml:id="note-L3F1" dur="1" oct="4" pname="c" accid.ges="n" />
                                </layer>
                            </staff>
                            <dir xml:id="dir-L3F2" place="above" staff="1" tstamp="1.000000">decresc.</dir>
                        </measure>
                        <measure xml:id="measure-L4">
                            <staff xml:id="staff-L4F1N1" n="1">
                                <layer xml:id="layer-L4F1N1" n="1">
                                    <note xml:id="note-L6F1" dur="1" oct="4" pname="c" accid.ges="n" />
                                </layer>
                            </staff>
                            <dir xml:id="dir-L6F2" staff="1" tstamp="1.000000">cresc.</dir>
                        </measure>
                    </section>
                </score>
            </mdiv>
        </body>
    </music>
</mei>

It looks like dir@place="above" should be added in cresc..

@jacekiwaszko1
Copy link
Collaborator

Also both unmatched < and > don't react to interpretation *above:

**kern	**dynam
=-	=-
*	*above
1c	>
=	=
1c	<
=	=
1c	f
*-	*-

unmatched-hairpins

<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="https://music-encoding.org/schema/4.0.0/mei-all.rng" type="application/xml" schematypens="http://relaxng.org/ns/structure/1.0"?>
<?xml-model href="https://music-encoding.org/schema/4.0.0/mei-all.rng" type="application/xml" schematypens="http://purl.oclc.org/dsdl/schematron"?>
<mei xmlns="http://www.music-encoding.org/ns/mei" meiversion="4.0.0">
   <meiHead>
       <fileDesc>
           <titleStmt>
               <title />
           </titleStmt>
           <pubStmt />
       </fileDesc>
       <encodingDesc>
           <appInfo>
               <application isodate="2020-04-16T20:25:42" version="2.7.0-dev-9b84e3d">
                   <name>Verovio</name>
                   <p>Transcoded from Humdrum</p>
               </application>
           </appInfo>
       </encodingDesc>
       <workList>
           <work>
               <title />
           </work>
       </workList>
   </meiHead>
   <music>
       <body>
           <mdiv xml:id="mdiv-0000001479679160">
               <score xml:id="score-0000001031012397">
                   <scoreDef xml:id="scoredef-0000001124977466" midi.bpm="400">
                       <staffGrp xml:id="staffgrp-0000000352452682">
                           <staffDef xml:id="staffdef-0000001531102189" n="1" lines="5">
                               <clef xml:id="clef-0000001693757565" shape="G" line="2" />
                           </staffDef>
                       </staffGrp>
                   </scoreDef>
                   <section xml:id="section-L1F1">
                       <measure xml:id="measure-L1">
                           <staff xml:id="staff-0000000879084723" n="1">
                               <layer xml:id="layer-L1F1N1" n="1">
                                   <note xml:id="note-L4F1" dur="1" oct="4" pname="c" accid.ges="n" />
                               </layer>
                           </staff>
                           <dir xml:id="dir-L4F2" staff="1" tstamp="1.000000">decresc.</dir>
                       </measure>
                       <measure xml:id="measure-L5">
                           <staff xml:id="staff-L5F1N1" n="1">
                               <layer xml:id="layer-L5F1N1" n="1">
                                   <note xml:id="note-L6F1" dur="1" oct="4" pname="c" accid.ges="n" />
                               </layer>
                           </staff>
                           <dir xml:id="dir-L6F2" staff="1" tstamp="1.000000">cresc.</dir>
                       </measure>
                       <measure xml:id="measure-L7" right="invis">
                           <staff xml:id="staff-L7F1N1" n="1">
                               <layer xml:id="layer-L7F1N1" n="1">
                                   <note xml:id="note-L8F1" dur="1" oct="4" pname="c" accid.ges="n" />
                               </layer>
                           </staff>
                           <dynam xml:id="dynam-L8F2" place="above" staff="1" tstamp="1.000000" vgrp="100">f</dynam>
                       </measure>
                   </section>
               </score>
           </mdiv>
       </body>
   </music>
</mei>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants