Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
| Beide Seiten der vorigen Revision Vorhergehende Überarbeitung Nächste Überarbeitung | Vorhergehende Überarbeitung | ||
| en:mei [2026/04/02 07:57] – [Minimal example bringing things together] egorpoly | en:mei [2026/04/02 08:09] (aktuell) – egorpoly | ||
|---|---|---|---|
| Zeile 542: | Zeile 542: | ||
| * unique '' | * unique '' | ||
| * a dynamic linked to a specific note | * a dynamic linked to a specific note | ||
| + | |||
| + | ===== The overall structure of a complete MEI file ===== | ||
| + | |||
| + | So far, many examples in this introduction have shown only small fragments, such as a single measure or a short score passage. | ||
| + | |||
| + | That is useful for learning individual elements, but it is important to understand that a **complete MEI file** normally needs a larger structure around those fragments. | ||
| + | |||
| + | A beginner should think of MEI on two levels: | ||
| + | |||
| + | * **document level** = the whole file | ||
| + | * **music level** = the encoded notation inside the file | ||
| + | |||
| + | ===== The usual top-level structure ===== | ||
| + | |||
| + | A normal MEI document usually has this overall form: | ||
| + | |||
| + | < | ||
| + | mei | ||
| + | ├── meiHead | ||
| + | └── music | ||
| + | └── body | ||
| + | └── mdiv | ||
| + | └── score | ||
| + | └── section | ||
| + | └── measure | ||
| + | └── staff | ||
| + | └── layer | ||
| + | └── note / rest / chord / etc. | ||
| + | </ | ||
| + | |||
| + | This can be read as: | ||
| + | |||
| + | * ''< | ||
| + | * ''< | ||
| + | * ''< | ||
| + | * ''< | ||
| + | * ''< | ||
| + | * ''< | ||
| + | * ''< | ||
| + | * ''< | ||
| + | * ''< | ||
| + | * ''< | ||
| + | * ''< | ||
| + | |||
| + | ===== Why the earlier example was incomplete ===== | ||
| + | |||
| + | This earlier example: | ||
| + | |||
| + | <code xml> | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | <measure n=" | ||
| + | <staff n=" | ||
| + | <layer n=" | ||
| + | <note pname=" | ||
| + | <note pname=" | ||
| + | <note pname=" | ||
| + | <note pname=" | ||
| + | </ | ||
| + | </ | ||
| + | <dynam startid="# | ||
| + | </ | ||
| + | </ | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | is useful as a **score fragment**, but it is not yet a complete MEI document. | ||
| + | |||
| + | In practice, tools such as Verovio often expect a fuller MEI wrapper around the score data. | ||
| + | |||
| + | ===== A fuller MEI example ===== | ||
| + | |||
| + | The following example shows the same musical idea inside a more complete MEI structure: | ||
| + | |||
| + | <code xml> | ||
| + | <mei xmlns=" | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | </ | ||
| + | < | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | <measure n=" | ||
| + | <staff n=" | ||
| + | <layer n=" | ||
| + | <note pname=" | ||
| + | <note pname=" | ||
| + | <note pname=" | ||
| + | <note pname=" | ||
| + | </ | ||
| + | </ | ||
| + | <dynam startid="# | ||
| + | </ | ||
| + | </ | ||
| + | </ | ||
| + | </ | ||
| + | </ | ||
| + | </ | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | **Important: | ||
| + | Without this, some renderers may not display the staff correctly. | ||
| + | |||
| + | You can try to render this score yourself via [[https:// | ||
| + | |||
| + | ===== How to read this complete example ===== | ||
| + | |||
| + | This example now includes the parts that were missing before: | ||
| + | |||
| + | * ''< | ||
| + | * '' | ||
| + | * '' | ||
| + | * ''< | ||
| + | * ''< | ||
| + | * ''< | ||
| + | * ''< | ||
| + | |||
| + | Only inside this larger wrapper do we get to the actual note material. | ||
| + | |||
| + | ===== The role of '' | ||
| + | |||
| + | The ''< | ||
| + | |||
| + | For beginners, it is enough to understand that this is where information about the encoded object and the encoding can be stored, for example: | ||
| + | * title | ||
| + | * source information | ||
| + | * editorial responsibility | ||
| + | * encoding notes | ||
| + | * revision history | ||
| + | |||
| + | In small teaching examples, the header may be very short. | ||
| + | In research projects, it can become much more detailed. | ||
| + | |||
| + | ===== The role of '' | ||
| + | |||
| + | Inside ''< | ||
| + | |||
| + | Inside the body, ''< | ||
| + | Depending on the source, this may represent: | ||
| + | * a whole piece | ||
| + | * a movement | ||
| + | * an act | ||
| + | * a scene | ||
| + | * another large formal division | ||
| + | |||
| + | For simple teaching examples, one ''< | ||
| + | |||
| + | ===== A practical beginner rule ===== | ||
| + | |||
| + | When writing MEI for testing or rendering, it is safest to think in this order: | ||
| + | |||
| + | - start with ''< | ||
| + | - add ''< | ||
| + | - add ''< | ||
| + | - inside music, add ''< | ||
| + | - inside body, add ''< | ||
| + | - inside mdiv, add ''< | ||
| + | - inside score, add ''< | ||
| + | - inside section, add measures, staves, layers, and notes | ||
| + | |||
| + | This avoids the impression that a musical fragment by itself is already a complete MEI file. | ||
| + | |||
| + | ===== Simplified memory aid ===== | ||
| + | |||
| + | A useful memory formula is: | ||
| + | |||
| + | * **MEI document** = metadata + music | ||
| + | * **music** = body + divisions + score content | ||
| + | * **score content** = sections + measures + staves + layers + events | ||
| + | |||
| ===== Reference ===== | ===== Reference ===== | ||