X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=ly%2Fgregorian-init.ly;h=22470810837c5aa1e0fc2172e0d5dc1988578fdc;hb=47a6f18874c1f99f76702534a36186a79e47fe0d;hp=efab48580d75d8734a54fda0139625b291fda2c4;hpb=36f6cd546770e38c6e2314404e21f1c89504eb7d;p=lilypond.git diff --git a/ly/gregorian-init.ly b/ly/gregorian-init.ly index efab48580d..2247081083 100644 --- a/ly/gregorian-init.ly +++ b/ly/gregorian-init.ly @@ -1,11 +1,62 @@ -\version "2.6.0" +%{ + Shortcuts common for all styles of gregorian chant notation. + $Id: gregorian-init.ly,v 1.46 2006/06/06 21:19:17 reuter Exp $ +%} -%%%%%%%% -%%%%%%%% shortcuts common for all styles of gregorian chant notation -%%%%%%%% +\version "2.7.39" % -% declare head prefix shortcuts +% Declare memorable shortcuts for special unicode characters +% that are used in chant notation. +% + +% unicode 0132 (latin capital ligature IJ) +IJ = \lyricmode { IJ } +IIJ = \lyricmode { IIJ } + +% unicode 0133 (latin small ligature ij) +ij = \lyricmode { ij } +iij = \lyricmode { iij } + +% +% Given some music that represents lyrics, add a prefix to the first +% lyric event. +% +% TODO: Robustify this function. For example, this function works +% correctly for "\versus { some lyrics }", but it barfs with a wrong type +% argument error for e.g. "\versus some lyrics". +% +#(define (add-prefix-to-lyrics prefix music) + (make-music + 'SequentialMusic + 'elements (append + (cons + (let* ((elems (car (ly:music-property music 'elements))) + (props (ly:music-mutable-properties elems)) + (events (filter (lambda (x) + (equal? (car x) 'elements)) + props)) + (first-evt (cadar events)) + (first-syllable (ly:prob-property first-evt 'text)) + (first-duration (ly:prob-property first-evt 'duration))) + (make-music + 'LyricEvent + 'duration first-duration + 'text (string-append prefix first-syllable))) + (cdr (ly:music-property music 'elements)))))) + +% Add unicode 2123 (versicle) as prefix to lyrics. +versus = +#(define-music-function (parser location music) (ly:music?) + (add-prefix-to-lyrics "℣" music)) + +% Add unicode 211F (response) as prefix to lyrics. +responsum = +#(define-music-function (parser location music) (ly:music?) + (add-prefix-to-lyrics "℟" music)) + +% +% Declare head prefix shortcuts. % virga = \once \override NoteHead #'virga = ##t @@ -35,7 +86,7 @@ cavum = \once \override NoteHead #'cavum = ##t % -% declare divisiones shortcuts +% Declare divisiones shortcuts. % virgula = { \once \override BreathingSign #'text = #(make-musicglyph-markup "scripts.rcomma") @@ -56,7 +107,7 @@ caesura = { \breathe } divisioMinima = { - \once \override BreathingSign #'print-function = #Breathing_sign::divisio_minima + \once \override BreathingSign #'stencil = #ly:breathing-sign::divisio-minima % Workaround: add padding. Correct fix would be spacing engine handle this. \once \override BreathingSign #'extra-X-extent = #'(-1.0 . 0) @@ -64,8 +115,8 @@ divisioMinima = { \breathe } divisioMaior = { - \once \override BreathingSign #'print-function = #Breathing_sign::divisio_maior - \once \override BreathingSign #'Y-offset-callbacks = #'() + \once \override BreathingSign #'stencil = #ly:breathing-sign::divisio-maior + \once \override BreathingSign #'Y-offset = #0 % Workaround: add padding. Correct fix would be spacing engine handle this. \once \override BreathingSign #'extra-X-extent = #'(-1.0 . 0) @@ -73,8 +124,8 @@ divisioMaior = { \breathe } divisioMaxima = { - \once \override BreathingSign #'print-function = #Breathing_sign::divisio_maxima - \once \override BreathingSign #'Y-offset-callbacks = #'() + \once \override BreathingSign #'stencil = #ly:breathing-sign::divisio-maxima + \once \override BreathingSign #'Y-offset = #0 % Workaround: add padding. Correct fix would be spacing engine handle this. \once \override BreathingSign #'extra-X-extent = #'(-1.0 . 0) @@ -82,8 +133,8 @@ divisioMaxima = { \breathe } finalis = { - \once \override BreathingSign #'print-function = #Breathing_sign::finalis - \once \override BreathingSign #'Y-offset-callbacks = #'() + \once \override BreathingSign #'stencil = #ly:breathing-sign::finalis + \once \override BreathingSign #'Y-offset = #0 % Workaround: add padding. Correct fix would be spacing engine handle this. \once \override BreathingSign #'extra-X-extent = #'(-1.0 . 0) @@ -92,7 +143,7 @@ finalis = { } % -% declare articulation shortcuts +% Declare articulation shortcuts. % accentus = #(make-articulation "accentus") ictus = #(make-articulation "ictus") @@ -100,10 +151,16 @@ semicirculus = #(make-articulation "semicirculus") circulus = #(make-articulation "circulus") episemInitium = #(make-span-event 'TextSpanEvent START) episemFinis = #(make-span-event 'TextSpanEvent STOP) +augmentum = { + %%% TODO: A ligature head postfix that indicates that an + %%% augmentum dot should be appended to the right end of + %%% the surrounding ligature. [Not yet implemented.] +} + % -% shortcut music functions for Liber Hymnarius neumes table -% (experimental) +% Declare shortcut music functions for Liber Hymnarius neumes +% table (experimental). % #(define (make-ligature music) @@ -119,7 +176,7 @@ episemFinis = #(make-span-event 'TextSpanEvent STOP) 'elements (list (make-span-event 'LigatureEvent STOP))))))) -ligature = #(def-music-function +ligature = #(define-music-function (location music) (ly:music?) (make-ligature music)) @@ -138,13 +195,13 @@ ligature = #(def-music-function %#(define (add-staccato m) % (add-script m "staccato")) % -% % \applymusic #(lambda (x) (music-map add-staccato x)) { c c } +% % \applyMusic #(lambda (x) (music-map add-staccato x)) { c c } % % % \climacus { x y z ... }: % % \[ \virga x \inclinatum y \inclinatum z ... \] % %#(defmacro def-climacus-function (start stop) -% `(def-music-function (location music) (ly:music?) +% `(define-music-function (location music) (ly:music?) % (make-music 'SequentialMusic % 'elements (list 'LigatureStartEvent % (ly:music-deep-copy ,start) @@ -154,9 +211,78 @@ ligature = #(def-music-function %climacus = #(def-climacus-function startSequentialMusic stopSequentialMusic) % -% example layout block for gregorian chant notation +% Declare default layout; here for Vaticana style. In case there will +% be additional styles, we may want to create style-specific .ly files +% for inclusion (e.g. vaticana-init.ly), move the style-dependent stuff +% over there, leave the style-independent Gregorian stuff here, and let +% the style-specific file (vaticana-init.ly) include this file. The +% user then will have to include vaticana-init.ly instead of +% gregorian-init.ly. % +\layout { + indent = 0.0 + packed = ##t + %%% TODO: should raggedright be the default? + %ragged-right = ##t + ragged-last = ##t + + %%% FIXME: line-thickness should be set here to a slightly + %%% thicker value as the default; but we can not set it here, + %%% since neither \staff-space nor #staff-space is yet defined + %%% when lily comes across the following line. + %line-thickness = \staff-space / 7.0 + + \context { + \VaticanaStaff + \override StaffSymbol #'color = #red + \override LedgerLineSpanner #'color = #red + } + \context { + \Score + \remove "Bar_number_engraver" + + %%% + %%% FIXME: Musicologically seen, timing should be set to #f. + %%% Unfortunately, setting it to #f will result in no + %%% line-breakable items being created, such that the whole + %%% music will end up in a single line. Therefore, we + %%% currently set it to #t, until the ligature code is fixed + %%% to automatically insert breakable items. + %%% + timing = ##t + + %%% + %%% FIXME: Setting barAlways to #t would fix the above + %%% "timing = ##t" problem, but, surprisingly, it increases + %%% the space between ligatures. Hence, we set it to #f. + %%% + barAlways = ##f + + \override SpacingSpanner #'packed-spacing = ##t + + %%% + %%% TODO: Play around with the following SpacingSpanner + %%% settings to yield better spacing between ligatures. + %%% + %%% FIXME: setting #'spacing-increment to a small value + %%% causes tons of "programming error: adding reverse spring, + %%% setting to unit" messages. + %%% + %\override SpacingSpanner #'shortest-duration-space = #0 + %\override SpacingSpanner #'average-spacing-wishes = ##f + %\override SpacingSpanner #'spacing-increment = #0.0 + %\override SpacingSpanner #'uniform-stretching = ##t + } +} + +% +% neumeDemoLayout defines a layout block suitable for notating pure +% Vaticana style neumes without any other notation symbols such as +% staff lines or clefs. This layout is useful for engraving neumes +% tables, such as that one in the lilypond manual section on +% Gregorian ligatures, or for educational works. +% neumeDemoLayout = \layout { interscoreline = 1 \context { @@ -180,3 +306,7 @@ neumeDemoLayout = \layout { \override Stem #'transparent = ##t } } + +%%% Local Variables: +%%% coding: utf-8 +%%% End: