باختصار
فصل من دراسة عن الموسيقى في العصور الوسطى. مقاطع قصيرة من أنشودة دائرية إنجليزية من القرن الثالث عشر تُطبع نوتةً داخل النص، وتسجّل الحواشي أسفل كل صفحة، مازورةً مازورة، مواضع اختلاف الطبعات القديمة.
ما الذي ستنضده
الفصل الثالث من دراسة علمية عن قراءة هواة الآثار الإنجليز للموسيقى الوسيطة: خمس صفحات بقطع 156 × 234 مم عن Sumer is icumen in، أنشودة ريدينغ الدائرية، وعن المحررين الذين وضعوها في مدوّنة كاملة بين 1776 و1889. تُنقش ثلاثة مقاطع منها داخل النص بخط Leipzig على مدرج ارتفاعه 5 مم، وتتبع أرقام الموازير مدوّنة W. S. Rockstro، ويحيل كل تعليق إلى جهازه النقدي في أسفل الصفحة: «b. 40, n. 2 A ] G Hw, Bu». الحواشي قصيرة مكثفة كما يكون الجهاز النقدي، والموسيقى تملأ عرض سطر النص، وكل قراءة مأخوذة من مقالة Rockstro في معجم Grove، وهو ما يذكره الفصل في فقرته الثانية.
تجيب هذه الوصفة عن
- كيف أرفق بالأمثلة الموسيقية جهازًا نقديًا لاختلافات المصادر في حواشٍ سفلية؟
- كيف أضيف الحواشي السفلية؟
الجواب المختصر
// 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
- الخطوط
- Crimson Pro, Cormorant Garamond, Source Sans 3 (SIL OFL 1.1)
- الأصول
- لا شيء: كل صورة مرسومة بالشيفرة
طريقة التحضير
#1 · اكتب كل مثال بصيغة MEI مع قراءاته
الإعدادات في الجواب المختصر أعلاه، والموسيقى في Markdown، كتلة ```mei لكل مثال. حيث يختلف مصدران تحمل المازورة عنصر <app>، فيه القراءة المعتمدة داخل <lem> والأخرى داخل <rdg source="#Hw #Bu">. يُنقش <lem>، فتُظهر المازورة 40 من المثال 3.3 النغمة A، وتبقى G عند Hawkins وBurney في الملف لمن يفتح الترميز. أعطِ كل كتلة alt بلغة الصفحة: هذا ما يقرؤه قارئ الشاشة وملف PDF الموسوم عن المدوّنة.
#2 · اربط الجهاز النقدي بالموازير التي يراها القارئ
يرقّم barNumbers: 'system' أول مازورة في كل سطر موسيقي، ويبدأ <measure n="37"> في كل كتلة العدَّ من حيث يبدأ المقطع في الطبعة المتّبعة، فيفتتح المثال 3.3 بالمازورة 37، وتشير حاشية تقول «b. 40» إلى مازورة يجدها القارئ. مدخل الجهاز حاشية سفلية عادية تُحال إليها من الفقرة التي تناقش المازورة: القراءة المعتمدة، ثم قوس معقوف، ثم القراءة الأخرى ورموز المصادر بخط مائل. لا يمكن الإحالة إلى حاشية من داخل المدوّنة، فتوضع علامة الإحالة في الجملة التي تسمّي القراءة.
#3 · قدّر حجم الموسيقى على مقاس النص الجاري
يتسع سطر عرضه 116 مم لمدرج Leipzig بارتفاع 5 مم وخمس موازير أو ست من ميزان 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.54.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 المجمّع كما هو: الصقه في سكربت الوحدة (module) لأي صفحة، أو افتح الوصفة على 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. أما السمةkey.sigمن MEI 4 فتُهمل دون أي رسالة، فتختفي علامة الخفض. - أعطِ كل
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)
- الشيفرة
- MIT، مثل Postext
حرّر هذا الشرح ↗ (يفتح في تبويب جديد)مجلد الوصفة على GitHub ↗ (يفتح في تبويب جديد)


