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

Mid-measure key/time signature change refinements #3497

Open
craigsapp opened this issue Aug 16, 2023 · 5 comments
Open

Mid-measure key/time signature change refinements #3497

craigsapp opened this issue Aug 16, 2023 · 5 comments

Comments

@craigsapp
Copy link
Contributor

There are three refinements to mid-measure keySig renderings that would be useful to add (two of them to make them behave similar to scoreDef/staffDef keySig).

The first enhancement: when a mid-measure key signature changes to C major/A minor (i.e., no sharps or flats in the key signature), a cancellation signature is required:

Screenshot 2023-08-16 at 12 55 19
Click to view MEI data for above example
<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="https://music-encoding.org/schema/dev/mei-all.rng" type="application/xml" schematypens="http://relaxng.org/ns/structure/1.0"?>
<?xml-model href="https://music-encoding.org/schema/dev/mei-all.rng" type="application/xml" schematypens="http://purl.oclc.org/dsdl/schematron"?>
<mei xmlns="http://www.music-encoding.org/ns/mei" meiversion="5.0.0-dev">
 <meiHead>
  <fileDesc>
   <titleStmt>
    <title />
   </titleStmt>
   <pubStmt />
  </fileDesc>
  <encodingDesc>
   <appInfo>
    <application isodate="2023-08-16T12:55:47" version="3.17.0-dev-ffd96fd">
     <name>Verovio</name>
     <p>Transcoded from Humdrum</p>
    </application>
   </appInfo>
  </encodingDesc>
  <workList>
   <work>
    <title />
   </work>
  </workList>
 </meiHead>
 <music>
  <body>
   <mdiv xml:id="m6huw4c">
    <score xml:id="s1onp10g">
     <scoreDef xml:id="s1fbxjmy" midi.bpm="400.000000">
      <staffGrp xml:id="s1gvq7qj">
       <staffDef xml:id="staffdef-L1F1" n="1" lines="5">
        <clef xml:id="clef-L2F1" shape="G" line="2" />
        <keySig xml:id="keysig-L4F1" sig="4s" />
        <meterSig xml:id="metersig-L3F1" count="4" unit="4" />
       </staffDef>
      </staffGrp>
     </scoreDef>
     <section xml:id="section-L1F1">
      <measure xml:id="measure-L1" n="1">
       <staff xml:id="staff-L1F1" n="1">
        <layer xml:id="layer-L1F1N1" n="1">
         <note xml:id="note-L6F1" dur="1" oct="4" pname="e" accid.ges="n" />
        </layer>
       </staff>
      </measure>
      <scoreDef xml:id="steouba">
       <keySig xml:id="keysig-L8F1" sig="0" cancelaccid="before" />
      </scoreDef>
      <measure xml:id="measure-L7">
       <staff xml:id="staff-L7F1N1" n="1">
        <layer xml:id="layer-L7F1N1" n="1">
         <note xml:id="note-L9F1" dur="1" oct="4" pname="c" accid.ges="n" />
        </layer>
       </staff>
      </measure>
     </section>
    </score>
   </mdiv>
  </body>
 </music>
</mei>

Here is an example with a mid-measure change, but the cancellation signature is missing (there should be four naturals similar to the previous example at the start of the measure):

Screenshot 2023-08-16 at 12 57 00
Click to view MEI data for above example
<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="https://music-encoding.org/schema/dev/mei-all.rng" type="application/xml" schematypens="http://relaxng.org/ns/structure/1.0"?>
<?xml-model href="https://music-encoding.org/schema/dev/mei-all.rng" type="application/xml" schematypens="http://purl.oclc.org/dsdl/schematron"?>
<mei xmlns="http://www.music-encoding.org/ns/mei" meiversion="5.0.0-dev">
 <meiHead>
  <fileDesc>
   <titleStmt>
    <title />
   </titleStmt>
   <pubStmt />
  </fileDesc>
  <encodingDesc>
   <appInfo>
    <application isodate="2023-08-16T12:55:47" version="3.17.0-dev-ffd96fd">
     <name>Verovio</name>
     <p>Transcoded from Humdrum</p>
    </application>
   </appInfo>
  </encodingDesc>
  <workList>
   <work>
    <title />
   </work>
  </workList>
 </meiHead>
 <music>
  <body>
   <mdiv xml:id="m6huw4c">
    <score xml:id="s1onp10g">
     <scoreDef xml:id="s1fbxjmy" midi.bpm="400.000000">
      <staffGrp xml:id="s1gvq7qj">
       <staffDef xml:id="staffdef-L1F1" n="1" lines="5">
        <clef xml:id="clef-L2F1" shape="G" line="2" />
        <keySig xml:id="keysig-L4F1" sig="4s" />
        <meterSig xml:id="metersig-L3F1" count="4" unit="4" />
       </staffDef>
      </staffGrp>
     </scoreDef>
     <section xml:id="section-L1F1">
      <measure xml:id="measure-L1" n="1">
       <staff xml:id="staff-L1F1" n="1">
        <layer xml:id="layer-L1F1N1" n="1">
         <note xml:id="note-L6F1" dur="2" oct="4" pname="e" accid.ges="n" />
         <keySig xml:id="keysig-L8F1" sig="0" cancelaccid="before" />
         <note xml:id="note-L9F1" dur="2" oct="4" pname="c" accid.ges="n" />
        </layer>
       </staff>
      </measure>
     </section>
    </score>
   </mdiv>
  </body>
 </music>
</mei>

Note that if the key signature is something other than C major/A minor, the key signature is displayed as expected:

Screenshot 2023-08-16 at 13 00 01
Click to view MEI data for above example
<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="https://music-encoding.org/schema/dev/mei-all.rng" type="application/xml" schematypens="http://relaxng.org/ns/structure/1.0"?>
<?xml-model href="https://music-encoding.org/schema/dev/mei-all.rng" type="application/xml" schematypens="http://purl.oclc.org/dsdl/schematron"?>
<mei xmlns="http://www.music-encoding.org/ns/mei" meiversion="5.0.0-dev">
 <meiHead>
  <fileDesc>
   <titleStmt>
    <title />
   </titleStmt>
   <pubStmt />
  </fileDesc>
  <encodingDesc>
   <appInfo>
    <application isodate="2023-08-16T12:55:47" version="3.17.0-dev-ffd96fd">
     <name>Verovio</name>
     <p>Transcoded from Humdrum</p>
    </application>
   </appInfo>
  </encodingDesc>
  <workList>
   <work>
    <title />
   </work>
  </workList>
 </meiHead>
 <music>
  <body>
   <mdiv xml:id="m6huw4c">
    <score xml:id="s1onp10g">
     <scoreDef xml:id="s1fbxjmy" midi.bpm="400.000000">
      <staffGrp xml:id="s1gvq7qj">
       <staffDef xml:id="staffdef-L1F1" n="1" lines="5">
        <clef xml:id="clef-L2F1" shape="G" line="2" />
        <keySig xml:id="keysig-L4F1" sig="4s" />
        <meterSig xml:id="metersig-L3F1" count="4" unit="4" />
       </staffDef>
      </staffGrp>
     </scoreDef>
     <section xml:id="section-L1F1">
      <measure xml:id="measure-L1" n="1">
       <staff xml:id="staff-L1F1" n="1">
        <layer xml:id="layer-L1F1N1" n="1">
         <note xml:id="note-L6F1" dur="2" oct="4" pname="e" accid.ges="n" />
         <keySig xml:id="keysig-L8F1" sig="3f" cancelaccid="before" />
         <note xml:id="note-L9F1" dur="2" oct="4" pname="c" accid.ges="n" />
        </layer>
       </staff>
      </measure>
     </section>
    </score>
   </mdiv>
  </body>
 </music>
</mei>

I suspect that this problem may be easy to fix by traversing the XML tree into section/measure/staff/layer to process keySig within layer at the same time as staffDef/scoreDef key signatures are processed.

@craigsapp
Copy link
Contributor Author

A second enhancement, which may also be fixed by traversing the XML tree into section/measure/staff/layer when processing keySigs is to enable the keySig@cancelaccid attribute (plus probably add a missing function to process the @cancelaccid attribute for mid-measure key signatures).

Here is an example of the @cancelaccid working at the staffDef/scoreDef level:
Screenshot 2023-08-16 at 13 08 46

Click to view MEI data for above example
<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="https://music-encoding.org/schema/dev/mei-all.rng" type="application/xml" schematypens="http://relaxng.org/ns/structure/1.0"?>
<?xml-model href="https://music-encoding.org/schema/dev/mei-all.rng" type="application/xml" schematypens="http://purl.oclc.org/dsdl/schematron"?>
<mei xmlns="http://www.music-encoding.org/ns/mei" meiversion="5.0.0-dev">
 <meiHead>
  <fileDesc>
   <titleStmt>
    <title />
   </titleStmt>
   <pubStmt />
  </fileDesc>
  <encodingDesc>
   <appInfo>
    <application isodate="2023-08-16T13:08:39" version="3.17.0-dev-ffd96fd">
     <name>Verovio</name>
     <p>Transcoded from Humdrum</p>
    </application>
   </appInfo>
  </encodingDesc>
  <workList>
   <work>
    <title />
   </work>
  </workList>
 </meiHead>
 <music>
  <body>
   <mdiv xml:id="mxoz7m3">
    <score xml:id="s1auaafg">
     <scoreDef xml:id="s1jx13z6">
      <staffGrp xml:id="slw0fzf">
       <staffDef xml:id="staffdef-L1F1" n="1" lines="5">
        <clef xml:id="crui9rh" shape="G" line="2" />
        <keySig xml:id="keysig-L3F1" sig="2s" />
        <meterSig xml:id="metersig-L2F1" count="4" unit="4" />
       </staffDef>
      </staffGrp>
     </scoreDef>
     <section xml:id="section-L1F1">
      <measure xml:id="measure-L1" n="1">
       <staff xml:id="staff-L1F1" n="1">
        <layer xml:id="layer-L1F1N1" n="1">
         <note xml:id="note-L6F1" dur="2" oct="4" pname="e" accid.ges="n" />
        </layer>
       </staff>
      </measure>
      <scoreDef xml:id="s18b2hd4">
       <keySig xml:id="keysig-L8F1" sig="3f" cancelaccid="before" />
      </scoreDef>
      <measure xml:id="measure-L7">
       <staff xml:id="staff-L7F1N1" n="1">
        <layer xml:id="layer-L7F1N1" n="1">
         <note xml:id="note-L9F1" dur="2" oct="4" pname="f" accid.ges="n" />
        </layer>
       </staff>
      </measure>
     </section>
    </score>
   </mdiv>
  </body>
 </music>
</mei>

When keySig is in the middle of a measure, the cancelation accidentals are not displayed when @cancelaccid="true":

Screenshot 2023-08-16 at 13 11 13
Click to view MEI data for above example
<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="https://music-encoding.org/schema/dev/mei-all.rng" type="application/xml" schematypens="http://relaxng.org/ns/structure/1.0"?>
<?xml-model href="https://music-encoding.org/schema/dev/mei-all.rng" type="application/xml" schematypens="http://purl.oclc.org/dsdl/schematron"?>
<mei xmlns="http://www.music-encoding.org/ns/mei" meiversion="5.0.0-dev">
 <meiHead>
  <fileDesc>
   <titleStmt>
    <title />
   </titleStmt>
   <pubStmt />
  </fileDesc>
  <encodingDesc>
   <appInfo>
    <application isodate="2023-08-16T13:08:39" version="3.17.0-dev-ffd96fd">
     <name>Verovio</name>
     <p>Transcoded from Humdrum</p>
    </application>
   </appInfo>
  </encodingDesc>
  <workList>
   <work>
    <title />
   </work>
  </workList>
 </meiHead>
 <music>
  <body>
   <mdiv xml:id="mxoz7m3">
    <score xml:id="s1auaafg">
     <scoreDef xml:id="s1jx13z6">
      <staffGrp xml:id="slw0fzf">
       <staffDef xml:id="staffdef-L1F1" n="1" lines="5">
        <clef xml:id="crui9rh" shape="G" line="2" />
        <keySig xml:id="keysig-L3F1" sig="2s" />
        <meterSig xml:id="metersig-L2F1" count="4" unit="4" />
       </staffDef>
      </staffGrp>
     </scoreDef>
     <section xml:id="section-L1F1">
      <measure xml:id="measure-L1" n="1">
       <staff xml:id="staff-L1F1" n="1">
        <layer xml:id="layer-L1F1N1" n="1">
         <note xml:id="note-L6F1" dur="2" oct="4" pname="e" accid.ges="n" />
         <keySig xml:id="keysig-L8F1" sig="3f" cancelaccid="before" />
         <note xml:id="note-L9F1" dur="2" oct="4" pname="f" accid.ges="n" />
        </layer>
       </staff>
      </measure>
     </section>
    </score>
   </mdiv>
  </body>
 </music>
</mei>

In the above example the cancellation accidentals are missing.

@rettinghaus
Copy link
Contributor

It can hardly react to a non-valid value. https://music-encoding.org/guidelines/dev/data-types/data.CANCELACCID.html

@craigsapp
Copy link
Contributor Author

A third enhancement would be to add extra space on the left side of a mid-measure keySig. In the following example, note that the key signature is too close to the previous note:

Screenshot 2023-08-16 at 13 17 35
Click to view MEI data for above example
<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="https://music-encoding.org/schema/dev/mei-all.rng" type="application/xml" schematypens="http://relaxng.org/ns/structure/1.0"?>
<?xml-model href="https://music-encoding.org/schema/dev/mei-all.rng" type="application/xml" schematypens="http://purl.oclc.org/dsdl/schematron"?>
<mei xmlns="http://www.music-encoding.org/ns/mei" meiversion="5.0.0-dev">
 <meiHead>
  <fileDesc>
   <titleStmt>
    <title />
   </titleStmt>
   <pubStmt />
  </fileDesc>
  <encodingDesc>
   <appInfo>
    <application isodate="2023-08-16T13:08:39" version="3.17.0-dev-ffd96fd">
     <name>Verovio</name>
     <p>Transcoded from Humdrum</p>
    </application>
   </appInfo>
  </encodingDesc>
  <workList>
   <work>
    <title />
   </work>
  </workList>
 </meiHead>
 <music>
  <body>
   <mdiv xml:id="mxoz7m3">
    <score xml:id="s1auaafg">
     <scoreDef xml:id="s1jx13z6">
      <staffGrp xml:id="slw0fzf">
       <staffDef xml:id="staffdef-L1F1" n="1" lines="5">
        <clef xml:id="crui9rh" shape="G" line="2" />
        <keySig xml:id="keysig-L3F1" sig="2s" />
        <meterSig xml:id="metersig-L2F1" count="4" unit="4" />
       </staffDef>
      </staffGrp>
     </scoreDef>
     <section xml:id="section-L1F1">
      <measure xml:id="measure-L1" n="1">
       <staff xml:id="staff-L1F1" n="1">
        <layer xml:id="layer-L1F1N1" n="1">
         <note xml:id="note-L6F1" dur="2" oct="4" pname="e" accid.ges="n" />
         <keySig xml:id="keysig-L8F1" sig="3f" cancelaccid="before" />
         <note xml:id="note-L9F1" dur="2" oct="4" pname="f" accid.ges="n" />
        </layer>
       </staff>
      </measure>
     </section>
    </score>
   </mdiv>
  </body>
 </music>
</mei>

It would be useful to copy the margin to the left of the key signature and place to its right.

There are complications:

(1) Extra space should not be added if there is already sufficient space to the previous note (such as a whole note). This is similar to how grace notes are placed.

(2) If there is a mid-measure clef immediately before the keySignature, then no extra space should be added to the left of the key signature.

(3) If there is a mid-measure time signature after the keySig, then no extra space added after the keySig (it would go after the time signature/mensuration sign).

(4) If there is a <barLine> or <divLine> immediately before the keySig, then extra space should not be added.

Example:

Screenshot 2023-08-16 at 13 26 24
Click to view MEI data for above example
<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="https://music-encoding.org/schema/dev/mei-all.rng" type="application/xml" schematypens="http://relaxng.org/ns/structure/1.0"?>
<?xml-model href="https://music-encoding.org/schema/dev/mei-all.rng" type="application/xml" schematypens="http://purl.oclc.org/dsdl/schematron"?>
<mei xmlns="http://www.music-encoding.org/ns/mei" meiversion="5.0.0-dev">
 <meiHead>
  <fileDesc>
   <titleStmt>
    <title />
   </titleStmt>
   <pubStmt />
  </fileDesc>
  <encodingDesc>
   <appInfo>
    <application isodate="2023-08-16T13:08:39" version="3.17.0-dev-ffd96fd">
     <name>Verovio</name>
     <p>Transcoded from Humdrum</p>
    </application>
   </appInfo>
  </encodingDesc>
  <workList>
   <work>
    <title />
   </work>
  </workList>
 </meiHead>
 <music>
  <body>
   <mdiv xml:id="mxoz7m3">
    <score xml:id="s1auaafg">
     <scoreDef xml:id="s1jx13z6">
      <staffGrp xml:id="slw0fzf">
       <staffDef xml:id="staffdef-L1F1" n="1" lines="5">
        <clef xml:id="crui9rh" shape="G" line="2" />
        <keySig xml:id="keysig-L3F1" sig="2s" />
        <meterSig xml:id="metersig-L2F1" count="4" unit="4" />
       </staffDef>
      </staffGrp>
     </scoreDef>
     <section xml:id="section-L1F1">
      <measure xml:id="measure-L1" n="1">
       <staff xml:id="staff-L1F1" n="1">
        <layer xml:id="layer-L1F1N1" n="1">
         <note xml:id="note-L6F1" dur="2" oct="4" pname="e" accid.ges="n" />
         <barLine/>
         <keySig xml:id="keysig-L8F1" sig="3f" cancelaccid="before" />
         <note xml:id="note-L9F1" dur="2" oct="4" pname="f" accid.ges="n" />
        </layer>
       </staff>
      </measure>
     </section>
    </score>
   </mdiv>
  </body>
 </music>
</mei>

For some reason the <barLine> is displayed after the mid-measure <keySig>, so that should be disallowed.

@craigsapp
Copy link
Contributor Author

It can hardly react to a non-valid value. https://music-encoding.org/guidelines/dev/data-types/data.CANCELACCID.html

How am I supposed to remember which version of MEI is being used :-). In the data for the example it is correct with the enhanced set of allowed values beyond the initial true/false: @cancelaccid="before". 😜

@craigsapp
Copy link
Contributor Author

Here is a probably related issue dealing with mid-measure time signature changes:

Screenshot 2023-09-12 at 04 01 23
Click to view MEI data for above example.
<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="https://music-encoding.org/schema/dev/mei-all.rng" type="application/xml" schematypens="http://relaxng.org/ns/structure/1.0"?>
<?xml-model href="https://music-encoding.org/schema/dev/mei-all.rng" type="application/xml" schematypens="http://purl.oclc.org/dsdl/schematron"?>
<mei xmlns="http://www.music-encoding.org/ns/mei" meiversion="5.0.0-dev">
 <meiHead>
  <fileDesc>
   <titleStmt>
    <title />
   </titleStmt>
   <pubStmt />
  </fileDesc>
  <encodingDesc>
   <appInfo>
    <application isodate="2023-09-12T04:00:18" version="3.17.0-dev-98a9f2d-dirty">
     <name>Verovio</name>
     <p>Transcoded from Humdrum</p>
    </application>
   </appInfo>
  </encodingDesc>
  <workList>
   <work>
    <title />
   </work>
  </workList>
 </meiHead>
 <music>
  <body>
   <mdiv xml:id="md2szb6">
    <score xml:id="s1axmhy0">
     <scoreDef xml:id="s8guqws">
      <staffGrp xml:id="s1cgdjyx">
       <staffDef xml:id="staffdef-L1F1" n="1" lines="5">
        <clef xml:id="clmqvj0" shape="G" line="2" />
        <meterSig xml:id="metersig-L2F1" count="4" unit="4" />
       </staffDef>
      </staffGrp>
     </scoreDef>
     <section xml:id="section-L1F1">
      <measure xml:id="measure-L1" n="1">
       <staff xml:id="staff-L1F1" n="1">
        <layer xml:id="layer-L1F1N1" n="1">
         <note xml:id="note-L4F1" dur="2" oct="4" pname="c" accid.ges="n" />
         <note xml:id="note-L5F1" dur="2" oct="4" pname="d" accid.ges="n" />
        </layer>
       </staff>
      </measure>
      <measure xml:id="measure-L6" n="2">
       <staff xml:id="staff-L6F1N1" n="1">
        <layer xml:id="layer-L6F1N1" n="1">
         <note xml:id="note-L7F1" dur="2" oct="4" pname="e" accid.ges="n" />
         <meterSig xml:id="metersig-L9F1" count="2" unit="4" />
         <note xml:id="note-L9F1" dur="2" oct="4" pname="d" accid.ges="n" />
        </layer>
       </staff>
      </measure>
      <measure xml:id="measure-L10" n="2">
       <staff xml:id="staff-L10F1N1" n="1">
        <layer xml:id="layer-L10F1N1" n="1">
         <note xml:id="note-L11F1" dur="2" oct="4" pname="e" accid.ges="n" />
        </layer>
       </staff>
      </measure>
      <measure xml:id="measure-L12" right="end" n="3">
       <staff xml:id="staff-L12F1N1" n="1">
        <layer xml:id="layer-L12F1N1" n="1">
         <note xml:id="note-L13F1" dur="2" oct="4" pname="f" accid.ges="n" />
        </layer>
       </staff>
      </measure>
     </section>
    </score>
   </mdiv>
  </body>
 </music>
</mei>

Where there is no space added before the time siganature and extra space added afterwards.

Another case happens where there is a <barLine> added before the time signature, but the time signature is moved before barline:

Screenshot 2023-09-12 at 04 16 40
Click to view MEI data for above example
<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="https://music-encoding.org/schema/dev/mei-all.rng" type="application/xml" schematypens="http://relaxng.org/ns/structure/1.0"?>
<?xml-model href="https://music-encoding.org/schema/dev/mei-all.rng" type="application/xml" schematypens="http://purl.oclc.org/dsdl/schematron"?>
<mei xmlns="http://www.music-encoding.org/ns/mei" meiversion="5.0.0-dev">
 <meiHead>
  <fileDesc>
   <titleStmt>
    <title />
   </titleStmt>
   <pubStmt />
  </fileDesc>
  <encodingDesc>
   <appInfo>
    <application isodate="2023-09-12T04:00:18" version="3.17.0-dev-98a9f2d-dirty">
     <name>Verovio</name>
     <p>Transcoded from Humdrum</p>
    </application>
   </appInfo>
  </encodingDesc>
  <workList>
   <work>
    <title />
   </work>
  </workList>
 </meiHead>
 <music>
  <body>
   <mdiv xml:id="md2szb6">
    <score xml:id="s1axmhy0">
     <scoreDef xml:id="s8guqws">
      <staffGrp xml:id="s1cgdjyx">
       <staffDef xml:id="staffdef-L1F1" n="1" lines="5">
        <clef xml:id="clmqvj0" shape="G" line="2" />
        <meterSig xml:id="metersig-L2F1" count="4" unit="4" />
       </staffDef>
      </staffGrp>
     </scoreDef>
     <section xml:id="section-L1F1">
      <measure xml:id="measure-L1" n="1">
       <staff xml:id="staff-L1F1" n="1">
        <layer xml:id="layer-L1F1N1" n="1">
         <note xml:id="note-L4F1" dur="2" oct="4" pname="c" accid.ges="n" />
         <note xml:id="note-L5F1" dur="2" oct="4" pname="d" accid.ges="n" />
        </layer>
       </staff>
      </measure>
      <measure xml:id="measure-L6" n="2">
       <staff xml:id="staff-L6F1N1" n="1">
        <layer xml:id="layer-L6F1N1" n="1">
         <note xml:id="note-L7F1" dur="2" oct="4" pname="e" accid.ges="n" />
         <barLine color="green" form="dashed" />
         <meterSig xml:id="metersig-L9F1" count="2" unit="4" />
         <note xml:id="note-L9F1" dur="2" oct="4" pname="d" accid.ges="n" />
        </layer>
       </staff>
      </measure>
      <measure xml:id="measure-L10" n="2">
       <staff xml:id="staff-L10F1N1" n="1">
        <layer xml:id="layer-L10F1N1" n="1">
         <note xml:id="note-L11F1" dur="2" oct="4" pname="e" accid.ges="n" />
        </layer>
       </staff>
      </measure>
      <measure xml:id="measure-L12" right="end" n="3">
       <staff xml:id="staff-L12F1N1" n="1">
        <layer xml:id="layer-L12F1N1" n="1">
         <note xml:id="note-L13F1" dur="2" oct="4" pname="f" accid.ges="n" />
        </layer>
       </staff>
      </measure>
     </section>
    </score>
   </mdiv>
  </body>
 </music>
</mei>

The 2/4 time signature should appear after the green dashed <barLine>.

Here is an example of both time and key signatures after a <barLine>, where the order should be barline (green), time signature, key signature (pink):

Screenshot 2023-09-12 at 04 20 51
Click to view MEI data for above example
<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="https://music-encoding.org/schema/dev/mei-all.rng" type="application/xml" schematypens="http://relaxng.org/ns/structure/1.0"?>
<?xml-model href="https://music-encoding.org/schema/dev/mei-all.rng" type="application/xml" schematypens="http://purl.oclc.org/dsdl/schematron"?>
<mei xmlns="http://www.music-encoding.org/ns/mei" meiversion="5.0.0-dev">
 <meiHead>
  <fileDesc>
   <titleStmt>
    <title />
   </titleStmt>
   <pubStmt />
  </fileDesc>
  <encodingDesc>
   <appInfo>
    <application isodate="2023-09-12T04:00:18" version="3.17.0-dev-98a9f2d-dirty">
     <name>Verovio</name>
     <p>Transcoded from Humdrum</p>
    </application>
   </appInfo>
  </encodingDesc>
  <workList>
   <work>
    <title />
   </work>
  </workList>
 </meiHead>
 <music>
  <body>
   <mdiv xml:id="md2szb6">
    <score xml:id="s1axmhy0">
     <scoreDef xml:id="s8guqws">
      <staffGrp xml:id="s1cgdjyx">
       <staffDef xml:id="staffdef-L1F1" n="1" lines="5">
        <clef xml:id="clmqvj0" shape="G" line="2" />
        <meterSig xml:id="metersig-L2F1" count="4" unit="4" />
       </staffDef>
      </staffGrp>
     </scoreDef>
     <section xml:id="section-L1F1">
      <measure xml:id="measure-L1" n="1">
       <staff xml:id="staff-L1F1" n="1">
        <layer xml:id="layer-L1F1N1" n="1">
         <note xml:id="note-L4F1" dur="2" oct="4" pname="c" accid.ges="n" />
         <note xml:id="note-L5F1" dur="2" oct="4" pname="d" accid.ges="n" />
        </layer>
       </staff>
      </measure>
      <measure xml:id="measure-L6" n="2">
       <staff xml:id="staff-L6F1N1" n="1">
        <layer xml:id="layer-L6F1N1" n="1">
         <note xml:id="note-L7F1" dur="2" oct="4" pname="e" accid.ges="n" />
         <barLine color="green" form="dashed" />
         <meterSig xml:id="metersig-L9F1" count="2" unit="4" />
         <keySig sig="1f" color="hotpink" />
         <note xml:id="note-L9F1" dur="2" oct="4" pname="d" accid.ges="n" />
        </layer>
       </staff>
      </measure>
      <measure xml:id="measure-L10" n="2">
       <staff xml:id="staff-L10F1N1" n="1">
        <layer xml:id="layer-L10F1N1" n="1">
         <note xml:id="note-L11F1" dur="2" oct="4" pname="e" accid.ges="n" />
        </layer>
       </staff>
      </measure>
      <measure xml:id="measure-L12" right="end" n="3">
       <staff xml:id="staff-L12F1N1" n="1">
        <layer xml:id="layer-L12F1N1" n="1">
         <note xml:id="note-L13F1" dur="2" oct="4" pname="f" accid.ges="n" />
        </layer>
       </staff>
      </measure>
     </section>
    </score>
   </mdiv>
  </body>
 </music>
</mei>

Order of the elements in the layer:

         <barLine color="green" form="dashed" />
         <meterSig xml:id="metersig-L9F1" count="2" unit="4" />
         <keySig sig="1f" color="hotpink" />

@craigsapp craigsapp changed the title Mid-measure key signature change refinements Mid-measure key/time signature change refinements Sep 12, 2023
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

2 participants