music-encoding / music-encoding

美 The Music Encoding Initiative schema and guidelines development repository
https://music-encoding.org
Educational Community License v2.0
209 stars 68 forks source link

Suggestion: `@tgrp` for horizontal shifting and alignment of notes in polyphony #705

Open th-we opened 4 years ago

th-we commented 4 years ago

@tgrp is mainly intended for polyphonic situations where elements like notes/chords/rests as well as augmentation dots and accidentals need to be shifted to avoid collisions and/or to achieve a sensible alignment or a sensible accidental stacking.

This attribute takes inspiration from @vgrp. It is evaluated on a timestamp-by-timestamp basis. The implied default value is 0. The elements are ordered in ascending order of their @tgrp value from left to right. This means especially, if @tgrp is negative, elements occur left of the timestamp onset.

Why not @ho?

I fully agree with @zolaemil that the definition and usefulness of @ho are questionable "for 'programatically-determined position' is practically an undefined position". There is a related discussion here that was closed without really reaching a conclusion.

Disadvantages of @ho are:

Suggested operating principle

Examples with encoding suggestions

Example 1

J. S. Bach: Violin Sonata III, Fuga, UE 6976, p. 18

<layer>
   <chord dur="8" stem.dir="up" tgrp="0">
      <note pname="e" oct="5"/>
      <note pname="a" oct="4"/>
   </chord>
   <space dur="8"/>
   <space dur="8"/>
   <chord dur="8" stem.dir="up" tgrp="0">
      <note pname="e" oct="5"/>
      <note pname="a" oct="4"/>
   </chord>
</layer>
<layer>
   <beam place="above">
      <note pname="g" oct="4" dur="8" tgrp="1"/>
      <note pname="g" oct="4" dur="16"/>
      <note pname="f" oct="4" dur="16"/>
   </beam>
   <beam place="below">
      <note pname="g" oct="4" dur="8"/>
      <note pname="e" oct="4" dur="8" tgrp="-1"/>
   </beam>
</layer>
<layer>
   <note pname="c" oct="4" accid="s" dur="8" stem.dir="down" tgrp="0"/>
   <space dur="8"/>
   <space dur="8"/>
   <note pname="a" oct="4" dur="8" accid.ges="s" stem.dir="down" tgrp="0"/>
</layer>

Example 2

J. S. Bach: Cello Suite V, Allemande, Neue Bach-Ausgabe p. 110

Encoding of first beat:

<layer>
   <beam place="above">
      <note pname="c" oct="5" dur="8" tgrp="0">
         <dot tgrp="0"/>
      </note>
      <note pname="b" oct="4" dur="16"/>
   </beam>
</layer>
<layer>
   <note pname="e" oct="4" dur="8" stem.dir="up" tgrp="1">
      <dot tgrp="1"/>
   </note>
   <space dur="16"/>
</layer>
<layer>
   <note pname="a" oct="3" dur="4" tgrp="0">
      <dot tgrp="0"/>
   </note>
   <space dur="16"/>
</layer>

Example 3

J. S. Bach: Cello Suite V, Allemande, Bach-Gesellschaft-Ausgabe, p. 84

Encoding of first beat:

<layer>
   <note pname="c" oct="6" dur="4" stem.dir="up" tgrp="0"/>
</layer>
<layer>
   <note pname="d" oct="5" dur="4" stem.dir="up" tgrp="1">
      <accid accid="s" tgrp="-2"/>
   </note>
</layer>
<layer>
   <note pname="f" oct="4" dur="4" stem.dir="up" tgrp="2">
      <accid accid="n" tgrp="-1"/>
   </note>
</layer>
<layer>
   <note pname="a" oct="3" dur="4" stem.dir="up" tgrp="3"/>
</layer>

Example 4

https://www.stringsbymail.com/articles/?p=1017&page=4/

Encoding of first eighth:

<layer>
   <beam place="above">
      <note pname="g" oct="5" dur.ges="16" tgrp="0">
         <dot tgrp="2"/>
      </note>
      <note pname="a" accid="n" dur.ges="16"/>
   </beam>
</layer>
<layer>
   <chord dur.ges="16" tgrp="1" stem.dir="up" tgrp="1">
      <note pname="c" oct="5">
         <dot tgrp="2"/>
      </note>
      <note pname="e" oct="4" accid="n">
         <dot tgrp="2"/>
      </note>
   </chord>
   <rest dur="32" sameas="#m7-l3-rest1"/>
</layer>
<layer>
   <note pname="g" oct="3" dur="16" stem.dir="down" tgrp="0">
      <dot tgrp="0"/>
   </note>
   <rest dur="32" xml:id="m7-l3-rest1"/>
</layer>

Example 5a

Engraving example by Karl Hader:

Karl Hader: Aus der Werkstatt eines Notenstechers, p. 64

<staff n="1">
   <layer>
      <rest dur="8"/>
      <beam place="above">
         <chord dur="8" artic="stacc">
            <note pname="g" oct="4"/>
            <note pname="f" oct="4"/>
            <note pname="e" oct="4">
               <accid accid="f" tgrp="-1"/>
            </note>
            <note pname="d" oct="4">
               <accid accid="f" tgrp="-2"/>
            </note>
            <note pname="c" oct="4">
               <accid accid="f" tgrp="-3"/>
            </note>
         </chord>
         <chord dur="8" artic="stacc" staff="2">
            <note pname="e" oct="4">
               <accid accid="n" tgrp="-1"/>
            </note>
            <note pname="d" oct="4">
               <accid accid="n" tgrp="-2"/>
            </note>
            <note pname="c" oct="4">
               <accid accid="n" tgrp="-3"/>
            </note>
            <note pname="b" oct="3">
               <accid accid="f" tgrp="-4"/>
            </note>
            <note pname="a" oct="3">
               <accid accid="f" tgrp="-5"/>
            </note>
         </chord>
         <chord dur="8" artic="stacc">
            <note pname="e" oct="4">
               <accid accid="s" tgrp="-1"/>
            </note>
            <note pname="d" oct="4">
               <accid accid="s" tgrp="-2"/>
            </note>
            <note pname="c" oct="4">
               <accid accid="s" tgrp="-3"/>
            </note>
            <note pname="b" oct="3">
               <accid accid="n" tgrp="-4"/>
            </note>
            <note pname="a" oct="3">
               <accid accid="n" tgrp="-5"/>
            </note>
         </chord>
         <chord dur="8" artic="stacc" staff="2">
            <note pname="e" oct="4">
               <accid accid="n" tgrp="-1"/>
            </note>
            <note pname="d" oct="4">
               <accid accid="n" tgrp="-2"/>
            </note>
            <note pname="c" oct="4">
               <accid accid="n" tgrp="-3"/>
            </note>
            <note pname="b" oct="3">
               <accid accid="f" tgrp="-4"/>
            </note>
            <note pname="a" oct="3">
               <accid accid="f" tgrp="-5"/>
            </note>
         </chord>
         <chord dur="8" artic="stacc">
            <note pname="g" oct="4"/>
            <note pname="f" oct="4"/>
            <note pname="e" oct="4">
               <accid accid="f" tgrp="-1"/>
            </note>
            <note pname="d" oct="4">
               <accid accid="f" tgrp="-2"/>
            </note>
            <note pname="c" oct="4">
               <accid accid="f" tgrp="-3"/>
            </note>
         </chord>
      </beam>
   </layer>
</staff>
<staff n="2">
   <layer>
      <chord stem.dir="down" dur="2" dots="1">
         <note pname="c" oct="3" accid="f"/>
         <note pname="f" oct="2" accid="f"/>
      </chord>
   </layer>
</staff>

Example 5b

Same example with Sibelius' default accidental arrangement:

grafik

<staff n="1">
   <layer>
      <rest dur="8"/>
      <beam place="above">
         <chord dur="8" artic="stacc">
            <note pname="g" oct="4"/>
            <note pname="f" oct="4"/>
            <note pname="e" oct="4">
               <accid accid="f" tgrp="-1"/>
            </note>
            <note pname="d" oct="4">
               <accid accid="f" tgrp="-3"/>
            </note>
            <note pname="c" oct="4">
               <accid accid="f" tgrp="2"/>
            </note>
         </chord>
         <chord dur="8" artic="stacc" staff="2">
            <note pname="e" oct="4">
               <accid accid="n" tgrp="-1"/>
            </note>
            <note pname="d" oct="4">
               <accid accid="n" tgrp="-3"/>
            </note>
            <note pname="c" oct="4">
               <accid accid="n" tgrp="-5"/>
            </note>
            <note pname="b" oct="3">
               <accid accid="f" tgrp="-4"/>
            </note>
            <note pname="a" oct="3">
               <accid accid="f" tgrp="-2"/>
            </note>
         </chord>
         <chord dur="8" artic="stacc">
            <note pname="e" oct="4">
               <accid accid="s" tgrp="-1"/>
            </note>
            <note pname="d" oct="4">
               <accid accid="s" tgrp="-3"/>
            </note>
            <note pname="c" oct="4">
               <accid accid="s" tgrp="-5"/>
            </note>
            <note pname="b" oct="3">
               <accid accid="n" tgrp="-4"/>
            </note>
            <note pname="a" oct="3">
               <accid accid="n" tgrp="-2"/>
            </note>
         </chord>
         <chord dur="8" artic="stacc" staff="2">
            <note pname="e" oct="4">
               <accid accid="n" tgrp="-1"/>
            </note>
            <note pname="d" oct="4">
               <accid accid="n" tgrp="-3"/>
            </note>
            <note pname="c" oct="4">
               <accid accid="n" tgrp="-5"/>
            </note>
            <note pname="b" oct="3">
               <accid accid="f" tgrp="-4"/>
            </note>
            <note pname="a" oct="3">
               <accid accid="f" tgrp="-2"/>
            </note>
         </chord>
         <chord dur="8" artic="stacc">
            <note pname="g" oct="4"/>
            <note pname="f" oct="4"/>
            <note pname="e" oct="4">
               <accid accid="f" tgrp="-1"/>
            </note>
            <note pname="d" oct="4">
               <accid accid="f" tgrp="-3"/>
            </note>
            <note pname="c" oct="4">
               <accid accid="f" tgrp="-2"/>
            </note>
         </chord>
      </beam>
   </layer>
</staff>
<staff n="2">
   <layer>
      <chord stem.dir="down" dur="2" dots="1">
         <note pname="c" oct="3" accid="f"/>
         <note pname="f" oct="2" accid="f"/>
      </chord>
   </layer>
</staff>
bwbohl commented 2 years ago

would this just introduce @tgrp or also remove @ho?