[MEI-L] coordinates

TW zupftom at googlemail.com
Fri Feb 25 10:54:29 CET 2011


2011/2/24 Johannes Kepper <kepper at edirom.de>:
> Hi Thomas,
>
> Am 24.02.2011 um 12:28 schrieb TW:
>
>> Thanks Johannes, Andrew and Roland,
>>
>> 2011/2/23 Johannes Kepper <kepper at edirom.de>:
>>> MEI has different approaches to graphics. When you plan to describe an existing image, you should use the @facs-attribute and refer to a zone-element in facsimile (sibling of body). I don't think that this is what you're looking for, but it is surely the better established way to deal with graphics in MEI.
>>
>> You're right, I'm more interested in data that allows reproducing the
>> graphics and is editable (i.e. no preexisting image).  That's probably
>> not what MEI is designed for.  I'm looking for inspiration from
>> existing music encoding solutions and whether one already covers
>> everything that might be needed or whether it can be extended to do
>> so.  So all my comments are from this perspective.  I have only a
>> vague idea of what MEI has to accomplish from the musicologist's
>> perspective.
>>
>> I'll just go ahead and write down questions and things that came to my
>> mind while reading in the documentation.
>>
>>
>> 2011/2/23 Andrew Hankinson, Mr <andrew.hankinson at mail.mcgill.ca>:
>>> Basically, within facsimile you define a number of bounding boxes using <zone>, defined by ulx,uly/lrx,lry coordinates. These all have a unique ID. Then on every musical element, you use the @facs attribute to refer to the unique ID of the corresponding zone.
>>
>> I'm not sure whether I understand the <facsimile> element correctly.
>> Where do the <graphic>s come into play?  Both <surface> and <zone> can
>> hold <graphic>s, so is a <surface> meant to hold a single <graphic>
>> for the whole "page", or are the <zones> meant to hold <graphic>s that
>> in combination make up the page?  Or are both approaches valid?
>>
>
> Normally you have one facsimile for each source you want to encode.

If you have multiple sources for am piece, would one encode each one
separately?  Would you have one MEI file for each source and another
one for a potential edited version?  How do you link them together?

> Within <surface> you'll typically find one <graphic> that points to a digital image of that page (multiple graphics for different kinds of images like x-ray…).

I didn't understand the x-ray part.  Do you mean that one image
"shines through" the others?

>> What about vector graphics?  If you have the facsimile e.g. as SVG
>> data, would it be possible to provide it with @xml:id attributes and
>> point to those using @facs attributes?  If I understand the XML specs
>> correctly, then an IDREF can only reference an element in the same
>> file.  As far as I can see, MEI can only reference graphics as
>> external files, not embed them.
>
> You can refer to a SVG instead of a JPG without any problems. You could also include SVGs within <surface> in order to get non-rectangular <zones>. This needs only little customization and is the intended way to go. I hope we have the time to prepare such a customization for the next release.
>

That's not really what I meant.  SVG can be structured, and the
individual graphical elements (like notes, rests, clefs etc.) can be
addressed directly using @xml:id attributes.  That's much better than
rectangular <zones>, as the rectangle may contain elements that don't
really belong to what the <zone> is meant to represent (e.g. the
bounding box of a slur can be very large, in the worst case it could
even encompass virtually everything that's on a staff).

Here's an example of what I mean (please ignore what's in there
musically, e.g. there are no proper time/key signatures):

<?xml version="1.0"?>
<mei xmlns="http://www.music-encoding.org/ns/mei">
  <meihead>
    What's a minimal mei header?
  </meihead>
  <music>
    <body>
      <mdiv>
        <score>
          <scoredef key.sig="0" meter.count="4" meter.unit="4">
            <staffdef n="1"/>
          </scoredef>
          <section facs="example">
            <measure facs="measure1">
              <staff n="1" facs="staff1">
                <layer>
                  <note pname="c" oct="4" dur="4" dots="1" facs="note1"/>
                  <note pname="d" dur="8" facs="note2"/>
                  <note pname="e" accid="f" dur="4" facs="note3"/>
                  <note pname="c" facs="note4"/>
                </layer>
              </staff>
            </measure>
            <measure facs="measure2">
              <staff facs="staff1">
                <layer>
                  <note pname="g" accid="f" dur="1" facs="note5"/>
                </layer>
              </staff>
            </measure>
          </section>
        </score>
      </mdiv>
    </body>
    <facsimile>
      <surface>
        <graphic>
          <svg xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="350"
height="160" viewBox="0 0 350 160">
            <defs class="used-symbols">
              <g id="treble-clef" stroke="black" stroke-width="5"
fill-rule="evenodd" transform="scale(.035)">
                <path d="M65 -172L100 28L102 47L101 57L99 63L97 67L93
73L87 79L82 82L75 84L69 85L64 85L54 84L49 83L45 81L46 75L50 76L52
76L56 75L60 73L63 71L66 68L69 63L70 60L71 55L71 53L70 48L67 42L65
40L61 37L59 36L53 34L48 34L43 35L38 37L35 39L32 42L29 47L28 50L27
55L27 59L28 65L30 70L33 75L38 80L42 83L49 86L54 87L64 88L67 88L75
87L80 86L85 84L90 81L97 74L101 68L104 59L105 55L106 46L104 28L69
-172L65 -172" fill="black"/>
                <path d="M58 -4L71 -3L79 -3L90 -4L96 -5L102 -7L110
-11" fill="none"/>
                <path d="M110 -11L117 -18L119 -21L122 -26L124 -31L125
-34L126 -38L127 -45L127 -50L126 -56L125 -60L123 -65L119 -71L116
-74L112 -77L107 -80L102 -82L98 -83L89 -84L88 -84L79 -83L71 -81L67
-79L61 -75L57 -70L55 -66L53 -61L52 -53L53 -46L55 -41L58 -36L62 -32L71
-26L70 -25L60 -30L56 -33L51 -38L46 -45L43 -53L42 -60L42 -65L43 -71L44
-75L47 -82L50 -87L53 -91L58 -96L64 -101L69 -104L73 -106L82 -108L86
-108L96 -107L103 -105L110 -102L117 -98L124 -91L129 -84L133 -76L135
-69L136 -63L136 -57L135 -49L134 -44L132 -37L129 -31L126 -26L122
-21L117 -16L110 -11" fill="black"/>
                <path d="M58 -4L52 -5L44 -7L38 -9L30 -13L26 -16L20
-21L15 -26L10 -33L6 -41L3 -49L1 -58L0 -67L0 -77L2 -92L5 -104L9 -114L14
-124L21 -133L30 -143L47 -159L58 -169L83 -193L94 -206L100 -216L104
-225L106 -231L108 -239L109 -248L109 -254L108 -261L107 -264L113
-268L115 -260L116 -254L117 -245L117 -243L116 -229L115 -223L113
-214L110 -203L106 -193L101 -183L94 -171L83 -158L46 -123L35 -111L29
-103L23 -93L21 -89L18 -82L16 -75L15 -66L15 -59L16 -50L18 -42L21 -34L26
-25L30 -20L35 -15L40 -11L46 -8L51 -6L58 -4" fill="black"/>
                <path d="M65 -172L61 -200L60 -219L60 -234L62 -253L64
-262L67 -270L71 -277L76 -284L81 -290L89 -298L93 -300L94 -300L96
-299L101 -293L107 -282L113 -268L107 -264L105 -269L102 -273L99 -274L98
-274L94 -273L93 -272L90 -270L86 -266L79 -256L73 -244L70 -236L67
-222L66 -211L66 -204L67 -189L69 -172L65 -172" fill="black"/>
              </g>
              <g id="flat" stroke="black" stroke-width="5"
transform="scale(.035)" fill-rule="evenodd">
                <path d="M-60 -98L-60 39" fill="none"/>
                <path d="M-60 -11L-54 -20" fill="none"/>
                <path d="M-54 -20L-48 -26L-42 -28L-35 -28L-29 -26L-26
-23L-24 -19L-23 -14L-23 -5L-25 3L-29 11L-34 17L-40 23L-60 39L-46
25L-40 17L-36 9L-34 0L-34 -13L-35 -18L-37 -21L-41 -23L-47 -23L-54 -20"
fill="black"/>
              </g>
              <g id="filled-notehead" stroke="black" stroke-width="5"
fill-rule="evenodd" transform="scale(.035)" >
                <path d="M19 27L26 27L32 26L41 23L49 19L56 14L59 11L64
5L67 -1L68 -7L68 -11L67 -15L66 -17L63 -21L59 -24L57 -25L54 -26L49
-27L42 -27L36 -26L30 -24L27 -23L19 -19L12 -14L9 -11L4 -5L1 1L0 7L0
11L1 15L2 17L5 21L9 24L11 25L14 26L19 27" fill="black"/>
              </g>
              <g id="whole-notehead" stroke="black" stroke-width="5"
transform="scale(.035)" fill-rule="evenodd">
                <path d="M35 -27L27 -26L19 -24L14 -22L9 -19L6 -16L3
-12L1 -8L0 -3L0 3L1 8L3 12L6 16L9 19L14 22L19 24L27 26L35 27L42 27L50
26L58 24L63 22L68 19L71 16L74 12L76 8L77 3L77 -3L76 -8L74 -12L71
-16L68 -19L63 -22L58 -24L50 -26L42 -27L35 -27M34 -26L28 -25L25 -24L22
-22L20 -20L18 -17L17 -13L17 -9L18 -3L20 5L22 11L25 18L27 21L29 23L33
25L38 26L43 26L49 25L52 24L55 22L57 20L59 17L60 13L60 9L59 3L57 -5L55
-11L52 -18L50 -21L48 -23L44 -25L39 -26L34 -26" fill="black"/>
              </g>
              <g id="flag" stroke="black" stroke-width="5" fill-rule="evenodd">
                <path id="subflag" stroke-width="5"
transform="translate(0,-6) scale(.035) " stroke="black" d="M59 16L60
22L61 36L61 41L60 52L59 58L56 68L53 75L50 81L46 87L41 93L36 98L30
103L21 109L11 114L0 118L0 172L3 160L4 157L6 152L10 144L13 139L16
135L21 129L32 117L36 113L43 105L47 100L51 94L55 87L58 80L60 74L62
66L63 60L64 48L64 37L63 26L62 19L61 14L60 10L59 16" fill="black"/>
                <path transform="translate(0,-6) scale(.035) " d="M62
19L61 14L60 10L58 3L54 -8L56 -1L57 4L58 9L59 16L60 22L62 19"
fill="black"/>
              </g>
            </defs>
            <g class="page" xml:id="example"><rect fill="#fffffc"
height="160" stroke="black" width="350" x="0" y="0"><g x="0" x1="0"
x2="350" y="0" y1="0" y2="160"/></rect>
              <g class="system">
                <g class="staff" xml:id="staff1"><g class="stafflines"
stroke="black"><line x1="30" x2="320" y1="90" y2="90"/><line x1="30"
x2="320" y1="82" y2="82"/><line x1="30" x2="320" y1="74"
y2="74"/><line x1="30" x2="320" y1="66" y2="66"/><line x1="30"
x2="320" y1="58" y2="58"/></g>
                  <g class="clef"><use xlink:href="#treble-clef"
transform="translate(38,90) scale(4)"/></g>
                  <g class="measure" xml:id="measure1"/>
                    <g class="note" xml:id="note1"><path
class="ledgerlines" fill="none" stroke="black" d="M66 98h18"/>
                      <g class="stem"><line stroke="black" x1="80"
x2="80" y1="98" y2="70"/></g>
                      <g class="head"><use
xlink:href="#filled-notehead" transform="translate(70,98) scale(4)"/>
                        <g class="dots"><circle cx="87" cy="94" r="1.6"/></g>
                      </g>
                    </g>
                    <g class="note" xml:id="note2">
                      <g class="head"><use
xlink:href="#filled-notehead" transform="translate(110,94)
scale(4)"/></g>
                      <g class="stem"><line stroke="black" x1="120"
x2="120" y1="94" y2="66"/>
                        <g class="flags"><use xlink:href="#flag"
transform="translate(120,66) scale(4,-4)"/></g>
                      </g>
                    </g>
                    <g class="note" xml:id="note3">
                      <g class="head"><use
xlink:href="#filled-notehead" transform="translate(146,90)
scale(4)"/></g>
                      <g class="stem"><line stroke="black" x1="156"
x2="156" y1="90" y2="62"/></g>
                      <g class="accidental"><use xlink:href="#flat"
transform="translate(146,90) scale(4)"/></g>
                    </g>
                    <g class="note" xml:id="note4"><path
class="ledgerlines" fill="none" stroke="black" d="M178 98h18"/>
                      <g class="stem"><line stroke="black" x1="192"
x2="192" y1="98" y2="70"/></g>
                      <g class="head"><use
xlink:href="#filled-notehead" transform="translate(182,98)
scale(4)"/></g>
                    </g>
                    <g class="barline"><line stroke="black" x1="230"
x2="230" y1="90" y2="58"/></g>
                  </g>
                  <g class="measure" xml:id="measure2">
                    <g class="note" xml:id="note5">
                      <g class="head"><use
xlink:href="#whole-notehead" transform="translate(254,82)
scale(4)"/></g>
                      <g class="accidental"><use xlink:href="#flat"
transform="translate(254,82) scale(4)"/></g>
                    </g>
                    <g class="barline"><rect fill="black" height="32"
width="4.8" x="315.2" y="58"/><line stroke="black" x1="312.8"
x2="312.8" y1="90" y2="58"/></g>
                  </g>
                </g>
              </g>
            </g>
          </svg>
        </graphic>
      </surface>
    </facsimile>
  </music>
</mei>


This is my first attempt at MEI and I don't know whether it would be a
correct MEI file.  (I was too lazy to find out what exactly is needed
in the header as it's not really the point here.)

>
> Definitely a good point. As Perry already mentioned, MEI is primarily tailored to describe preexisting notation, whereas output description is surely treated somewhat "stepmotherly". There is definitely room for improvement, and I'm sure to speak for the whole community when saying that help on this is more than welcome…

I'm happy to help if I can.

> (Though I have to admit that a possible direction of this (interchange between multiple scorewriters) is probably not the foremost goal of MEI)
>

Is the generation of presentable graphics from MEI, be it for
electronic display or print, a set goal?

Thomas Weber



More information about the mei-l mailing list