[MEI-L] Forcing bars on a single system

Craig Sapp craigsapp at gmail.com
Mon Jul 1 21:52:16 CEST 2019


Hi Reinier,

MEI encodes system breaks with <sb/> between measures.  So if you want four
measures on every system you would place a <sb/> after every four
measures.  In verovio you would need to set the " --breaks encoded" option
on the command line, or {"breaks": "encoded"} in the javascript verovio
toolkit (and perhaps the verovio.org MEI viewer does not allow for this
setting).  If you do not explicitly tell verovio to pay attention to the
system breaks, then it will ignore them, since the default parameter is
"auto" allowing verovio to decide on the location to break systems.

A complication related to how TEI does things, is that in order for the
<sb/> elements to be recognized in verovio, you must first have a <pb/>
(page break) at the start of a <section> element before the first
<measure>.  If you do not, then verovio complains about this (cryptically)
and then ignores the <sb/> elements.

If you want the barlines evenly spaced regardless of the rhythmic content
of the measure, then set the --spacing-non-linear parameter (see the second
example below for this).

Here is an example, where I make the first system have one measure, then
then second system has two measures, then the third system has three
measures and then the fourth system has four measures:

[image: Screen Shot 2019-07-01 at 9.25.01 PM.png]

<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="http://music-encoding.org/schema/4.0.0/mei-all.rng"
type="application/xml" schematypens="http://relaxng.org/ns/structure/1.0"?>
<?xml-model href="http://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-07-01T21:06:28" version="2.2.0-dev-7ac2fe9">
     <name>Verovio</name>
     <p>Transcoded from Humdrum</p>
    </application>
   </appInfo>
  </encodingDesc>
  <workList>
   <work>
    <title />
   </work>
  </workList>
 </meiHead>
 <music>
  <body>
   <mdiv>
    <score>
     <scoreDef>
      <staffGrp>
       <staffDef clef.shape="G" clef.line="2" meter.count="4"
meter.unit="4" n="1" lines="5"/>
      </staffGrp>
     </scoreDef>
     <section>
      <pb/>
      <measure n="1">
       <staff n="1">
        <layer n="1">
         <note dur="1" oct="4" pname="c" />
        </layer>
       </staff>
      </measure>
      <sb/>
      <measure n="2">
       <staff n="1">
        <layer n="1">
         <note dur="1" oct="4" pname="d" />
        </layer>
       </staff>
      </measure>
      <measure n="3">
       <staff n="1">
        <layer n="1">
         <note dur="2" oct="4" pname="e" />
         <note dur="2" oct="4" pname="e" />
        </layer>
       </staff>
      </measure>
      <sb/>
      <measure n="4">
       <staff n="1">
        <layer n="1">
         <note dur="1" oct="4" pname="f" />
        </layer>
       </staff>
      </measure>
      <measure n="5">
       <staff n="1">
        <layer n="1">
         <note dur="1" oct="4" pname="g" />
        </layer>
       </staff>
      </measure>
      <measure n="6">
       <staff n="1">
        <layer n="1">
         <note dur="2" oct="4" pname="a" />
         <note dur="2" oct="4" pname="a" />
        </layer>
       </staff>
      </measure>
      <sb/>
      <measure n="7">
       <staff n="1">
        <layer n="1">
         <note dur="1" oct="4" pname="b" />
        </layer>
       </staff>
      </measure>
      <measure n="8">
       <staff n="1">
        <layer n="1">
         <note dur="1" oct="4" pname="c" />
        </layer>
       </staff>
      </measure>
      <measure n="9">
       <staff n="1">
        <layer n="1">
         <note dur="2" oct="4" pname="d" />
         <note dur="2" oct="4" pname="d" />
        </layer>
       </staff>
      </measure>
      <measure n="10">
       <staff n="1">
        <layer n="1">
         <note dur="1" oct="4" pname="e" />
        </layer>
       </staff>
      </measure>
     </section>
    </score>
   </mdiv>
  </body>
 </music>
</mei>


It seems like you asked this question last year :-).  There is another way
of both forcing  a fixed number of measures per line, and an equal width to
each measure.  You need to set the verovio option --spacing-non-linear to
1.  This makes there be no compression ratio in the width of rhythms
between different rhythmic levels.  In other words with a factor of 1, the
width of two half notes equals the width of one whole note, and the width
of two quarter notes equals the width of one half note, and so on.

Here is a second example using the command line options:
      verovio test.krn --spacing-non-linear 1 --spacing-linear 0.04

The spacing-linear option is set to 0.04 to force four measures per line
(otherwise, you can change the page-width parameter instead of, or
including, the spacing-linear factor to force a particular number of
measures per line).

[image: Screen Shot 2019-07-01 at 9.46.48 PM.png]

If the image gets through the mail system, notice that measure 5 is the
same width as measure 9, and the same as measure 10.  There is a little
disturbance in the exactly equal widths on the first system due to the time
signature being present and squeezing the music a bit to make room for it.

Test MEI data:

<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="http://music-encoding.org/schema/4.0.0/mei-all.rng"
type="application/xml" schematypens="http://relaxng.org/ns/structure/1.0"?>
<?xml-model href="http://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-07-01T21:48:46" version="2.2.0-dev-7ac2fe9">
     <name>Verovio</name>
     <p>Transcoded from Humdrum</p>
    </application>
   </appInfo>
  </encodingDesc>
  <workList>
   <work>
    <title />
   </work>
  </workList>
 </meiHead>
 <music>
  <body>
   <mdiv xml:id="mdiv-0000001601484476">
    <score xml:id="score-0000001737040281">
     <scoreDef xml:id="scoredef-0000001751737657" midi.bpm="400">
      <staffGrp xml:id="staffgrp-0000001453242670">
       <staffDef xml:id="staffdef-0000001027192877" clef.shape="G"
clef.line="2" meter.count="4" meter.unit="4" n="1" lines="5">
        <label xml:id="label-0000000791880593" />
       </staffDef>
      </staffGrp>
     </scoreDef>
     <section xml:id="section-L1F1">
      <measure xml:id="measure-L3" n="1">
       <staff xml:id="staff-L3F1N1" n="1">
        <layer xml:id="layer-L3F1N1" n="1">
         <note xml:id="note-L4F1" dur="1" oct="4" pname="c" accid.ges="n" />
        </layer>
       </staff>
      </measure>
      <measure xml:id="measure-L5" n="2">
       <staff xml:id="staff-L5F1N1" n="1">
        <layer xml:id="layer-L5F1N1" n="1">
         <note xml:id="note-L6F1" dur="1" oct="4" pname="d" accid.ges="n" />
        </layer>
       </staff>
      </measure>
      <measure xml:id="measure-L7" n="3">
       <staff xml:id="staff-L7F1N1" n="1">
        <layer xml:id="layer-L7F1N1" n="1">
         <note xml:id="note-L8F1" dur="2" oct="4" pname="e" accid.ges="n" />
         <note xml:id="note-L9F1" dur="2" oct="4" pname="e" accid.ges="n" />
        </layer>
       </staff>
      </measure>
      <measure xml:id="measure-L10" n="4">
       <staff xml:id="staff-L10F1N1" n="1">
        <layer xml:id="layer-L10F1N1" n="1">
         <note xml:id="note-L11F1" dur="1" oct="4" pname="f" accid.ges="n"
/>
        </layer>
       </staff>
      </measure>
      <measure xml:id="measure-L12" n="5">
       <staff xml:id="staff-L12F1N1" n="1">
        <layer xml:id="layer-L12F1N1" n="1">
         <beam xml:id="beam-L13F1-L16F1">
          <note xml:id="note-L13F1" dur="8" oct="4" pname="g" accid.ges="n"
/>
          <note xml:id="note-L14F1" dur="8" oct="4" pname="g" accid.ges="n"
/>
          <note xml:id="note-L15F1" dur="8" oct="4" pname="g" accid.ges="n"
/>
          <note xml:id="note-L16F1" dur="8" oct="4" pname="g" accid.ges="n"
/>
         </beam>
         <beam xml:id="beam-L17F1-L20F1">
          <note xml:id="note-L17F1" dur="8" oct="4" pname="g" accid.ges="n"
/>
          <note xml:id="note-L18F1" dur="8" oct="4" pname="g" accid.ges="n"
/>
          <note xml:id="note-L19F1" dur="8" oct="4" pname="g" accid.ges="n"
/>
          <note xml:id="note-L20F1" dur="8" oct="4" pname="g" accid.ges="n"
/>
         </beam>
        </layer>
       </staff>
      </measure>
      <measure xml:id="measure-L21" n="6">
       <staff xml:id="staff-L21F1N1" n="1">
        <layer xml:id="layer-L21F1N1" n="1">
         <note xml:id="note-L22F1" dur="2" oct="4" pname="a" accid.ges="n"
/>
         <note xml:id="note-L23F1" dur="2" oct="4" pname="a" accid.ges="n"
/>
        </layer>
       </staff>
      </measure>
      <measure xml:id="measure-L24" n="7">
       <staff xml:id="staff-L24F1N1" n="1">
        <layer xml:id="layer-L24F1N1" n="1">
         <note xml:id="note-L25F1" dur="1" oct="4" pname="b" accid.ges="n"
/>
        </layer>
       </staff>
      </measure>
      <measure xml:id="measure-L26" n="8">
       <staff xml:id="staff-L26F1N1" n="1">
        <layer xml:id="layer-L26F1N1" n="1">
         <note xml:id="note-L27F1" dur="1" oct="4" pname="c" accid.ges="n"
/>
        </layer>
       </staff>
      </measure>
      <measure xml:id="measure-L28" n="9">
       <staff xml:id="staff-L28F1N1" n="1">
        <layer xml:id="layer-L28F1N1" n="1">
         <note xml:id="note-L29F1" dur="2" oct="4" pname="d" accid.ges="n"
/>
         <note xml:id="note-L30F1" dur="2" oct="4" pname="d" accid.ges="n"
/>
        </layer>
       </staff>
      </measure>
      <measure xml:id="measure-L31" n="10">
       <staff xml:id="staff-L31F1N1" n="1">
        <layer xml:id="layer-L31F1N1" n="1">
         <note xml:id="note-L32F1" dur="1" oct="4" pname="e" accid.ges="n"
/>
        </layer>
       </staff>
      </measure>
      <measure xml:id="measure-L33" n="11">
       <staff xml:id="staff-L33F1N1" n="1">
        <layer xml:id="layer-L33F1N1" n="1">
         <note xml:id="note-L34F1" dur="1" oct="4" pname="f" accid.ges="n"
/>
        </layer>
       </staff>
      </measure>
      <measure xml:id="measure-L35" right="end" n="12">
       <staff xml:id="staff-L35F1N1" n="1">
        <layer xml:id="layer-L35F1N1" n="1">
         <note xml:id="note-L36F1" dur="2" oct="4" pname="g" accid.ges="n"
/>
         <note xml:id="note-L37F1" dur="2" oct="4" pname="g" accid.ges="n"
/>
        </layer>
       </staff>
      </measure>
     </section>
    </score>
   </mdiv>
  </body>
 </music>
</mei>


-=+Craig




On Mon, 1 Jul 2019 at 19:25, Reinier de Valk <reinierdevalk at gmail.com>
wrote:

> Hi Klaus,
>
> Thanks for your reply. I am using the online Verovio viewer, and when I
> click the Options button I see that certain page layout options (such as
> Breaks and Page width) are made unavailable. The command line tool does not
> work on the computer I have with me.
>
> It seems strange that this cannot be specified in the MEI itself - after
> all, you can specify system breaks.
>
> Best wishes,
> Reinier
>
> Op ma 1 jul. 2019 om 18:10 schreef Klaus Rettinghaus <
> klaus.rettinghaus at gmail.com>:
>
>> Hi Reinier,
>>
>> this is not a MEI question, but a Verovio question.
>> You probably want to check the options there:
>> https://www.verovio.org/command-line.xhtml
>>
>> Klaus
>>
>> Am 01.07.2019 um 18:57 schrieb Reinier de Valk <reinierdevalk at gmail.com>:
>>
>> Hi all,
>>
>> There is probably a simple answer tothis, but I could not find it in the
>> documentation.
>>
>> Is there a way to force a certain amount of bars onto a single system? I
>> am rendering my MEI using the online Verovio viewer, and the individual
>> bars are spaced very widely.
>>
>> Thanks,
>> Reinier
>> _______________________________________________
>> mei-l mailing list
>> mei-l at lists.uni-paderborn.de
>> https://lists.uni-paderborn.de/mailman/listinfo/mei-l
>>
>>
>> _______________________________________________
>> mei-l mailing list
>> mei-l at lists.uni-paderborn.de
>> https://lists.uni-paderborn.de/mailman/listinfo/mei-l
>>
> _______________________________________________
> mei-l mailing list
> mei-l at lists.uni-paderborn.de
> https://lists.uni-paderborn.de/mailman/listinfo/mei-l
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.uni-paderborn.de/pipermail/mei-l/attachments/20190701/488c6bde/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screen Shot 2019-07-01 at 9.25.01 PM.png
Type: image/png
Size: 32261 bytes
Desc: not available
URL: <http://lists.uni-paderborn.de/pipermail/mei-l/attachments/20190701/488c6bde/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screen Shot 2019-07-01 at 9.46.48 PM.png
Type: image/png
Size: 42460 bytes
Desc: not available
URL: <http://lists.uni-paderborn.de/pipermail/mei-l/attachments/20190701/488c6bde/attachment-0001.png>


More information about the mei-l mailing list