+%% incipit
+
+incipit =
+#(define-music-function (incipit-music) (ly:music?)
+ (_i "Output @var{incipit-music} before the main staff as an indication of
+ its appearance in the original 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
+ \override Stem.X-offset = #stem::kievan-offset-callback
+ \override Stem.stencil = ##f
+ \override Flag.stencil = ##f
+ \override Rest.style = #'mensural
+ \override Accidental.glyph-name-alist = #alteration-kievan-glyph-name-alist
+ \override Dots.style = #'kievan
+ \override Slur.stencil = ##f
+ \override Stem.length = #0.0
+ \override Beam.positions = #beam::get-kievan-positions
+ \override Beam.quantized-positions = #beam::get-kievan-quantized-positions
+ \override NoteHead.duration-log = #note-head::calc-kievan-duration-log
+}
+kievanOff = {
+ \revert NoteHead.style
+ \revert Stem.X-offset
+ \revert Stem.stencil
+ \revert Rest.style
+ \revert Accidental.glyph-name-alist
+ \revert Dots.style
+ \revert Slur.stencil
+ \revert Flag.stencil
+ \revert Stem.length
+ \revert Beam.positions
+ \revert Beam.quantized-positions
+ \revert NoteHead.duration-log
+}
+
+%% line and page breaking controls
+
+autoLineBreaksOff = {
+ \overrideProperty Score.NonMusicalPaperColumn.line-break-permission ##f
+ \override Score.NonMusicalPaperColumn.line-break-permission = ##f
+}
+autoLineBreaksOn = {
+ \overrideProperty Score.NonMusicalPaperColumn.line-break-permission #'allow
+ \override Score.NonMusicalPaperColumn.line-break-permission = #'allow
+}
+autoPageBreaksOff =
+ \override Score.NonMusicalPaperColumn.page-break-permission = ##f
+autoPageBreaksOn =
+ \override Score.NonMusicalPaperColumn.page-break-permission = #'allow
+autoBreaksOff = { \autoLineBreaksOff \autoPageBreaksOff }
+autoBreaksOn = { \autoLineBreaksOn \autoPageBreaksOn }
+