rettinghaus / MEILER

MEI Lilypond Engraving Refinement
MIT License
20 stars 7 forks source link

Escape strings #1

Open th-we opened 8 years ago

th-we commented 8 years ago

Not escaping quotes will lead to syntax errors in Lilypond (see added test file)

rettinghaus commented 8 years ago

Intention again: You shouldn't use ascii quotes but proper typographic ones. (Same with lyrics.)

th-we commented 8 years ago

Are you sure? Then we'd also have to detect the language to decide which typographical quotes to use. And according to Wikipedia, there are three possibilities in German, one being specific to Swiss German. There are also cases where " might not even represent quotes - most famously John Cage's 4′33″. Or " might stand for a pitch in Helmholtz notation in something like Studie von c′ bis c″.

My take on this is that the encoder should input the typographical quotes (or prime symbols) in MEI.

rettinghaus commented 8 years ago

This is utf8, so typographical quotes just work. Try this one: „ “ » « ‚ ‘ ”…” But on Cage your absolutely correct!

th-we commented 8 years ago

So what do you think? I don't believe there is a sound solution for properly detecting when to substitute what type of typographical quotes. If the MEI file contains typographical quotes, they will be passed through to Lilypond just fine, like so:

<mei xmlns="http://www.music-encoding.org/ns/mei" meiversion="3.0.0">
   <meiHead>
     <fileDesc>
       <titleStmt>
         <title></title>
       </titleStmt>
       <pubStmt></pubStmt>
     </fileDesc>
     <workDesc>
       <work>
         <titleStmt>
           <title>„ “ » « ‚ ‘ “…”</title>
         </titleStmt>
       </work>
     </workDesc>
   </meiHead>
   <music>
      <body>
         <mdiv>
            <score>
               <scoreDef meter.count="4" meter.unit="4">
                  <staffGrp>
                     <staffDef n="1" clef.line="2" clef.shape="G" lines="5"/>
                  </staffGrp>
               </scoreDef>
               <section>
                  <measure n="1">
                     <staff n="1">
                        <layer n="1">
                           <note pname="g" oct="4" dur="1"/>
                        </layer>
                     </staff>
                  </measure>
               </section>
            </score>
         </mdiv>
      </body>
   </music>
</mei>