-
Notifications
You must be signed in to change notification settings - Fork 185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add conversion from mensural to CMN #3852
Conversation
* Uses newly generated LibMEI module level static methods
* Only documents with only one layer by staff can be treated as mensural only (i.e., for mensural view, mensural cast-off and conversion to CMN)
* Add ObjectFactory::Create(ClassId)
* Drop two string values in MusicXML importer
* Drop two string values in MusicXML importer (cherry picked from commit fe2d5b1)
Isn't the CMME |
Not quite. Coloration is addressed with |
Okay, I thought it might be special way to indicate longer sections of coloration in a piece. Then, everything is fine. 😁 |
(cherry picked from commit f96a142)
NB: By merging this Verovio will also be updated to C++23 (nb: @craigsapp for your previous message) |
Co-authored-by: Andrew Hankinson <[email protected]>
Co-authored-by: Andrew Hankinson <[email protected]>
Co-authored-by: Andrew Hankinson <[email protected]>
This is not the case any more. I dropped the C++23 dependency since it looks like it is a bit early to switch to it. |
This PR introduces a new converter from mensural to CMN (supported by the CESR) together with some other improvements to the CMME importer and options for handling mensural notation.
Refactoring of the mensural notation cast-off
The cast-off of mensural notation has been re-written and makes Verovio more flexible. Previously, system and page begins would be inserted only at places where a
barLine
would occur at all voices. This was requiringbarLine
elements to be inserted, sometimes artificially, with still a limited number of possible break points.With the implementation of this PR, system and page begins will be inserted wherever all voices align, meaning at any point where all voices have either a note or a rest.
Options
Duration equivalence
The new
--duration-equivalence
specifies the level that is considered equivalent when aligning different (ternary or binary) mensural divisions and is similar to the integer valor. Previously, the level was fixed tobrevis
, but it can now be changed tosemibrevis
orminima
. Thebrevis
remains the default level.One of the purpose of the
--duration-equivalence
option is to control how mensural notation can be aligned with CMN. Withminima
, a mensuralminima
will be considered equivalent to a half-note (a duration of2
in MEI). Withsemibrevis
, a mensural duration ofsemibrevis
will be considered equivalent to a whole-note (a duration of1
in MEI). With a tempus imperfectum and a prolatio minor (e.g., all binary divisions), the level of equivalence has makes no difference. However, with ternary divisions (tempus perfectum and/or prolatio major), some tuplets will be needed for aligning whole-notes and semibrevis with a level ofminima
and for aligning minima and half-notes with a level ofsemibrevis
, respectively[example will be added to the reference book]
Mensural responsive view
The PR introduces a new option to make rendering of mensural notation more flexible. One issue with the dynamic rendering of mensural data is the cast off of containers, such as ligature or editorial markup. Adding system of page begins within ligature or editorial markup would require some restructuring of the data - keeping some notes of a ligature in one system and others to the next system. That is not the normal way layout is performed in Verovio since the principle is to preserve the MEI tree. The new option
--mensural-responsive-view
is a way to focus only on the editorial markup version selected and to flatten the ligature in order to allow for system and page begins to be inserted wherever needed within editorial markup or ligature.Users should be aware that calling
GetMEI
with the option will return the simplified version of the data, and not the original one.[example will be added to the reference book]
Adjustments to the CMME importer
The PR adds the conversion of minimal metadata from the CMME
GeneralData
element to the MEI header. It is:Title
=>title
Section
=>title@type="subordinate"
Composer
=>composer
The PR as the support for the CMME
ColorChange
by applying the color (non-black) tonote@color
andrest@color
.The PR also forces the use of the
--duration-equivalence
option tominima
when importing a CMME file. A warning is shown if the option was previously different - which is the case by default. This could potentially have side effects for subsequent calls since it is not set back to its original value. One way to improve this would be to set the option tominima
by default, but that can be done after the merge of the PR and some additional testing with existing mensural data.Finally the PR corrects the handling of the proportion in the CMME importer. They were previously applied to the data during the conversion, but this was wrong because CMME works the other way around. That is, the proportion is not coded in the note value but applied by the CMME processor - this is also why proportions are also used a tempo changes in some CMME data.
Converter from Mensural to CMN
The conversion is triggered by the
--mensural-to-cmn
option, which replaces--mensural-to-measure
.Meter signatures
Mensur signs are converted into CMN meter signatures of
3/2
,4/2
or6/2
, with3/2
for tempus perfectum and prolatio major, and4/2
for tempus imperfectum and prolatio minor.6/2
is applied for the other two combinations.The meter signature is arbitrarily determined by the top voice when voices have conflicting meter signatures. Also, a meter signature change is introduced when all voices have a mensur sign at the position and that the resulting meter signature is actually different from the previous one.
The mensur signs are not preserved as such. However, a MEI
<dir>
is inserted with a textual transcription, with:C
orO
) withr
for areversed
orientation|
).
)x
) or a proportion (x/x
) for@num
w/o@numbase
respectively.The
<dir>
is placed withtstamp="0.0"
when occurring at the beginning of a measure, or with a@startid
of the previous note or rest when occurring within the measure.Clefs
Clef are all converted to
G-2
,G-2
with ottava bassa orF-2
clef. When no clef is given, aC-3
is used since this is the most neutral clef ambitus-wise.Warning
Clef changes are currently ignored.
Proportions
Proportions are converted into tuplets. A tuplet that matches the proportion can be used when notes do not need to be cut across several bars. Otherwise, the tuplet proportion need to be adjusted according to the proportion of the note part that goes in one bar and the other. The result is more or less legible but always mathematically correct.
Mensural MEI file
Converted MEI (cmn) file
Warning
The MEI produced with unconventional proportions can be problematic in MuseScore because of the limitation of MuseScore regarding the representation of the tuplets. It is expected for any tuplets to have a duration that can be represented with a group of base durations, which is not always the case with the MEI tuplets produced. As a result, even if the file will load and show properly in MuseScore, or even export properly to MEI, saving it as MuseScore file will corrupt it. This is not likely to be overcome.
Ligatures and coloration
Ligatures and coloration are both converted into
bracketSpan
, with a@lform="solid"
for the ligatures.Warning
Coloration on chords (used in mensural notation for faux bourdon) is not preserved. Also, when converting to MEI-Basic, the file is currently not valid because
bracketSpan
are not available in MEI-Basic.Editorial markup
Editorial markup is ignored and dropped from the conversion. Only the selected reading is converted according to the use of
--app-x-path-query
or--choice-x-path-query
parameters.Example
The example above rendered with the new cast-off algorithm
Others
Object::CopyAttributesTo
for copying all MEI (supported and unsupported) attributes from one object to another.Need update to C++23