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

Support for clef changes before and after a measure rest #3501

Open
rettinghaus opened this issue Aug 21, 2023 · 6 comments
Open

Support for clef changes before and after a measure rest #3501

rettinghaus opened this issue Aug 21, 2023 · 6 comments

Comments

@rettinghaus
Copy link
Contributor

Clefs around mRest are not rendered in the correct order:

mRest

It looks like Verovio tries to move the C clef to the next measure (see reserved space on staff lines) and then moves it back to the previous one.
Similar thing happens with clefs around mSapce:

mSpace

It works with note and rest elements, so I suspect it to be connected to mRest and mSpace don't have a DurationInterface.

<?xml version="1.0" encoding="UTF-8"?>
<mei xmlns="http:https://www.music-encoding.org/ns/mei" meiversion="5.0.0-dev">
   <meiHead>
      <fileDesc>
         <titleStmt>
            <title>Clefs around rest</title>
            <respStmt>
               <persName role="encoder">Klaus Rettinghaus</persName>
            </respStmt>
         </titleStmt>
         <pubStmt>
            <date isodate="2023-05-10">2023-05-10</date>
         </pubStmt>
      </fileDesc>
   </meiHead>
   <music>
      <body>
         <mdiv>
            <score>
               <scoreDef>
                  <staffGrp>
                     <staffDef n="1" lines="5">
                        <clef shape="G" line="2" />
                     </staffDef>
                  </staffGrp>
               </scoreDef>
               <section>
                  <measure>
                     <staff n="1">
                        <layer n="1">
                           <clef shape="C" line="4" />
                           <mRest />
                           <clef shape="F" line="4" />
                        </layer>
                     </staff>
                  </measure>
               </section>
            </score>
         </mdiv>
      </body>
   </music>
</mei>
@rettinghaus
Copy link
Contributor Author

Potentially connected to #3500

@lpugin
Copy link
Contributor

lpugin commented Aug 21, 2023

What you are trying to represent is weird. Why would one write a clef change before and after a measure rest?

You can achieve it by having two layers:

<?xml version="1.0" encoding="UTF-8"?>
<mei xmlns="http:https://www.music-encoding.org/ns/mei" meiversion="5.0.0-dev">
   <meiHead>
      <fileDesc>
         <titleStmt>
            <title>Clefs around rest</title>
            <respStmt>
               <persName role="encoder">Klaus Rettinghaus</persName>
            </respStmt>
         </titleStmt>
         <pubStmt>
            <date isodate="2023-05-10">2023-05-10</date>
         </pubStmt>
      </fileDesc>
   </meiHead>
   <music>
      <body>
         <mdiv>
            <score>
               <scoreDef>
                  <staffGrp>
                     <staffDef n="1" lines="5">
                        <clef shape="G" line="2" />
                     </staffDef>
                  </staffGrp>
               </scoreDef>
               <section>
                  <measure>
                     <staff n="1">
                        <layer n="1">
                           <space dur="4"/>
                           <clef shape="C" line="4" />
                           <space dur="2" dots="1"/>
                           <clef shape="F" line="4" />
                        </layer>
                        <layer n="2">
                            <mRest />
                        </layer>
                     </staff>
                  </measure>
               </section>
            </score>
         </mdiv>
      </body>
   </music>
</mei>
image

@lpugin
Copy link
Contributor

lpugin commented Aug 21, 2023

When there is a rendering problem for something that has never been considered and that is such a corner case, I would not label the issue as a bug.

@lpugin lpugin changed the title Object order without DurationInterface Support for clef changes before and after a measure rest Aug 21, 2023
@lpugin lpugin added low priority and removed bug labels Aug 21, 2023
@rettinghaus
Copy link
Contributor Author

Well, it also affects clef changes st the same time in other staves. So to me this is a bug.

image
<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="https://music-encoding.org/schema/dev/mei-all.rng" type="application/xml" schematypens="http:https://relaxng.org/ns/structure/1.0"?>
<?xml-model href="https://music-encoding.org/schema/dev/mei-all.rng" type="application/xml" schematypens="http:https://purl.oclc.org/dsdl/schematron"?>
<mei xmlns="http:https://www.music-encoding.org/ns/mei" meiversion="5.0.0-dev">
   <meiHead>
      <fileDesc>
         <titleStmt>
            <title>Clef interaction with mRest</title>
            <respStmt>
               <persName role="encoder">Klaus Rettinghaus</persName>
            </respStmt>
         </titleStmt>
         <pubStmt>
            <date isodate="2023-08-21">2023-08-21</date>
         </pubStmt>
      </fileDesc>
   </meiHead>
   <music>
      <body>
         <mdiv>
            <score>
               <scoreDef>
                  <staffGrp>
                     <staffGrp bar.thru="true">
                        <grpSym symbol="brace" />
                        <staffDef n="1" lines="5">
                           <clef shape="G" line="2" />
                           <meterSig count="4" unit="4" />
                        </staffDef>
                        <staffDef n="2" lines="5">
                           <clef shape="F" line="4" />
                           <meterSig count="4" unit="4" />
                        </staffDef>
                     </staffGrp>
                  </staffGrp>
               </scoreDef>
               <section>
                  <measure n="1">
                     <staff n="1">
                        <layer n="1">
                           <note dur="4" oct="5" pname="f" />
                           <note dur="4" oct="5" pname="c" />
                           <note dur="4" oct="4" pname="g" />
                           <note dur="4" oct="4" pname="d" />
                        </layer>
                     </staff>
                     <staff n="2">
                        <layer n="5">
                           <note dur="4" oct="2" pname="g" />
                           <note dur="4" oct="3" pname="c" />
                           <note dur="4" oct="3" pname="f" />
                           <note dur="4" oct="3" pname="b" stem.dir="down">
                              <accid accid="f" />
                           </note>
                        </layer>
                     </staff>
                  </measure>
                  <measure n="2">
                     <staff n="1">
                        <layer n="1">
                           <clef shape="F" line="4" />
                           <note dur="4" oct="3" pname="a" />
                           <note dur="4" oct="3" pname="e" />
                           <note dur="4" oct="2" pname="b" />
                           <note dur="4" oct="2" pname="f">
                              <accid accid="s" />
                           </note>
                        </layer>
                     </staff>
                     <staff n="2">
                        <layer n="5">
                           <clef shape="G" line="2" />
                           <mRest />
                        </layer>
                     </staff>
                  </measure>
                  <measure right="end" n="3">
                     <staff n="1">
                        <layer n="1">
                           <note dur="4" oct="2" pname="g" />
                           <note dur="4" oct="3" pname="c" />
                           <note dur="4" oct="3" pname="f" />
                           <note dur="4" oct="3" pname="b" stem.dir="down">
                              <accid accid="f" />
                           </note>
                        </layer>
                     </staff>
                     <staff n="2">
                        <layer n="5">
                           <note dur="4" oct="5" pname="f" />
                           <note dur="4" oct="5" pname="c" />
                           <note dur="4" oct="4" pname="g" />
                           <note dur="4" oct="4" pname="d" />
                        </layer>
                     </staff>
                  </measure>
               </section>
            </score>
         </mdiv>
      </body>
   </music>
</mei>

@craigsapp
Copy link
Contributor

That can also be an "enhancement" if never encountered before 😜 But if it happens again for the same issue it is a regression or a bug...

@lpugin
Copy link
Contributor

lpugin commented Aug 21, 2023

It is much more logical to put the clef after the measure rest. That renders correctly

image
<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="https://music-encoding.org/schema/dev/mei-all.rng" type="application/xml" schematypens="http:https://relaxng.org/ns/structure/1.0"?>
<?xml-model href="https://music-encoding.org/schema/dev/mei-all.rng" type="application/xml" schematypens="http:https://purl.oclc.org/dsdl/schematron"?>
<mei xmlns="http:https://www.music-encoding.org/ns/mei" meiversion="5.0.0-dev">
   <meiHead>
      <fileDesc>
         <titleStmt>
            <title>Clef interaction with mRest</title>
            <respStmt>
               <persName role="encoder">Klaus Rettinghaus</persName>
            </respStmt>
         </titleStmt>
         <pubStmt>
            <date isodate="2023-08-21">2023-08-21</date>
         </pubStmt>
      </fileDesc>
   </meiHead>
   <music>
      <body>
         <mdiv>
            <score>
               <scoreDef>
                  <staffGrp>
                     <staffGrp bar.thru="true">
                        <grpSym symbol="brace" />
                        <staffDef n="1" lines="5">
                           <clef shape="G" line="2" />
                           <meterSig count="4" unit="4" />
                        </staffDef>
                        <staffDef n="2" lines="5">
                           <clef shape="F" line="4" />
                           <meterSig count="4" unit="4" />
                        </staffDef>
                     </staffGrp>
                  </staffGrp>
               </scoreDef>
               <section>
                  <measure n="1">
                     <staff n="1">
                        <layer n="1">
                           <note dur="4" oct="5" pname="f" />
                           <note dur="4" oct="5" pname="c" />
                           <note dur="4" oct="4" pname="g" />
                           <note dur="4" oct="4" pname="d" />
                        </layer>
                     </staff>
                     <staff n="2">
                        <layer n="5">
                           <note dur="4" oct="2" pname="g" />
                           <note dur="4" oct="3" pname="c" />
                           <note dur="4" oct="3" pname="f" />
                           <note dur="4" oct="3" pname="b" stem.dir="down">
                              <accid accid="f" />
                           </note>
                        </layer>
                     </staff>
                  </measure>
                  <measure n="2">
                     <staff n="1">
                        <layer n="1">
                           <clef shape="F" line="4" />
                           <note dur="4" oct="3" pname="a" />
                           <note dur="4" oct="3" pname="e" />
                           <note dur="4" oct="2" pname="b" />
                           <note dur="4" oct="2" pname="f">
                              <accid accid="s" />
                           </note>
                        </layer>
                     </staff>
                     <staff n="2">
                        <layer n="5">
                           <mRest />
                           <clef shape="G" line="2" />
                        </layer>
                     </staff>
                  </measure>
                  <measure right="end" n="3">
                     <staff n="1">
                        <layer n="1">
                           <note dur="4" oct="2" pname="g" />
                           <note dur="4" oct="3" pname="c" />
                           <note dur="4" oct="3" pname="f" />
                           <note dur="4" oct="3" pname="b" stem.dir="down">
                              <accid accid="f" />
                           </note>
                        </layer>
                     </staff>
                     <staff n="2">
                        <layer n="5">
                           <note dur="4" oct="5" pname="f" />
                           <note dur="4" oct="5" pname="c" />
                           <note dur="4" oct="4" pname="g" />
                           <note dur="4" oct="4" pname="d" />
                        </layer>
                     </staff>
                  </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