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

Add key signature when transposing and none present in input data #1240

Open
craigsapp opened this issue Dec 17, 2019 · 0 comments
Open

Add key signature when transposing and none present in input data #1240

craigsapp opened this issue Dec 17, 2019 · 0 comments

Comments

@craigsapp
Copy link
Contributor

Here is a remaining item for the transposition option: When the input data does not have a key signature, a key signature of 0 should be added to the start of the data before transposition is done.

Here is an example:

Screen Shot 2019-12-17 at 11 14 27

Running verovio --transpose P5 will produce:

Screen Shot 2019-12-17 at 11 14 51

The pitches are correct for sounding purposes (there is an accid.ges="s" on the F). But the graphical display is incorrect (accid needs to be s).

The discussed solution is that a key signature needs to be added to the score so that the transposition will not need migration between @accid and @accid.ges. When there is no key signature at the start of the music, then a@key.sig="0" needs to be added to the start of the music (system or staff). This should be done before transposition so that the key signature can be transposed along with the rest of the data.

If a 0 key signature is added to the music, then the transposed music will display correctly as:

Screen Shot 2019-12-17 at 11 23 49

A key designation (keySig@pname/keySig@accid/keySig@mode) should not be added automatically (at least not assumed to be C major).

Here is example data where the music does not contain an initial key signature:

<?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="2019-12-17T11:11:25" version="2.4.0-dev-fefe05c">
     <name>Verovio</name>
     <p>Transcoded from Humdrum</p>
    </application>
   </appInfo>
  </encodingDesc>
  <workList>
   <work>
    <title />
   </work>
  </workList>
 </meiHead>
 <music>
  <body>
   <mdiv xml:id="mdiv-0000001950275526">
    <score xml:id="score-0000001237861321">
     <scoreDef xml:id="scoredef-0000001604308173">
      <staffGrp xml:id="staffgrp-0000000600137621">
       <staffDef xml:id="staffdef-0000000412999549" n="1" lines="5">
        <clef xml:id="clef-0000001660438254" 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="0">
       <staff xml:id="staff-0000002009032899" n="1">
        <layer xml:id="layer-L1F1N1" n="1">
         <note xml:id="note-L4F1" dur="4" oct="4" pname="c" accid.ges="n" />
         <note xml:id="note-L5F1" dur="4" oct="4" pname="d" accid.ges="n" />
         <note xml:id="note-L6F1" dur="4" oct="4" pname="e" accid.ges="n" />
         <note xml:id="note-L7F1" dur="4" oct="4" pname="f" accid.ges="n" />
        </layer>
       </staff>
      </measure>
      <measure xml:id="measure-L8" right="end" n="2">
       <staff xml:id="staff-L8F1N1" n="1">
        <layer xml:id="layer-L8F1N1" n="1">
         <note xml:id="note-L9F1" dur="4" oct="4" pname="g" accid.ges="n" />
         <note xml:id="note-L10F1" dur="4" oct="4" pname="a" accid.ges="n" />
         <note xml:id="note-L11F1" dur="4" oct="4" pname="b" accid.ges="n" />
         <note xml:id="note-L12F1" dur="4" oct="5" pname="c" accid.ges="n" />
        </layer>
       </staff>
      </measure>
     </section>
    </score>
   </mdiv>
  </body>
 </music>
</mei>

Here is the input data with a 0 key signature (but no key designation):

<?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="2019-12-17T11:27:50" version="2.4.0-dev-fefe05c">
     <name>Verovio</name>
     <p>Transcoded from Humdrum</p>
    </application>
   </appInfo>
  </encodingDesc>
  <workList>
   <work>
    <title />
   </work>
  </workList>
 </meiHead>
 <music>
  <body>
   <mdiv xml:id="mdiv-0000001468656901">
    <score xml:id="score-0000000539496489">
     <scoreDef xml:id="scoredef-0000001111202859">
      <staffGrp xml:id="staffgrp-0000001402991556">
       <staffDef xml:id="staffdef-0000001877038183" n="1" lines="5">
        <clef xml:id="clef-0000000588555981" shape="G" line="2" />
        <keySig xml:id="keysig-L3F1" sig="0" />
        <meterSig xml:id="metersig-L2F1" count="4" unit="4" />
       </staffDef>
      </staffGrp>
     </scoreDef>
     <section xml:id="section-L1F1">
      <measure xml:id="measure-L1" n="0">
       <staff xml:id="staff-0000000983907924" n="1">
        <layer xml:id="layer-L1F1N1" n="1">
         <note xml:id="note-L5F1" dur="4" oct="4" pname="c" accid.ges="n" />
         <note xml:id="note-L6F1" dur="4" oct="4" pname="d" accid.ges="n" />
         <note xml:id="note-L7F1" dur="4" oct="4" pname="e" accid.ges="n" />
         <note xml:id="note-L8F1" dur="4" oct="4" pname="f" accid.ges="n" />
        </layer>
       </staff>
      </measure>
      <measure xml:id="measure-L9" right="end" n="2">
       <staff xml:id="staff-L9F1N1" n="1">
        <layer xml:id="layer-L9F1N1" n="1">
         <note xml:id="note-L10F1" dur="4" oct="4" pname="g" accid.ges="n" />
         <note xml:id="note-L11F1" dur="4" oct="4" pname="a" accid.ges="n" />
         <note xml:id="note-L12F1" dur="4" oct="4" pname="b" accid.ges="n" />
         <note xml:id="note-L13F1" dur="4" oct="5" pname="c" accid.ges="n" />
        </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

1 participant