X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=Documentation%2Fsnippets%2Fincipit.ly;h=075cd35840cc1e8a5624d208ffc78ac2211fff2a;hb=26a079ca2393d053315ef8dbef626c897dc9645a;hp=e0cdadecc02673dce30520ad7b2f3316bd74f088;hpb=a56a90a33aa7cc847252da56b3a4be1c1aa40c08;p=lilypond.git diff --git a/Documentation/snippets/incipit.ly b/Documentation/snippets/incipit.ly index e0cdadecc0..075cd35840 100644 --- a/Documentation/snippets/incipit.ly +++ b/Documentation/snippets/incipit.ly @@ -4,19 +4,11 @@ % and then run scripts/auxiliar/makelsr.py % % This file is in the public domain. -%% Note: this file works from version 2.13.36 -\version "2.13.36" +%% Note: this file works from version 2.15.42 +\version "2.16.0" \header { -%% Translation of GIT committish: fa19277d20f8ab0397c560eb0e7b814bd804ecec - texidoces = " -Los «incipit» se pueden escribir utilizando el grob del nombre del -instruemento, pero manteniendo independientes las definiciones del -nombre del instrumento y del incipit." - - doctitlees = "Incipit" - - lsrtags = "staff-notation, ancient-notation" + lsrtags = "staff-notation, ancient-notation, really-cool" texidoc = " Incipits can be added using the instrument name grob, but keeping separate the instrument name definition and the incipit definition. @@ -36,35 +28,31 @@ incipit = \once \override Staff.InstrumentName #'padding = #0.3 \once \override Staff.InstrumentName #'stencil = #(lambda (grob) - (let* ((instrument-name (ly:grob-property grob 'long-text)) - (layout (ly:output-def-clone (ly:grob-layout grob))) - (music (make-sequential-music - (list (context-spec-music - (make-sequential-music - (list (make-property-set - 'instrumentName instrument-name) - (make-grob-property-set - 'VerticalAxisGroup - 'Y-extent '(-4 . 4)))) - 'MensuralStaff) - $incipit-music))) - (score (ly:make-score music)) - (mm (ly:output-def-lookup layout 'mm)) - (indent (ly:output-def-lookup layout 'indent)) - (width (ly:output-def-lookup layout 'incipit-width)) - (incipit-width (if (number? width) - (* width mm) - (* indent 0.5)))) - - (ly:output-def-set-variable! layout 'indent (- indent - incipit-width)) - (ly:output-def-set-variable! layout 'line-width indent) - (ly:output-def-set-variable! layout 'ragged-right #f) - (ly:output-def-set-variable! layout 'ragged-last #f) - (ly:output-def-set-variable! layout 'system-count 1) - (ly:score-add-output-def! score layout) - (ly:grob-set-property! grob 'long-text - (markup #:score score)) + (let* ((instrument-name (ly:grob-property grob 'long-text))) + (set! (ly:grob-property grob 'long-text) + #{ \markup + \score + { + { \context MensuralStaff \with { + instrumentName = #instrument-name + \override VerticalAxisGroup + #'Y-extent = #'(-4 . 4) + } $incipit-music + } + \layout { $(ly:grob-layout grob) + line-width = \indent + indent = + % primitive-eval is probably easiest for + % escaping lexical closure and evaluating + % everything respective to (current-module). + #(primitive-eval + '(or (false-if-exception (- indent (* mm incipit-width))) + (* 0.5 indent))) + ragged-right = ##f + ragged-last = ##f + system-count = #1 } + } + #}) (system-start-text::print grob))) #})