The modori (“MODern/ORIginal”) filter allows encoding both a “modern” and “original” edition in the same Humdrum file. The filter can reversibly switch between these two views of the score by using either the -m or -o option. On a diplomatically-encoded score modori features, running modori -m will generate the “modern” view of a score. And modori -o will recover the “original” diplomatic score.



Clef interpretations such as *clefG2 can be additionally encoded as *mclefG2 and *oclefG2: prefixing by m indicates a “modern” clef and prefixing by o for an “original” clef.

To use the modori filter to encode a diplomatic score, encode the visual clef with *clef and the modernized clef with *mclef:

Then the filter modori -m will instead display the modern clef:

The result of the filter will change *clef to *oclef and *mclef to *clef:

If there are no *mclef or oclef that can pair with the *clef, then the clef will not be changed:

Key signatures

Similar to clefs, m and o prefixes for key signatures can be used to select between modern and original key signatures.

Switching to the modern score:

This will create the “modern” view of the score:

which can be reverted to the “original” score with the modori -o filter:

Mensuration signs / Time signatures

When encoding mensuration signs, a time signature is also required. Running modori -m will change the mensuration sign from *met to *omet:

If you want to alter the durations between original and modern scores, The half and double filters can be used:

When using the half filter, The autobeam filter can be used to add automatic beams according to the time signature:

OMD reference records

OMD records can be encoded for modern/original displays:

Non-staff spines

An entire spine can be labeled as “modern” or “original”. Here is an example of encoding two different lyrical text spines, with the modern version hidden in the diplomatic version:

Here is the view after compiling with the modori -m filter:

This form of the score can be reverted to the original form again by running the modori -o filter:

To view both versions of the lyrics at the same time, use the shed filter:

When a particular staff does not have separate modern/original text variants, use **text, which will not be altered by the modori filter, since there will not be any matching **mod-text or **ori-text:

More than one verse can be added to a given staff, but in that case, all of the spines must be pair with a modern/original equivalent.

Any other non-staff type of spine can also use this sytem such as **dynam (using **mod-dynam or **ori-dynam).

Staff-like spines

Staff-like spines, such as **kern and **mens are treated slightly different than non-staff types of spines. The display form of **kern spines is either **kern-ori or **kern-mod, and the alternate would be either **ori-kern or **mod-kern:

Here is the result after compiling the modori -m filter:

Local LO:MO parameters

Individual tokens can be swapped between original and modern variants.

Applying modori -m:

Compiling the modori filter:

For scribal errors, the LO:MO system can be used, although it is better to use sic to allow corrections to be applied to both the diplomatic or modern editions.

Global LO:MO parameters

Global LO:MO lines can be used to comment out data that is specific to the modern or original score, and the modori filter will switch the commenting/uncommenting of each marked region. The basic structure for a global LO:MO group is:

[mod content here]
[ori content here]

Either !!LO:MO:mod or !!LO:MO:ori can come first, and the last one is terminated by !!LO:MO:end. Both the mod and ori content can be paired as shown below, or they can occur in isolation for insertions and deletions in the score.

Here is an example in the “original” state that contains an extra measure in the “modern” state:

The content between !!LO:MO:mod and !!LO:MO:ori is commented out with two exclamation marks followed by a single space. When running the modori -m filter on the file, the !! prefix on each line in the mod section will be removed:


Interpretations for modern/original displays can be switched with the modori filter. Here is an example of changing the stem styling on half notes:

The interpretation *2\right will be switched to *blank when the modori -m filter is used to display the modern score:

The *dummy interpretation has no meaning, and is used as a placeholder so that the original interpretation can be restored with modori -o. Here is the compiled result of the filter:

Note that null interpretations cannot be used, which is why *dummy is used in this example.

LO:TX / LO:DY (text directions and dynamics)

LO:TX and LO:DY parameters allow modern/original text to be swapped out with the modori filter. Both of these LO parameters can have an added mod or ori parameter to store the modern or original text that should be alternated with the t text parameter.

LO:TX example

Applying modori -m to display the modern score:

After compiling the modori filter:

Text and Dynamics

Applying modori -m:

After compiling the filter: