Коротко
Глава исследования о средневековой музыке. Короткие отрывки английского канона XIII века напечатаны нотами в тексте, а сноски внизу страниц отмечают по тактам, где расходятся старые издания.
Что получится
Глава 3 научного исследования о том, как английские антиквары читали средневековую музыку: пять страниц 156 × 234 мм о Sumer is icumen in, редингской роте (каноне), и об издателях, которые записывали его партитурой с 1776 по 1889 год. Три отрывка канона гравированы в тексте шрифтом Leipzig при стане 5 мм и пронумерованы по тактам партитуры У. С. Рокстро, а каждое обсуждение ссылается на аппарат внизу страницы: «b. 40, n. 2 A ] G Hw, Bu». Сноски короткие и плотные, как положено аппарату, ноты стоят по ширине набора, и каждое чтение взято из статьи Рокстро в Dictionary Гроува, о чём глава говорит во втором абзаце.
Рецепт отвечает на вопросы
- Как дать нотным примерам критический аппарат разночтений источников в сносках?
- Как сделать сноски?
Короткий ответ
// In the Markdown each example is a ```mei fence. A variant is encoded where it stands,
// <app><lem>…</lem><rdg source="#Hw #Bu">…</rdg></app>: the staff shows the lemma, and
// the file keeps the reading for anyone who opens the encoding. The apparatus entry is a
// footnote cited from the paragraph that discusses the bar: `[^b40]: **b. 40, n. 2** A ] G`.
const scoreStyle = {
staffSize: mm(5), // running-text examples: 4.5–5.5 mm
musicFont: 'Leipzig', // lighter than Bravura, close to a 19th-century plate
textFont: 'Crimson Pro', // the underlay in the book's own face
barNumbers: 'system', // the apparatus is keyed by bar: number every system
spacing: 0.95,
systemGap: mm(4),
marginTop: pt(4),
marginBottom: pt(LEAD / 2),
color: col('ink'),
minSystemsAtBreak: 2, // never leave one system of an example alone at a page foot
};
const footnotes = {
placement: 'column', // the foot of the page in one column
numbering: 'chapter',
fontSize: pt(8.5),
lineHeight: pt(10.75),
hangingIndent: em(1.2), // turnover lines align past the number
spaceBetween: pt(2),
separator: { width: 0.2, lineWidth: pt(0.5), color: col('rubric') },
};
Ингредиенты
- Возможности
- Нотная записьСноскиСтиль нотОформленные начальные полосыАтрибуты заголовковКолонтитулы и колонцифрыЗеркальные поляКолонтитулы по роли страницыСтили абзацевСемантическая палитраЦвет бумагиВисячие и короткие концевые строкиЭкспорт в PDF
- Также применяет
- Листинги кодаВыравнивание колонокШрифты, встроенные в PDF
- Шрифты
- Crimson Pro, Cormorant Garamond, Source Sans 3 (SIL OFL 1.1)
- Материалы
- Нет: все иллюстрации рисует код
Порядок работы
#1 · Записывайте каждый пример в MEI, вместе с вариантами
Настройки приведены выше, в коротком ответе; сама музыка в Markdown, по ограде ```mei на пример. Где два источника расходятся, такт содержит <app> с принятым чтением в <lem> и другим в <rdg source="#Hw #Bu">. Гравёр печатает лемму, поэтому такт 40 примера 3.3 показывает A, а G Хокинса и Бёрни остаётся в файле для того, кто откроет кодировку. Дайте каждой ограде alt на языке страницы: его читают для нот программа экранного доступа и PDF с тегами.
#2 · Привязывайте аппарат к тактам, которые видит читатель
barNumbers: 'system' нумерует первый такт каждой системы, а <measure n="37"> каждой ограды начинает счёт там, где отрывок начинается в своём издании, поэтому пример 3.3 открывается на 37, а сноска «b. 40» указывает на такт, который читатель найдёт. Запись аппарата — обычная сноска из абзаца, обсуждающего такт: лемма, закрывающая скобка, вариант, сиглы курсивом. Из самих нот сослаться на сноску нельзя, поэтому ссылка стоит при предложении, которое называет чтение.
#3 · Размер нот для набора в тексте
Стан 5 мм в Leipzig стоит на ширине 116 мм: пять или шесть тактов в 3/2 на систему, и одиннадцать тактов примера 3.3 укладываются в две системы. textFont набирает подтекстовку Crimson Pro, гарнитурой основного текста, а minSystemsAtBreak: 2 не даёт странице закончиться одной системой примера, пока остальные идут дальше. Название примера — заголовок третьего уровня, поэтому никогда не остаётся внизу страницы без нот.
#4 · Пусть страница со сносками заканчивается раньше
const opener = {
enabled: true,
minHeight: mm(50), // every chapter's text starts on the same grid line
slot: { elements: [
{ kind: 'text', id: 'kicker', content: '{attr.kicker}', ...label, fontSize: pt(8.5),
letterSpacing: pt(1.8), color: col('rubric'), align: 'left',
placement: at('container', 'top-left', 0, 8) },
{ kind: 'text', id: 'title', content: '{titleText}', fontFamily: 'Cormorant Garamond',
italic: true, fontWeight: 500, fontSize: pt(29), lineHeight: 1.05, color: col('ink'),
align: 'left', overflow: 'wrap', // design text ends in an ellipsis by default
placement: { ...at('#kicker', 'below', 0, 3), size: { width: mm(100), height: 'auto' } } },
{ kind: 'rule', id: 'rule', direction: 'horizontal', thickness: pt(1), color: col('rubric'),
placement: { ...at('#title', 'below', 0, 5), size: { width: mm(14) } } },
] },
};
Начальная полоса опускает текст на 50 мм под заголовком курсивом Cormorant. Ниже страница, чья следующая строка привела бы за собой длинную сноску, заканчивается на несколько строк раньше, а balancing: { maxLinesPerHeading: 1 } не даёт выравниванию колонок перенести этот промежуток над заголовком следующего раздела, где он читался бы как перерыв в рассуждении.
#5 · Книга на левой полосе, глава на правой
const head = (id, content, parity, edge, x, extra = {}) => ({
kind: 'text', id, content, parity, pages: 'body', // never on the opener
...label, fontSize: pt(7.5), letterSpacing: pt(1.3), color: col('muted'),
placement: at('page', edge, x, 13), ...extra,
});
const folio = { color: col('rubric'), fontWeight: 700 };
const header = { elements: [
head('verso-folio', '{pageNumber}', 'even', 'top-left', MARGIN.outer,
{ ...folio, align: 'left' }),
head('verso-title', '{title}', 'even', 'top-left', MARGIN.outer + 8, { align: 'left' }),
head('recto-title', '{chapterTitle}', 'odd', 'top-right', -(MARGIN.outer + 8),
{ align: 'right', overflow: 'ellipsis' }),
head('recto-folio', '{pageNumber}', 'odd', 'top-right', -MARGIN.outer,
{ ...folio, align: 'right' }),
] };
// The opener carries a drop folio instead, centred under the text block.
const footer = { elements: [{ ...head('drop-folio', '{pageNumber}', 'all', 'bottom', 0,
{ ...folio, align: 'center', placement: at('page', 'bottom', 0, -11) }), pages: 'opener' }] };
Колонцифры рубричным красным у наружного края, книга на левой полосе и глава на правой; pages: 'body' убирает их с начальной полосы, где колонцифра центрирована внизу.
Рецепт целиком
// ═══ Postext Cookbook · Nº 165 · MEI music examples with a critical apparatus ═════
// https://postext.dev/en/cookbook/musicology-mei-apparatus
// Code: MIT · Text: original (CC BY 4.0) · Music: Sumer is icumen in, after Rockstro (PD)
// Fonts: Crimson Pro, Cormorant Garamond, Source Sans 3 (SIL OFL 1.1) · Needs postext ≥ 1.66.0
import {
buildDocumentWithFonts, renderPageToCanvas, initMusicEngine,
} from 'https://esm.sh/postext';
import { renderToPdf, decompressWoff2 } from 'https://esm.sh/postext-pdf';
const LANG = 'en'; // @lang: the language of the sample document ('en' | 'es')
const RECIPE = 'musicology-mei-apparatus';
// ─── 1 · Design ─────────────────────────────────────────────────────────────
// #region palette: a rubric red for kickers, labels and the notes' rule; ink on cream
const palette = {
ink: '#211d1a', // text and notation: a warm near-black
rubric: '#8c2f1f', // the one accent, the red of the manuscript's rubrics
muted: '#6c645b', // running heads, colophon
rule: '#cbbfae', // hairlines
paper: '#fcfaf6',
};
// col(id): a colour linked to its palette entry, with the entry's hex beside the id.
const col = (id) => ({ hex: palette[id], model: 'hex', paletteId: id });
const colorPalette = [
...Object.entries(palette).map(([id, hex]) => ({ id, name: id, value: { hex, model: 'hex' } })),
// The engine's defaults link to main-color: point it at the accent, never the default blue.
{ id: 'main-color', name: 'accent (defaults)', value: { hex: palette.rubric, model: 'hex' } },
];
// #endregion
const MARGIN = { top: 22, bottom: 22, inner: 19, outer: 21 }; // 156 × 234 mm, mirrored
const LEAD = 14.5; // body leading in pt: the baseline grid
const at = (to, edge, x = 0, y = 0) => ({ anchor: { to, edge }, offset: { x: mm(x), y: mm(y) } });
const label = { fontFamily: 'Source Sans 3', fontWeight: 600, textTransform: 'uppercase' };
// #region answer: MEI examples engraved in the text, their apparatus in footnotes
// In the Markdown each example is a ```mei fence. A variant is encoded where it stands,
// <app><lem>…</lem><rdg source="#Hw #Bu">…</rdg></app>: the staff shows the lemma, and
// the file keeps the reading for anyone who opens the encoding. The apparatus entry is a
// footnote cited from the paragraph that discusses the bar: `[^b40]: **b. 40, n. 2** A ] G`.
const scoreStyle = {
staffSize: mm(5), // running-text examples: 4.5–5.5 mm
musicFont: 'Leipzig', // lighter than Bravura, close to a 19th-century plate
textFont: 'Crimson Pro', // the underlay in the book's own face
barNumbers: 'system', // the apparatus is keyed by bar: number every system
spacing: 0.95,
systemGap: mm(4),
marginTop: pt(4),
marginBottom: pt(LEAD / 2),
Собранный script.js работает как есть: вставьте его в модульный скрипт любой страницы или откройте рецепт на CodePen. Папка рецепта на GitHub ↗ (открывается в новой вкладке)
Варианты
#Печатайте номер каждого такта
Аппарат с многими записями на систему легче читать с номером у каждого такта.
- barNumbers: 'system', // the apparatus is keyed by bar: number every system
+ barNumbers: 'every',#Наберите примеры шрифтом Bravura
Более тяжёлые нотные головки Bravura подходят стилю гравированных досок.
- musicFont: 'Leipzig', // lighter than Bravura, close to a 19th-century plate
+ musicFont: 'Bravura',Частые ошибки
- MEI 5 записывает ключевые знаки как
keysig="1f"наscoreDefилиstaffDef. Атрибут MEI 4key.sigигнорируется без сообщения, и бемоль исчезает. - Дайте каждому
staffDefегоlines="5": без него ноты и ключи гравируются без нотного стана. - Гравёр печатает
<lem>из<app>, а не<rdg>. Вариант, который читатель должен увидеть на странице, идёт в сноску аппарата или во второй пример.
Источники и лицензии
- Рецепт
- Ignacio Ferro
- Текст
- The chapter text and the apparatus notes, in English and Spanish · Ignacio Ferro · CC BY 4.0
- Sumer is icumen in (13th century), the music examples transcribed from W. S. Rockstro's score and the readings his article reports, in A Dictionary of Music and Musicians, ed. George Grove, vol. 3, pp. 765–768, and vol. 4, pp. 1–3 (Macmillan, 1900 printing), as transcribed on Wikisource · Anonymous; William Smyth Rockstro · общественное достояние
- The Latin rubric of Harley MS 978, f. 11v, and the folio, as quoted in the Wikipedia article (fact check) · Wikipedia contributors · CC BY-SA 4.0
- Шрифты
- Crimson Pro (SIL OFL 1.1) · Cormorant Garamond (SIL OFL 1.1) · Source Sans 3 (SIL OFL 1.1)
Изменить описание рецепта ↗ (открывается в новой вкладке)Папка рецепта на GitHub ↗ (открывается в новой вкладке)


