humdrum-tools / verovio-humdrum-viewer

Verovio Humdrum Viewer
http://verovio.humdrum.org
37 stars 9 forks source link

Create modern/original clef/key/time signature/mensuration system #337

Closed craigsapp closed 2 years ago

craigsapp commented 4 years ago

Currently original clefs can be encoded by adding o in front of the clef, such as *oclefC3 in a modern score. It would be useful to have an equivalent method for encoding the modern clef in an original (diplomatic) score, such as *mclefG2 to indicate that a modern edition of the score should display the music in G2 clef rather than C3 clef.

This would also apply to key, where *ok[] is the original key, and *mk[] is the modern key.

This can also apply to mensurations and time signatures, although this will need some more thought, since the mensuration is typically original, and the time signature is modern (so they may need to switch in pairs).

Here is an example original score:

**kern
*clefC3
*mclefG2
*k[b-]
*mk[b-e-]
=1
1D
=
*-

The presence of *mclef implies that *clef is an original clef, and likewise *mk[] implies that *k[] is the original key. When such a pairing is identified, then a tool to switch between modern and original notations can be written. This can speed up generation and/or automation of modern scores for diplomatic edition, since the original editor of the diplomatic score can specify in advance what the modern key/clef/time signature should be.

The tool would convert the above score to modern format:

**kern
*oclefC3
*clefG2
*ok[b-]
*k[b-e-]
=1
1D
=
*-

And the process would be reversible to get back to the original key and clef. Only the *clef and *k[] versions of the clef and key would be displayed.

A possible name for the tool/filter to switch between the two score type could be oldnew with options to select which version to generate. Alternately or in addition, there could be two subtools/filters: old2new and new2old.

craigsapp commented 3 years ago

A filter called modori has been created to allow easy switching between modern and original clefs, key signatures and mensuration/time signatures within the same digital score.

For key signatures, there are three possible types:

example meaning
*k[b-] the displayed key signature has one flat
*ok[b-] the original key signature in the source has one flat, but will not be used for display (the modern key signature is in *k)
*mk[b-] the modern key signature has one flat, but will not be used for display (the original key signature is in *k).

For clefs, there are also three similar possibilties:

example meaning
*clefG2 the displayed clef is G2
*oclefG2 the original clef is G2 in the source but will not be used for display (the modern clef is in *clef)
mclefG2 the modern clef is G2 but will not be used for display (the original clef is in *clef)
For mensurations, there are two possibilities: example meaning
*met(O) the displayed mensuration (metric signature). The associated time signature will be suppressed.
*omet(O) the original mensuration is circle mensuration, but it is not displayed (time signature will be displayed instead).

Metric signatures such as common-time (*met(c)) and cut-time (*met(c|)) cannot currently be used with this system.


Examples:

**kern
*oclefC3
*clefG2
*ok[b-]
*k[b-e-]
*omet(C|)
*M2/2
=1
1B-
=|
*ok[b-]
*k[]
1c
=
*-

By defualt the above data will show the "modern" clef/key/ /time signature:

Screen Shot 2020-12-18 at 12 16 14 AM

To display the original clef/key/mensuration, add the filter:

!!!filter: modori -o
Screen Shot 2020-12-18 at 12 17 21 AM

Now the "original" clef/key/mensuration are shown instead of the "modern" ones.

You can compile the filter to view the digital score in the "original" form:

Screen Shot 2020-12-18 at 12 18 18 AM

Notice that there are *mclef, *mk interpretations that are converted from the original *clef and *k interpretations, and the *oclef and *ok are converted to *clef and *k. This format can be used to encode a diplomatic version of the source.

To convert the diplomatic encoding to modern form, add the line:

!!!filter: modori -m
Screen Shot 2020-12-18 at 12 20 29 AM

There are three additional options that prevent converting of the clef, key, or mensuration/time signatures.

option meaning
-C do not convert clefs between original/modern display
-K do not convert key signatures between original/modern display
-M do not convert between mensuration and time signature display

For example, the filter:

!!!filter: modori -Mm

Means display modern clefs and keys, but preserve the mensurations and do not display the equivalent time signatures (only change to modern key signature):

Screen Shot 2020-12-18 at 12 23 38 AM

Here is an example of keeping the original clef and the mensuration signs:

Screen Shot 2020-12-18 at 12 24 09 AM

There must be a pair of key signature or clef interpretations, such as *k and *ok or *k and *mk at every time point that has a key signature. If there is not a pair, then there will be no conversion of the key signature or clef (the display key signature/clef will remain a display key signature/clef).

jacekiwaszko1 commented 2 years ago

Would it be possible to allow for encoding of modernized time signatures such as C and cut-C in *mmet()?

craigsapp commented 2 years ago

Do you mean to have *mmet(c|) and *omet(C|)?

jacekiwaszko1 commented 2 years ago

Yes, this is one of the cases where we would need that. The other is when there are both C and cut-C notated in different parts of the same composition - modernised score should have that unified.

craigsapp commented 2 years ago

OK, that should be possible.

craigsapp commented 2 years ago

Implemented with commit https://github.com/craigsapp/humlib/commit/9618ad1baf1068cf32480da08be5fd3f5844d997

Example:

Screen Shot 2022-06-08 at 12 12 05 PM
**kern
*clefC3
*mclefG2
*M4/4
*met(C|)
*mmet(c)
=1
2c
2d
=2
2e
2f
=3
2g
2a
==
*-

Running modori -m on the switches to the "modern" mensuration sign:

Screen Shot 2022-06-08 at 12 12 28 PM
craigsapp commented 2 years ago

And back again to the original format:

Screen Shot 2022-06-08 at 12 36 39 PM