From 410a5691ad4d90bac28ceccdc4d2458153b1ffd2 Mon Sep 17 00:00:00 2001 From: Phil Holmes Date: Tue, 30 Sep 2014 16:09:13 +0100 Subject: [PATCH] Adds incipit section to the NR --- Documentation/notation/ancient.itely | 37 +++++++++++++++-- ly/property-init.ly | 59 ++++++++++++++++++++++------ scm/paper.scm | 1 + 3 files changed, 82 insertions(+), 15 deletions(-) diff --git a/Documentation/notation/ancient.itely b/Documentation/notation/ancient.itely index e4ded2fa4f..9d74daf062 100644 --- a/Documentation/notation/ancient.itely +++ b/Documentation/notation/ancient.itely @@ -2647,10 +2647,39 @@ same source. @node Incipits @unnumberedsubsubsec Incipits -@c TODO Add text -@c clefs, mensuration signs etc from lsr and -user -@c use snippet Transcription-of-ancient-music-with-incipit -TBC +It is customary when transcribing mensural music into modern notation to place +an indication of how the initial rests and note or notes of the original version +appeared - including the original clefs. This is called an @emph{incipit}. The +@code{\incipit} command uses the @code{indent} of the main staff to set the +width occupied by the incipit, and @code{incipit-width} to set the width of the +incipit staff. + +@lilypond[verbatim,quote,ragged-right] +\score { + \new Staff << + \new Voice = Tenor { + \set Staff.instrumentName = #"Tenor" + \override Staff.InstrumentName.self-alignment-X = #RIGHT + \incipit { \clef "mensural-c4" \key f \major r\breve r1 c'1 } + \clef "treble_8" + \key f \major + R1 r2 c'2 | + a4. c'8 + } + \new Lyrics \lyricsto Tenor { Cyn -- thia your } + >> + \layout + { + indent = 5\cm + incipit-width = 3\cm + } +} +@end lilypond + +@knownissues +Note that instrumentName must be set in the music for the incipit to be +produced. If no instrument name is required then use +@code{\set Staff.instrumentName = #""}. @c @seealso @c ... and reference to other sections ... diff --git a/ly/property-init.ly b/ly/property-init.ly index 852dbcee9e..f27311f9a4 100644 --- a/ly/property-init.ly +++ b/ly/property-init.ly @@ -196,17 +196,6 @@ easyHeadsOff = { } -%% endincipit - -%% End the incipit and print a ``normal line start''. -endincipit = \context Staff { - \partial 16 s16 % Hack to handle e.g. \bar ".|" \endincipit - \once \override Staff.Clef.full-size-change = ##t - \once \override Staff.Clef.non-default = ##t - \bar "" -} - - %% fermata markup fermataMarkup = @@ -285,6 +274,54 @@ improvisationOff = { \revert AccidentalCautionary.stencil } +%% incipit + +incipit = +#(define-music-function (parser location incipit-music) (ly:music?) + #{ + \once \override Staff.InstrumentName.stencil = + #(lambda (grob) + (let* ((instrument-name (ly:grob-property grob 'long-text)) + (align-x (ly:grob-property grob 'self-alignment-X 0)) + (align-y (ly:grob-property grob 'self-alignment-Y 0))) + (set! (ly:grob-property grob 'long-text) + #{ \markup { + \score + { + \new MensuralStaff \with { + \override InstrumentName.self-alignment-X = #align-x + \override InstrumentName.self-alignment-Y = #align-y + instrumentName = #instrument-name + } + { + $incipit-music + } + \layout { + $(ly:grob-layout grob) + indent-incipit-default = 15\mm + line-width = #(primitive-eval + '(or (false-if-exception indent) + indent-incipit-default)) + indent = #(primitive-eval + '(or (false-if-exception (- line-width incipit-width)) + (* 0.5 line-width))) + ragged-right = ##f + ragged-last = ##f + system-count = 1 + \context { + \Score + \remove "Default_bar_line_engraver" + } + } + } + } + #}) + (set! (ly:grob-property grob 'self-alignment-Y) #f) + (set! (ly:grob-property grob 'self-alignment-X) RIGHT) + (system-start-text::print grob))) + #} +) + %% kievan kievanOn = { \override NoteHead.style = #'kievan diff --git a/scm/paper.scm b/scm/paper.scm index d0adef3033..9e702abc6e 100644 --- a/scm/paper.scm +++ b/scm/paper.scm @@ -28,6 +28,7 @@ footnote-padding horizontal-shift in + incipit-width indent inner-margin inner-margin-default-scaled -- 2.39.2