w3c / musicxml

MusicXML specification
479 stars 56 forks source link

C-clef: support space positioning #440

Open tbradsha opened 2 years ago

tbradsha commented 2 years ago

In sheet music, a C-clef can be positioned on spaces, although rare. However, in MusicXML, only lines are supported, and the content of <line> is a staff-line-position, which is an integer.

This is typically found in vocal parts, and often is referred to as a tenor clef (not to be confused with the more common C-clef also referred to as tenor clef on the fourth line).

I'd want to do something like this:

<clef>
   <sign>C</sign>
   <line>3.5</line>
</clef>

Alternatively, perhaps a <space> element could be considered (still forcing an integer value):

<clef>
   <sign>C</sign>
   <space>3</space>
</clef>

Note that this is musically equivalent to the octave-down treble/vocal tenor clef, though with a different symbol:

<clef>
   <sign>G</sign>
   <line>2</line>
   <clef-octave-change>-1</clef-octave-change>
</clef>

That said, it'd be good to be able to accurately represent clefs in the digital world as transcribed on paper. Some references: https://books.google.com/books?id=TH1BAQAAMAAJ&pg=PA44 https://en.wikipedia.org/wiki/Clef#Other_clefs https://musescore.org/en/node/73221 https://music.stackexchange.com/a/90180

tbradsha commented 2 years ago

Example: image

https://media.ldscdn.org/pdf/music/hymns/2001-01-3370-o-home-beloved-mens-choir-eng.pdf

mscuthbert commented 2 years ago

I have definitely seen this. The issue to consider is what is the best fallback for consumers that cannot parse the new syntax? My guess is it is to use a Treble 8vb clef (and not to write it as alto or tenor clef). That suggests to me that the most backwards compatible way is to do something awkward like:

<clef>
   <sign>G</sign>
   <line>2</line>
   <clef-octave-change>-1</clef-octave-change>
   <replace-with-equivalent-sign>C</replace-with-equivalent-sign>
</clef>

But if we're only looking forward, then line 3.5 is the best solution.

mdgood commented 2 years ago

You can do this in MusicXML 4.0 using the <glyph> element:

<defaults>
  <appearance>
     <glyph type="g-clef-ottava-bassa">cClef</glyph>
  </appearance>
</defaults>
<clef>
   <sign>G</sign>
   <line>2</line>
   <clef-octave-change>-1</clef-octave-change>
</clef>

The notation software would likely need to special-case this situation so that it puts the C clef in the correct space.

tbradsha commented 2 years ago

In the <glyph> example, how would one differentiate between a C clef on line 3 vs on line 3.5?

mdgood commented 2 years ago

@tbradsha I don't think I am understanding the question. The <glyph> element example in my reply is instructing the software to replace any octave-down treble clefs with a C clef glyph. That sign would have to go 1.5 lines above the G clef line since the difference is 3 diatonic steps, and that is the special case I was mentioning. This element would have no effect on any regular C clefs.

tbradsha commented 2 years ago

I suppose if the software had that special case, then yes, it'd solve it, though in my ideal world a solution wouldn't be edge case, but instead would support C-clef positioning in all valid locations (technically by definition it could go on any line or space).

mscuthbert commented 1 year ago

You can do this in MusicXML 4.0 using the <glyph> element:

<defaults>
  <appearance>
     <glyph type="g-clef-ottava-bassa">cClef</glyph>
  </appearance>
</defaults>
<clef>
   <sign>G</sign>
   <line>2</line>
   <clef-octave-change>-1</clef-octave-change>
</clef>

The notation software would likely need to special-case this situation so that it puts the C clef in the correct space.

I'm not sure I like this approach as much, because in the case where the glyph is not placed properly the entire musical layout is incorrect for the reader. That's worse than not showing the glyph sign at all. And with resized clefs (such as a mid-system clef change) the odds of this getting done correctly are very low. I want to come up with a workaround that doesn't involve an additional tag .

Since <clef> can appear more than one time, the work around may be this:

<clef print-object="no">
   <sign>G</sign>
   <line>2</line>
   <clef-octave-change>-1</clef-octave-change>
</clef>
<clef additional="yes" relative-y="5">
   <sign>C</sign>
   <line>3</line>
</clef>

Note that the documentation currently says that for additionals: "Sometimes clefs are added to the staff in non-standard line positions, either to indicate cue passages, or when there are multiple clefs present simultaneously on one staff, the additional attribute is set to "yes" and the line value is ignored" -- I'm not sure what this means -- what line would it be put on? I'm guessing it to mean "the clef does not control the display of notes"?