14.1 TEI14.2 IIIF14.3 SMuFL14.4 SVG14.5 Musical Instrument Digital Interface (MIDI)14.5.1 PPQ in scoreDef and staffDef14.5.2 Recording General MIDI Instrumentation14.5.3 Recording MIDI Event Data14.5.4 MIDI in Mensural and Neume Notation
In this chapter, the combination of MEI with other relevant formats in the field is covered. Here, the MEI Guidelines try to serve as Best Practice Recommendations; they don't claim to provide full and / or authoritative documentation for those other formats. The intention is to provide good starting points and share experience across various projects, trying to unify both tools and workflows for better efficiency. Accordingly, if the information found here provides as outdated or incomplete, please get in touch.
The TEI’s Special Interest Group on Music has come up with an ODD customization for TEI, which allows to embed MEI excerpts into TEI. However, the SIG Music is officially considered dormant, so the information provided is somewhat outdated. The most recent resources are available from GitHub.
As of yet, no official MEI customization to include elements from the TEI namespace into MEI has been written, even though this is definitely wanted.
This chapter will explain how to use MEI in an IIIF-compatible way.
This section describes how to use MEI with the Standard Music Font Layout (SMuFL, https://www.smufl.org/) specification.
In order to use Scalable Vector Graphics (SVG) in MEI, a new module needs to be compiled into ODD (see 1.3.5 Customizing MEI for an introduction on how to do that). In order to do that, you need to enter the following tei:moduleRef into the tei:schemaSpec of your ODD file:
With this addition, which can be added to any of the provided customizations of MEI (see 1.3.4 MEI Profiles), the <svg> element becomes available everywhere `model.graphicLike` (i.e., the graphic element) is currently allowed, that is: inside of fig, incip, surface, and zone.
In the following example, an <svg:path> element is inserted into a surface. It would now be possible for measures or other music features to point to the rectangular zone in MEI namespace, or the fancy shaped <svg:path> using their facs attribute (see 12.1.1 Elements of the Facsimile Module for that mechanism). It’s equally possible to use SVG content inside figures on title pages or anywhere else.
Of course it’s possible to allow elements in SVG namespace in other places in MEI as well, by adjusting the model classes that the SVG namespace shall join.
This chapter describes the MIDI encoding functionality present in MEI. The purpose of this module is to allow for integrating MIDI data into MEI-encoded notation, to both aid software in translating MEI to MIDI, and to permit the capture of information in files that have been translated from MIDI to MEI. The MIDI model in MEI is similar to that of Mup, and the user is directed to the Mup User Guide for further reading.
The MIDI module defines certain generally-accepted MIDI units that may be used outside of a MIDI context. For example, the dur.ppq attribute accepts MIDI ppq (Pulses Per Quarter) as a valid measurement of duration. Similarly, the pnum attribute allows MIDI note numbers for specifying a pitch value.
To define the MIDI resolution of a score, the ppq attribute may be used on the scoreDef element. This value can be used to interpret the values found in the dur.ppq attribute on elements in the att.duration.ges class.
The ppq attribute is also available on the staffDef element in order to aid in the conversion to MEI from other representations that allow a different time base for each staff. However, these independent values for ppq are only interpretable in terms of a common time base. Therefore, the ppq attribute is required on scoreDef when the values of ppq on the staff definitions differ. In the following example, the values of the ppq attributes on the staffDef elements are all factors of the value of ppq attached to scoreDef.
The instrDef element can be used to record MIDI instrument names or numbers using the midi.instrname and midi.instrnum attributes. The midi.instrname attribute must contain an instrument name from the list provided by the data.MIDINAMES data type. By default, data.MIDINAMES contains General MIDI Instrument designations.
The midi.instrnum is provided for those cases when an instrument number is needed. It must contain valid MIDI values; that is, 0-127. In these cases, a General MIDI Instrument name is redundant.
MIDI messages are encapsulated in the midi element, which is typically used in contexts like layer and measure. In earlier versions of MEI, the noteOn and noteOff elements were used to record MIDI note on/off events. The use of these elements is now discouraged in favor of using the note element directly. MIDI duration should be recorded using the dur.ges attribute, and MIDI pitch information should be recorded using the pnum attribute.
MIDI control changes (cc) are encoded using the num and val attributes. Control change numbers are specified in the General MIDI documentation. In the example below, the cc elements encode increasing controller event 7 (volume) values, or in musical terms, a crescendo. Other MIDI event messages follow this same pattern, using the num and val attributes to record the raw MIDI data.
In the preceding example, each control change is associated with a time stamp. The tstamp attribute is required in order to indicate when the MIDI event should take place. It is often necessary to indicate a time stamp slightly earlier than the affected notes to compensate for MIDI delay.
For better legibility and error checking, the midi element may be used, as in the following example, to group MIDI parameter changes. Even so, the tstamp attribute is required on all parameters in order to associate them with their point of actuation:
In mensural, neume, and other historical or non-Western repertoires, there is often no measure-based time stamp with which to associate MIDI controller data. Therefore, in these notations MIDI controller data is assumed to be associated with the event that immediately follows in the same layer. Thus, a crescendo in mensural notation may be encoded like so: