From: Neil Puttock Date: Sun, 31 Jan 2010 17:16:59 +0000 (+0000) Subject: LSR: Update. X-Git-Tag: release/2.13.12-1~13 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=119e3affc66e887412f897f95f2f8cec292c2555;p=lilypond.git LSR: Update. --- diff --git a/Documentation/snippets/adding-an-extra-staff.ly b/Documentation/snippets/adding-an-extra-staff.ly index 82e27b00bf..4d2ad062a8 100644 --- a/Documentation/snippets/adding-an-extra-staff.ly +++ b/Documentation/snippets/adding-an-extra-staff.ly @@ -28,7 +28,8 @@ piece. \new StaffGroup \relative c'' { \new Staff { c1 | c << - c1 \new Staff { + c1 + \new Staff { \once \override Staff.TimeSignature #'stencil = ##f c1 } diff --git a/Documentation/snippets/adding-parentheses-around-an-expressive-mark-or-chordal-note.ly b/Documentation/snippets/adding-parentheses-around-an-expressive-mark-or-chordal-note.ly index befd73950b..3d6407cdf1 100644 --- a/Documentation/snippets/adding-parentheses-around-an-expressive-mark-or-chordal-note.ly +++ b/Documentation/snippets/adding-parentheses-around-an-expressive-mark-or-chordal-note.ly @@ -17,8 +17,8 @@ objetos entre paréntesis. El grob asociado es texidoc = " The @code{\\parenthesize} function is a special tweak that encloses -objects in parentheses. The associated grob is -@code{Score.ParenthesesItem}. +objects in parentheses. The associated grob is @code{ParenthesesItem}. + " doctitle = "Adding parentheses around an expressive mark or chordal note" @@ -31,4 +31,3 @@ objects in parentheses. The associated grob is 2 } - diff --git a/Documentation/snippets/additional-voices-to-avoid-collisions.ly b/Documentation/snippets/additional-voices-to-avoid-collisions.ly index e9f24dafad..91e009f25a 100644 --- a/Documentation/snippets/additional-voices-to-avoid-collisions.ly +++ b/Documentation/snippets/additional-voices-to-avoid-collisions.ly @@ -48,24 +48,34 @@ a variable using the Scheme function @code{context-spec-music}. } % begin verbatim voiceFive = #(context-spec-music (make-voice-props-set 4) 'Voice) + \relative c'' { - \time 3/4 \key d \minor \partial 2 + \time 3/4 + \key d \minor + \partial 2 << - { \voiceOne + { + \voiceOne a4. a8 e'4 e4. e8 f4 d4. c8 - } \\ { + } + \\ + { \voiceThree f,2 bes4 a2 a4 s2 - } \\ { + } + \\ + { \voiceFive s2 g4 g2 f4 f2 - } \\ { + } + \\ + \bar "||"{ \voiceTwo d2 d4 cis2 diff --git a/Documentation/snippets/adjusting-the-shape-of-falls-and-doits.ly b/Documentation/snippets/adjusting-the-shape-of-falls-and-doits.ly index e5fbbc10a4..fdd8a2d069 100644 --- a/Documentation/snippets/adjusting-the-shape-of-falls-and-doits.ly +++ b/Documentation/snippets/adjusting-the-shape-of-falls-and-doits.ly @@ -41,9 +41,9 @@ adjust the shape of falls and doits. \relative c'' { \override Score.SpacingSpanner #'shortest-duration-space = #4.0 - c2-\bendAfter #+5 + c2-\bendAfter #5 c2-\bendAfter #-3 - c2-\bendAfter #+8 + c2-\bendAfter #8 c2-\bendAfter #-6 } diff --git a/Documentation/snippets/aligning-bar-numbers.ly b/Documentation/snippets/aligning-bar-numbers.ly index da7413ce72..0ab21064fc 100644 --- a/Documentation/snippets/aligning-bar-numbers.ly +++ b/Documentation/snippets/aligning-bar-numbers.ly @@ -55,7 +55,7 @@ positioned directly over the bar line or left-aligned to the bar line. \relative c' { \set Score.currentBarNumber = #111 - \override Score.BarNumber #'break-visibility = #'#(#t #t #t) + \override Score.BarNumber #'break-visibility = #all-visible % Increase the size of the bar number by 2 \override Score.BarNumber #'font-size = #2 % Print a bar number every second measure diff --git a/Documentation/snippets/ancient-headword.ly b/Documentation/snippets/ancient-headword.ly index a497db4e52..64d0feb1a7 100644 --- a/Documentation/snippets/ancient-headword.ly +++ b/Documentation/snippets/ancient-headword.ly @@ -5,10 +5,10 @@ \version "2.13.10" #(set-global-staff-size 15) -\paper{ - ragged-right=##t - line-width=17\cm - indent=0\cm +\paper { + ragged-right = ##t + line-width = 17\cm + indent = 0\cm } @@ -20,7 +20,8 @@ \layout { - \context { \Score + \context { + \Score \override PaperColumn #'keep-inside-line = ##t \override NonMusicalPaperColumn #'keep-inside-line = ##t } @@ -141,7 +142,6 @@ \layout { \context { \Staff - \consists Custos_engraver + \consists "Custos_engraver" } } - diff --git a/Documentation/snippets/broken-crescendo-hairpin.ly b/Documentation/snippets/broken-crescendo-hairpin.ly index f7c3d75160..7ee77e2f21 100644 --- a/Documentation/snippets/broken-crescendo-hairpin.ly +++ b/Documentation/snippets/broken-crescendo-hairpin.ly @@ -51,28 +51,31 @@ draw the rectangle over the hairpin. } % begin verbatim \relative c' { - << { - \dynamicUp - \override DynamicLineSpanner #'staff-padding = #4 - r2 r16 c'8.\pp r4 - } - \\ - { - \override DynamicLineSpanner #'layer = #0 - des,2\mf\< ~ - \override TextScript #'layer = #2 - des16_\markup { - \postscript #" - 1.9 -8 translate - 5 4 scale - 1 setgray - 0 0 moveto - 0 1 lineto - 1 1 lineto - 1 0 lineto - 0 0 lineto - fill" + << + { + \dynamicUp + \override DynamicLineSpanner #'staff-padding = #4 + r2 r16 c'8.\pp r4 } - r8. des4 ~ des16->\sff - } >> + \\ + { + \override DynamicLineSpanner #'layer = #0 + des,2\mf\< ~ + \override TextScript #'layer = #2 + des16_\markup { + \postscript #" + 1.9 -8 translate + 5 4 scale + 1 setgray + 0 0 moveto + 0 1 lineto + 1 1 lineto + 1 0 lineto + 0 0 lineto + fill" + } + r8. des4 ~ des16->\sff + } + >> } + diff --git a/Documentation/snippets/changing--flageolet-mark-size.ly b/Documentation/snippets/changing--flageolet-mark-size.ly index 5afaccdb07..5c76596715 100644 --- a/Documentation/snippets/changing--flageolet-mark-size.ly +++ b/Documentation/snippets/changing--flageolet-mark-size.ly @@ -40,12 +40,11 @@ function. } % begin verbatim smallFlageolet = -#(let ((m (make-music 'ArticulationEvent - 'articulation-type "flageolet"))) - (ly:music-set-property! m 'tweaks - (acons 'font-size -3 - (ly:music-property m 'tweaks))) - m) +#(let ((m (make-articulation "flageolet"))) + (set! (ly:music-property m 'tweaks) + (acons 'font-size -3 + (ly:music-property m 'tweaks))) + m) \layout { ragged-right = ##f } diff --git a/Documentation/snippets/changing-the-chord-names-to-german-or-semi-german-notation.ly b/Documentation/snippets/changing-the-chord-names-to-german-or-semi-german-notation.ly index e57456cbe2..8abf79b6b3 100644 --- a/Documentation/snippets/changing-the-chord-names-to-german-or-semi-german-notation.ly +++ b/Documentation/snippets/changing-the-chord-names-to-german-or-semi-german-notation.ly @@ -18,8 +18,8 @@ cifrado americano se puede cambiar por la alemana texidoc = " The english naming of chords (default) can be changed to german -(@code{\\germanChords} replaces B and Bes to H and B) or semi-german -(@code{\\semiGermanChords} replaces B and Bes to H and Bb). +(@code{\\germanChords} replaces B and Bes with H and B) or semi-german +(@code{\\semiGermanChords} replaces B and Bes with H and Bb). @@ -29,8 +29,8 @@ The english naming of chords (default) can be changed to german } % begin verbatim music = \chordmode { - c1/c cis/cis - b/b bis/bis bes/bes + c1/c | cis/cis + b1/b | bis/bis | bes/bes } %% The following is only here to print the names of the @@ -38,7 +38,10 @@ music = \chordmode { %% print them. \layout { - \context {\ChordNames \consists Instrument_name_engraver } + \context { + \ChordNames + \consists "Instrument_name_engraver" + } } << diff --git a/Documentation/snippets/changing-the-time-signature-without-affecting-the-beaming.ly b/Documentation/snippets/changing-the-time-signature-without-affecting-the-beaming.ly index 6d13b945fe..342236f69e 100644 --- a/Documentation/snippets/changing-the-time-signature-without-affecting-the-beaming.ly +++ b/Documentation/snippets/changing-the-time-signature-without-affecting-the-beaming.ly @@ -63,4 +63,3 @@ printed without changing any of the other properties: \markup { This snippet is deprecated as of 2.13.5 and will be removed in 2.14 } - diff --git a/Documentation/snippets/chords-headword.ly b/Documentation/snippets/chords-headword.ly index 05e298f4b3..8e5a9366de 100644 --- a/Documentation/snippets/chords-headword.ly +++ b/Documentation/snippets/chords-headword.ly @@ -4,10 +4,10 @@ %% Note: this file works from version 2.12.0 \version "2.13.10" #(set-global-staff-size 15) -\paper{ - ragged-right=##f - line-width=15\cm - indent=0\cm +\paper { + ragged-right = ##f + line-width = 15\cm + indent = 0\cm } \header { @@ -19,7 +19,8 @@ \layout { - \context { \Score + \context { + \Score \override PaperColumn #'keep-inside-line = ##t \override NonMusicalPaperColumn #'keep-inside-line = ##t } @@ -31,15 +32,15 @@ theChords = \chordmode { f2 bes2 | f1 | c2:7 f | c1 | \break } -verseOne = \lyricmode{ - \set stanza = "1. " +verseOne = \lyricmode { + \set stanza = #"1." Fair is the sun - shine, Fair - er the moon - light And all the stars __ _ in heav'n a -- bove; } -verseTwo = \lyricmode{ - \set stanza = "2. " +verseTwo = \lyricmode { + \set stanza = #"2." Fair are the mead - ows, Fair - er the wood - land, Robed in the flow -- ers of bloom -- ing spring; @@ -50,7 +51,7 @@ Soprano = { \key f \major \stemUp f'2 f'4 f' | g'4 e' f'2 | a'4. a'8 a'4 a' | bes'4 g' a'2 | -c''2 f''4 d'' | c''2 bes'4 a' | bes'2 a' | g'1 | + c''2 f''4 d'' | c''2 bes'4 a' | bes'2 a' | g'1 | } Alto = { @@ -84,8 +85,8 @@ Bass = { >> } } - \context Lyrics="LyrOne" \lyricsto "sop" {\verseOne} - \context Lyrics="LyrTwo" \lyricsto "sop" {\verseTwo} + \context Lyrics = "LyrOne" \lyricsto "sop" { \verseOne } + \context Lyrics = "LyrTwo" \lyricsto "sop" { \verseTwo } \context Staff = lower { \new Voice { \clef bass @@ -98,16 +99,16 @@ Bass = { } >> -\layout { - %between-system-space = 1\mm - indent = 0 - \context { - \Score - \remove "Bar_number_engraver" - } - \context { \Staff - \override VerticalAxisGroup #'minimum-Y-extent = #'(-1 . 1) - } + \layout { + indent = 0 + \context { + \Score + \remove "Bar_number_engraver" + } + \context { + \Voice + \override StanzaNumber #'padding = #1.8 + } } } \paper { } diff --git a/Documentation/snippets/coloring-notes-depending-on-their-pitch.ly b/Documentation/snippets/coloring-notes-depending-on-their-pitch.ly index 6f3d16f7dc..0ccb7715dd 100644 --- a/Documentation/snippets/coloring-notes-depending-on-their-pitch.ly +++ b/Documentation/snippets/coloring-notes-depending-on-their-pitch.ly @@ -17,37 +17,37 @@ to distinguish enharmonics. %Association list of pitches to colors. #(define color-mapping - (list - (cons (ly:make-pitch 0 0 0) (x11-color 'red)) - (cons (ly:make-pitch 0 0 1/2) (x11-color 'green)) - (cons (ly:make-pitch 0 1 -1/2) (x11-color 'green)) - (cons (ly:make-pitch 0 2 0) (x11-color 'red)) - (cons (ly:make-pitch 0 2 1/2) (x11-color 'green)) - (cons (ly:make-pitch 0 3 -1/2) (x11-color 'red)) - (cons (ly:make-pitch 0 3 0) (x11-color 'green)) - (cons (ly:make-pitch 0 4 1/2) (x11-color 'red)) - (cons (ly:make-pitch 0 5 0) (x11-color 'green)) - (cons (ly:make-pitch 0 5 -1/2) (x11-color 'red)) - (cons (ly:make-pitch 0 6 1/2) (x11-color 'red)) - (cons (ly:make-pitch 0 1 0) (x11-color 'blue)) - (cons (ly:make-pitch 0 3 1/2) (x11-color 'blue)) - (cons (ly:make-pitch 0 4 -1/2) (x11-color 'blue)) - (cons (ly:make-pitch 0 5 1/2) (x11-color 'blue)) - (cons (ly:make-pitch 0 6 -1/2) (x11-color 'blue)))) + (list + (cons (ly:make-pitch 0 0 NATURAL) (x11-color 'red)) + (cons (ly:make-pitch 0 0 SHARP) (x11-color 'green)) + (cons (ly:make-pitch 0 1 FLAT) (x11-color 'green)) + (cons (ly:make-pitch 0 2 NATURAL) (x11-color 'red)) + (cons (ly:make-pitch 0 2 SHARP) (x11-color 'green)) + (cons (ly:make-pitch 0 3 FLAT) (x11-color 'red)) + (cons (ly:make-pitch 0 3 NATURAL) (x11-color 'green)) + (cons (ly:make-pitch 0 4 SHARP) (x11-color 'red)) + (cons (ly:make-pitch 0 5 NATURAL) (x11-color 'green)) + (cons (ly:make-pitch 0 5 FLAT) (x11-color 'red)) + (cons (ly:make-pitch 0 6 SHARP) (x11-color 'red)) + (cons (ly:make-pitch 0 1 NATURAL) (x11-color 'blue)) + (cons (ly:make-pitch 0 3 SHARP) (x11-color 'blue)) + (cons (ly:make-pitch 0 4 FLAT) (x11-color 'blue)) + (cons (ly:make-pitch 0 5 SHARP) (x11-color 'blue)) + (cons (ly:make-pitch 0 6 FLAT) (x11-color 'blue)))) %Compare pitch and alteration (not octave). #(define (pitch-equals? p1 p2) - (and + (and (= (ly:pitch-alteration p1) (ly:pitch-alteration p2)) (= (ly:pitch-notename p1) (ly:pitch-notename p2)))) #(define (pitch-to-color pitch) - (let ((color (assoc pitch color-mapping pitch-equals?))) - (if color - (cdr color)))) + (let ((color (assoc pitch color-mapping pitch-equals?))) + (if color + (cdr color)))) #(define (color-notehead grob) - (pitch-to-color + (pitch-to-color (ly:event-property (event-cause grob) 'pitch))) \score { @@ -56,3 +56,4 @@ to distinguish enharmonics. c8 b d dis ees f g aes } } + diff --git a/Documentation/snippets/combining-two-parts-on-the-same-staff.ly b/Documentation/snippets/combining-two-parts-on-the-same-staff.ly index 518ba9a67c..b2f3599cdc 100644 --- a/Documentation/snippets/combining-two-parts-on-the-same-staff.ly +++ b/Documentation/snippets/combining-two-parts-on-the-same-staff.ly @@ -106,15 +106,15 @@ musicDown = \relative c'' { << << \new Staff { - \set Staff.instrumentName = "Standard polyphony " + \set Staff.instrumentName = #"Standard polyphony" << \musicUp \\ \musicDown >> } \new Staff \with { printPartCombineTexts = ##f } { - \set Staff.instrumentName = "PartCombine without texts " + \set Staff.instrumentName = #"PartCombine without texts" \partcombine \musicUp \musicDown } \new Staff { - \set Staff.instrumentName = "PartCombine with texts " + \set Staff.instrumentName = #"PartCombine with texts" \partcombine \musicUp \musicDown } >> diff --git a/Documentation/snippets/compound-time-signatures.ly b/Documentation/snippets/compound-time-signatures.ly index 7ac2b6418d..4e6045fe4c 100644 --- a/Documentation/snippets/compound-time-signatures.ly +++ b/Documentation/snippets/compound-time-signatures.ly @@ -59,12 +59,11 @@ database.) #(define ((compound-time one two num) grob) - (grob-interpret-markup grob - (markup #:override '(baseline-skip . 0) #:number - (#:line ( - (#:column (one num)) - #:vcenter "+" - (#:column (two num))))))) + (grob-interpret-markup grob + (markup #:override '(baseline-skip . 0) #:number + (#:line ((#:column (one num)) + #:vcenter "+" + (#:column (two num))))))) \relative c' { \override Staff.TimeSignature #'stencil = #(compound-time "2" "3" "8") diff --git a/Documentation/snippets/creating-arpeggios-across-notes-in-different-voices.ly b/Documentation/snippets/creating-arpeggios-across-notes-in-different-voices.ly index 8501d83b4f..1c090bf9c4 100644 --- a/Documentation/snippets/creating-arpeggios-across-notes-in-different-voices.ly +++ b/Documentation/snippets/creating-arpeggios-across-notes-in-different-voices.ly @@ -35,7 +35,7 @@ portée (@code{Staff}) permet de distribuer un arpège sur plusieurs voix : texidoc = " An arpeggio can be drawn across notes in different voices on the same -staff if the @code{Span_arpeggio_engraver} is moved to the @code{Staff} +staff if the @code{Span_arpeggio_engraver} is added to the @code{Staff} context: " @@ -48,7 +48,8 @@ context: \relative c' { \set Staff.connectArpeggios = ##t << - { 4\arpeggio 2 } \\ + { 4\arpeggio 2 } + \\ { 2\arpeggio 2 } >> } diff --git a/Documentation/snippets/creating-cross-staff-arpeggios-in-other-contexts.ly b/Documentation/snippets/creating-cross-staff-arpeggios-in-other-contexts.ly index 34c1b6b5b3..6a9b1d56bc 100644 --- a/Documentation/snippets/creating-cross-staff-arpeggios-in-other-contexts.ly +++ b/Documentation/snippets/creating-cross-staff-arpeggios-in-other-contexts.ly @@ -36,15 +36,15 @@ système autre que le @code{PianoStaff} dès lors que vous incluez le texidoc = " Cross-staff arpeggios can be created in contexts other than -@code{PianoStaff} if the @code{Span_arpeggio_engraver} is included in -the @code{Score} context. +@code{GrandStaff}, @code{PianoStaff} and @code{StaffGroup} if the +@code{Span_arpeggio_engraver} is included in the @code{Score} context. " doctitle = "Creating cross-staff arpeggios in other contexts" } % begin verbatim \score { - \new StaffGroup { + \new ChoirStaff { \set Score.connectArpeggios = ##t << \new Voice \relative c' { @@ -52,11 +52,11 @@ the @code{Score} context. 2\arpeggio 1\arpeggio } - \new Voice \relative c { + \new Voice \relative c { \clef bass - 2\arpeggio - 2\arpeggio - 1\arpeggio + 2\arpeggio + 2\arpeggio + 1\arpeggio } >> } diff --git a/Documentation/snippets/creating-text-spanners.ly b/Documentation/snippets/creating-text-spanners.ly index 728ec0adca..24e5caec19 100644 --- a/Documentation/snippets/creating-text-spanners.ly +++ b/Documentation/snippets/creating-text-spanners.ly @@ -62,3 +62,4 @@ to modify its output. b4 c a4 \stopTextSpan } + diff --git a/Documentation/snippets/displaying-grob-ancestry.ly b/Documentation/snippets/displaying-grob-ancestry.ly index d26184ffb6..95e124dd67 100644 --- a/Documentation/snippets/displaying-grob-ancestry.ly +++ b/Documentation/snippets/displaying-grob-ancestry.ly @@ -1,6 +1,7 @@ -%% Do not edit this file; it is automatically -%% generated from LSR http://lsr.dsi.unimi.it -%% This file is in the public domain. +% Do not edit this file; it is automatically +% generated from Documentation/snippets/new +% This file is in the public domain. +%% Note: this file works from version 2.13.10 \version "2.13.10" \header { @@ -8,19 +9,31 @@ texidoc = " When working with grob callbacks, it can be helpful to understand a -grob's @qq{ancestry}. Most grobs have @qq{parents} which influence the -positioning of the grob. X- and Y-parents influence the horizontal and -vertical positions for the grob, respectively. Additionally, each +grob's @qq{ancestry}. Most grobs have @qq{parents} which influence the +positioning of the grob. X- and Y-parents influence the horizontal and +vertical positions for the grob, respectively. Additionally, each parent may have parents of its own. -Unfortunately, there are several aspects of a grob's ancestry can lead -to confusion: +Unfortunately, there are several aspects of a grob's ancestry that can +lead to confusion: -* The types of parents a grob has may depend on context. * For some -grobs, the X- and Y-parents are the same. * A particular @qq{ancestor} -may be related to a grob in multiple ways. * The concept of -@qq{generations} is misleading. + +@itemize + +@item +The types of parents a grob has may depend on context. + +@item +For some grobs, the X- and Y-parents are the same. + +@item +A particular @qq{ancestor} may be related to a grob in multiple ways. + +@item +The concept of @qq{generations} is misleading. + +@end itemize For example, the @code{System} grob can be both parent (on the Y-side) @@ -34,15 +47,18 @@ ancestry. When called this way - +@example @{ - \\once \\override NoteHead #'before-line-breaking = #display-ancestry - c @} + \\once \\override NoteHead #'before-line-breaking = #display-ancestry + c4 +@} +@end example The following output is generated: +@example ------------------------------------ NoteHead X,Y: NoteColumn @@ -55,13 +71,14 @@ NoteHead X,Y: NoteColumn X: NonMusicalPaperColumn X,Y: System Y: System - +@end example " doctitle = "Displaying grob ancestry" } % begin verbatim + #(define (grob-name grob) (if (ly:grob? grob) (assoc-ref (ly:grob-property grob 'meta) 'name) @@ -113,9 +130,8 @@ NoteHead X,Y: NoteColumn \relative c' { \once \override NoteHead #'before-line-breaking = #display-ancestry - f + f4 \once \override Accidental #'before-line-breaking = #display-ancestry \once \override Arpeggio #'before-line-breaking = #display-ancestry - \arpeggio + 4\arpeggio } - diff --git a/Documentation/snippets/dynamics-custom-text-spanner-postfix.ly b/Documentation/snippets/dynamics-custom-text-spanner-postfix.ly index 418c26a709..f57ea07757 100644 --- a/Documentation/snippets/dynamics-custom-text-spanner-postfix.ly +++ b/Documentation/snippets/dynamics-custom-text-spanner-postfix.ly @@ -1,7 +1,7 @@ % Do not edit this file; it is automatically % generated from Documentation/snippets/new % This file is in the public domain. -%% Note: this file works from version 2.13.4 +%% Note: this file works from version 2.13.8 \version "2.13.10" \header { @@ -16,12 +16,18 @@ otherwise the spanner start will rather be assigned to the next note. % Two functions for (de)crescendo spanners where you can explicitly give the % spanner text. -mycresc = #(define-music-function (parser location mymarkup) (string?) - (make-music 'CrescendoEvent 'span-direction START - 'span-type 'text 'span-text mymarkup)) -mydecresc = #(define-music-function (parser location mymarkup) (string?) - (make-music 'DecrescendoEvent 'span-direction START - 'span-type 'text 'span-text mymarkup)) +mycresc = +#(define-music-function (parser location mymarkup) (markup?) + (make-music 'CrescendoEvent + 'span-direction START + 'span-type 'text + 'span-text mymarkup)) +mydecresc = +#(define-music-function (parser location mymarkup) (markup?) + (make-music 'DecrescendoEvent + 'span-direction START + 'span-type 'text + 'span-text mymarkup)) \relative c' { c4-\mycresc "custom cresc" c4 c4 c4 | diff --git a/Documentation/snippets/dynamics-text-spanner-postfix.ly b/Documentation/snippets/dynamics-text-spanner-postfix.ly index fb142b76d5..90811e1f1c 100644 --- a/Documentation/snippets/dynamics-text-spanner-postfix.ly +++ b/Documentation/snippets/dynamics-text-spanner-postfix.ly @@ -16,15 +16,27 @@ hairpins by default, \cresc etc. produce text spanners by default. % Some sample text dynamic spanners, to be used as postfix operators -crpoco = #(make-music 'CrescendoEvent 'span-direction START - 'span-type 'text 'span-text "cresc. poco a poco") +crpoco = +#(make-music 'CrescendoEvent + 'span-direction START + 'span-type 'text + 'span-text "cresc. poco a poco") % Redefine the existing \cresc, \dim and \decresc commands to use postfix syntax -cresc = #(make-music 'CrescendoEvent 'span-direction START - 'span-type 'text 'span-text "cresc.") -dim = #(make-music 'DecrescendoEvent 'span-direction START - 'span-type 'text 'span-text "dim.") -decresc = #(make-music 'DecrescendoEvent 'span-direction START - 'span-type 'text 'span-text "decresc.") +cresc = +#(make-music 'CrescendoEvent + 'span-direction START + 'span-type 'text + 'span-text "cresc.") +dim = +#(make-music 'DecrescendoEvent + 'span-direction START + 'span-type 'text + 'span-text "dim.") +decresc = +#(make-music 'DecrescendoEvent + 'span-direction START + 'span-type 'text + 'span-text "decresc.") \relative c' { c4\cresc d4 e4 f4 | diff --git a/Documentation/snippets/editorial-headword.ly b/Documentation/snippets/editorial-headword.ly index ddd9c94d57..10aab99ddd 100644 --- a/Documentation/snippets/editorial-headword.ly +++ b/Documentation/snippets/editorial-headword.ly @@ -5,10 +5,10 @@ \version "2.13.10" \include "english.ly" #(set-global-staff-size 15) -\paper{ - ragged-right=##t - line-width=17\cm - indent=0\cm +\paper { + ragged-right = ##t + line-width = 17\cm + indent = 0\cm } @@ -20,7 +20,8 @@ \layout { - \context { \Score + \context { + \Score \override PaperColumn #'keep-inside-line = ##t \override NonMusicalPaperColumn #'keep-inside-line = ##t } @@ -32,82 +33,80 @@ % Piano sonata 18, Movt II, Scherzo % Measures 9 - 14 -\layout { } - \new PianoStaff << - % RH Staff - \new Staff { - \clef treble - \key af \major - \time 2/4 - \set Staff.fingeringOrientations = #'(up up) - \set Score.currentBarNumber = #9 - \partial 8 - 8 \staccato - | - \set doubleSlurs = ##t - 4 ( - 8 \staccato ) - \noBeam - c''8-5 \staccato \pp - | - \set doubleSlurs = ##f - bf'8.. ( - af'32 - g'8 ) \staccato - f'8 \staccato - | - e'4-2 - r8 - \once \override Script #'script-priority = #-100 - \afterGrace - f'8 ( \trill ^ \markup { \finger "3-2" } - { e'16 [ f'16 ] } - | - g'8..-3 - f'32 - e'8-1 ) \staccato - d'8-2 \staccato - | - c'4 - r4 - } + % RH Staff + \new Staff { + \clef treble + \key af \major + \time 2/4 + \set Staff.fingeringOrientations = #'(up) + \set Score.currentBarNumber = #9 + \partial 8 + 8 \staccato + | + \set doubleSlurs = ##t + 4 ( + 8 \staccato ) + \noBeam + c''8-5 \staccato \pp + | + \set doubleSlurs = ##f + bf'8.. ( + af'32 + g'8 ) \staccato + f'8 \staccato + | + e'4-2 + r8 + \once \override Script #'script-priority = #-100 + \afterGrace + f'8 ( \trill ^ \markup { \finger "3-2" } + { e'16 [ f'16 ] } + | + g'8..-3 + f'32 + e'8-1 ) \staccato + d'8-2 \staccato + | + c'4 + r4 + } - % LH Staff - \new Staff { - \key af \major - \clef treble - \override Fingering #'direction = #down - \set Staff.fingeringOrientations = #'(down down) - \partial 8 - 8 \staccato - \set doubleSlurs = ##t - 4 ( - 8 ) \staccato - \noBeam - \clef bass - c'8-1 \staccato - | - \set doubleSlurs = ##f - bf8.. ( - af32 - g8-1 ) \staccato - f8 \staccato - | - e4 - r8 - \afterGrace - f8 ( \trill _ \markup { \finger "2-1" } - { e16 [ f16 ] } - | - g8..-1 - f32 - e8 ) \staccato - d8 \staccato - | - c4 - r4 - } + % LH Staff + \new Staff { + \key af \major + \clef treble + \override Fingering #'direction = #down + \set Staff.fingeringOrientations = #'(down) + \partial 8 + 8 \staccato + \set doubleSlurs = ##t + 4 ( + 8 ) \staccato + \noBeam + \clef bass + c'8-1 \staccato + | + \set doubleSlurs = ##f + bf8.. ( + af32 + g8-1 ) \staccato + f8 \staccato + | + e4 + r8 + \afterGrace + f8 ( \trill _ \markup { \finger "2-1" } + { e16 [ f16 ] } + | + g8..-1 + f32 + e8 ) \staccato + d8 \staccato + | + c4 + r4 + } >> diff --git a/Documentation/snippets/engraving-ties-manually.ly b/Documentation/snippets/engraving-ties-manually.ly index a979d96426..d5feabc49f 100644 --- a/Documentation/snippets/engraving-ties-manually.ly +++ b/Documentation/snippets/engraving-ties-manually.ly @@ -53,6 +53,6 @@ number indicates the direction (1 = up, -1 = down). 2 ~ \override TieColumn #'tie-configuration = #'((0.0 . 1) (-2.0 . 1) (-4.0 . 1)) - ~ + 2 ~ } diff --git a/Documentation/snippets/entering-several-tuplets-using-only-one--times-command.ly b/Documentation/snippets/entering-several-tuplets-using-only-one--times-command.ly index b9c2509724..82fa98ab90 100644 --- a/Documentation/snippets/entering-several-tuplets-using-only-one--times-command.ly +++ b/Documentation/snippets/entering-several-tuplets-using-only-one--times-command.ly @@ -65,7 +65,7 @@ entered only once. Read the relevant sections of the Notation Reference for more -information about @code{make-moment}. +information about @code{ly:make-moment}. " doctitle = "Entering several tuplets using only one \\times command" diff --git a/Documentation/snippets/figured-bass-headword.ly b/Documentation/snippets/figured-bass-headword.ly index 58a6e54b30..0214d4e7ce 100644 --- a/Documentation/snippets/figured-bass-headword.ly +++ b/Documentation/snippets/figured-bass-headword.ly @@ -4,14 +4,15 @@ %% Note: this file works from version 2.12.0 \version "2.13.10" #(set-global-staff-size 15) -\paper{ - ragged-right=##f - line-width=16\cm - indent=1.5\cm +\paper { + ragged-right = ##f + line-width = 16\cm + indent = 1.5\cm } \layout { - \context { \Score + \context { + \Score \override PaperColumn #'keep-inside-line = ##t \override NonMusicalPaperColumn #'keep-inside-line = ##t } @@ -43,7 +44,6 @@ extendOff = \bassFigureExtendersOff \new Staff = "violinoI" { \set Staff.instrumentName = \markup { - \hcenter-in #11 \line { Violino I. } } \time 4/4 @@ -62,7 +62,6 @@ extendOff = \bassFigureExtendersOff \new Staff = "violinoII" { \set Staff.instrumentName = \markup { - \hcenter-in #11 \line { Violino II. } } \time 4/4 @@ -81,11 +80,9 @@ extendOff = \bassFigureExtendersOff \new Staff = "violone" { \set Staff.instrumentName = \markup { - \hcenter-in #13 { - \center-column { - Violone, - \line { e Cembalo. } - } + \center-column { + Violone, + \line { e Cembalo. } } } \time 4/4 diff --git a/Documentation/snippets/flamenco-notation.ly b/Documentation/snippets/flamenco-notation.ly index d1b40d8177..ef18d4962c 100644 --- a/Documentation/snippets/flamenco-notation.ly +++ b/Documentation/snippets/flamenco-notation.ly @@ -1,6 +1,7 @@ -%% Do not edit this file; it is automatically -%% generated from LSR http://lsr.dsi.unimi.it -%% This file is in the public domain. +% Do not edit this file; it is automatically +% generated from Documentation/snippets/new +% This file is in the public domain. +%% Note: this file works from version 2.13.10 \version "2.13.10" \header { @@ -10,15 +11,32 @@ For flamenco guitar, special notation is used: -* a golpe symbol to indicate a slap on the guitar body with the nail of -the ring finger * an arrow to indicate (the direction of) strokes * +@itemize + +@item +a golpe symbol to indicate a slap on the guitar body with the nail of +the ring finger + +@item +an arrow to indicate (the direction of) strokes + +@item different letters for fingering (@qq{p}: thumb, @qq{i}: index finger, -@qq{m}: middle finger, @qq{a}: ring finger and @qq{x}: little finger) * -3- and 4-finger rasgueados; stroke upwards with all fingers, ending -with an up- and down using the index finger * abanicos: strokes (in -tuples) with thumb (down), little and index finger (both up). There's -also an abanico 2 where middle and ring finger are used instead of the -little finger. * alza pua: fast playing with the thumb +@qq{m}: middle finger, @qq{a}: ring finger and @qq{x}: little finger) + +@item +3- and 4-finger rasgueados: stroke upwards with all fingers, ending +with an up- and down using the index finger + +@item +abanicos: strokes (in tuples) with thumb (down), little and index finger +(both up) (there is also an abanico 2 where middle and ring finger are +used instead of the little finger) + +@item +alza pua: fast playing with the thumb + +@end itemize Most figures use arrows in combination with fingering; with abanicos @@ -31,13 +49,14 @@ This snippet contains some header-like code that can be copied as doctitle = "Flamenco notation" } % begin verbatim + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%% Cut here ----- Start 'flamenco.ly' % Text indicators -abanico = \markup { \italic Abanico } +abanico = \markup { \italic Abanico } rasgueaso = \markup { \italic Ras. } -alzapua = \markup { \italic Alzapua } +alzapua = \markup { \italic Alzapua } % Finger stroke symbols strokeUp = \markup { \postscript #" @@ -75,20 +94,20 @@ golpe = \markup { \postscript #" stroke "} -strokeUpGolpe = \markup { \column { \golpe \line { \strokeUp }}} -iUpGolpe = \markup { \column { \golpe \line { \small i } \line { \strokeUp }}} +strokeUpGolpe = \markup { \column { \golpe \line { \strokeUp } } } +iUpGolpe = \markup { \column { \golpe \line { \small i } \line { \strokeUp } } } % Strokes for all fingers -pUp = \markup { \column { \small p \line { \strokeUp }}} -pDown = \markup { \column { \small p \line { \strokeDown }}} -iUp = \markup { \column { \small i \line { \strokeUp }}} -iDown = \markup { \column { \small i \line { \strokeDown }}} -mUp = \markup { \column { \small m \line { \strokeUp }}} -mDown = \markup { \column { \small m \line { \strokeDown }}} -aUp = \markup { \column { \small a \line { \strokeUp }}} -aDown = \markup { \column { \small a \line { \strokeDown }}} -xUp = \markup { \column { \small x \line { \strokeUp }}} -xDown = \markup { \column { \small x \line { \strokeDown }}} +pUp = \markup { \column { \small p \line { \strokeUp } } } +pDown = \markup { \column { \small p \line { \strokeDown } } } +iUp = \markup { \column { \small i \line { \strokeUp } } } +iDown = \markup { \column { \small i \line { \strokeDown } } } +mUp = \markup { \column { \small m \line { \strokeUp } } } +mDown = \markup { \column { \small m \line { \strokeDown } } } +aUp = \markup { \column { \small a \line { \strokeUp } } } +aDown = \markup { \column { \small a \line { \strokeDown } } } +xUp = \markup { \column { \small x \line { \strokeUp } } } +xDown = \markup { \column { \small x \line { \strokeDown } } } % Just handy :) @@ -234,5 +253,3 @@ part = \relative c' { ragged-right = ##t } } - - diff --git a/Documentation/snippets/flat-flags-and-beam-nibs.ly b/Documentation/snippets/flat-flags-and-beam-nibs.ly index 8363d62f77..458b41db00 100644 --- a/Documentation/snippets/flat-flags-and-beam-nibs.ly +++ b/Documentation/snippets/flat-flags-and-beam-nibs.ly @@ -158,14 +158,12 @@ carry both a left- and right-pointing flat flag. Do this with paired c16[] r8. } - % Example 2 \new RhythmicStaff { r8. \set stemRightBeamCount = #0 c16[] } - % Example 3 \new RhythmicStaff { c16 c @@ -174,7 +172,6 @@ carry both a left- and right-pointing flat flag. Do this with paired \set stemLeftBeamCount = #2 c16 c c } - % Example 4 \new RhythmicStaff { c16 c diff --git a/Documentation/snippets/forcing-rehearsal-marks-to-start-from-a-given-letter-or-number.ly b/Documentation/snippets/forcing-rehearsal-marks-to-start-from-a-given-letter-or-number.ly index 9452bb60c8..5d0178502b 100644 --- a/Documentation/snippets/forcing-rehearsal-marks-to-start-from-a-given-letter-or-number.ly +++ b/Documentation/snippets/forcing-rehearsal-marks-to-start-from-a-given-letter-or-number.ly @@ -14,7 +14,7 @@ marks, but from the letter or number desired. doctitle = "Forcing rehearsal marks to start from a given letter or number" } % begin verbatim -\relative c''{ +\relative c'' { c1 \mark \default c1 \mark \default c1 \mark \default diff --git a/Documentation/snippets/grouping-beats.ly b/Documentation/snippets/grouping-beats.ly index e083b9e142..23292c8bde 100644 --- a/Documentation/snippets/grouping-beats.ly +++ b/Documentation/snippets/grouping-beats.ly @@ -41,12 +41,7 @@ Beaming patterns may be altered with the @code{beatGrouping} property: } % begin verbatim -\relative c'' { - \time 5/16 - \overrideBeamSettings #'Score #'(5 . 16) #'end - #'((* . (2 3))) - c8^"(2+3)" c16 c8 - \overrideBeamSettings #'Score #'(5 . 16) #'end - #'((* . (3 2))) - c8^"(3+2)" c16 c8 +\markup { + This snippet is deprecated as of version 2.13.5 and will be removed + in version 2.14. } diff --git a/Documentation/snippets/guitar-strum-rhythms.ly b/Documentation/snippets/guitar-strum-rhythms.ly index f333ef4144..de61ba3182 100644 --- a/Documentation/snippets/guitar-strum-rhythms.ly +++ b/Documentation/snippets/guitar-strum-rhythms.ly @@ -44,12 +44,12 @@ melody notes, chord names and fret diagrams. << \new ChordNames { \chordmode { - c1 f g c + c1 | f | g | c } } \new FretBoards { \chordmode { - c1 f g c + c1 | f | g | c } } \new Voice \with { @@ -78,3 +78,4 @@ melody notes, chord names and fret diagrams. } } >> + diff --git a/Documentation/snippets/heavily-customized-polymetric-time-signatures.ly b/Documentation/snippets/heavily-customized-polymetric-time-signatures.ly index d9ec5803f7..f9276ab352 100644 --- a/Documentation/snippets/heavily-customized-polymetric-time-signatures.ly +++ b/Documentation/snippets/heavily-customized-polymetric-time-signatures.ly @@ -17,22 +17,20 @@ is the template of a real Balkan song!). #(define plus (markup #:vcenter "+")) #(define ((custom-time-signature one two three four five six - seven eight nine ten eleven num) grob) - (grob-interpret-markup grob - (markup #:override '(baseline-skip . 0) #:number - (#:line ( - (#:column (one num)) plus - (#:column (two num)) plus - (#:column (three num)) plus - (#:column (four num)) plus - (#:column (five num)) plus - (#:column (six num)) plus - (#:column (seven num)) plus - (#:column (eight num)) plus - (#:column (nine num)) plus - (#:column (ten num)) plus - (#:column (eleven num))))))) - + seven eight nine ten eleven num) grob) + (grob-interpret-markup grob + (markup #:override '(baseline-skip . 0) #:number + (#:line ((#:column (one num)) plus + (#:column (two num)) plus + (#:column (three num)) plus + (#:column (four num)) plus + (#:column (five num)) plus + (#:column (six num)) plus + (#:column (seven num)) plus + (#:column (eight num)) plus + (#:column (nine num)) plus + (#:column (ten num)) plus + (#:column (eleven num))))))) melody = \relative c'' { \set Staff.instrumentName = #"Bb Sop." \key g \major @@ -48,7 +46,7 @@ melody = \relative c'' { } drum = \new DrumStaff \drummode { - \bar "|:" bd4.^\markup { "Drums" } sn4 bd \bar ":" sn4. + \bar "|:" bd4.^\markup { Drums } sn4 bd \bar ":" sn4. bd4 sn \bar ":" bd sn bd4. sn4 bd \bar ":|" } @@ -56,3 +54,4 @@ drum = \new DrumStaff \drummode { \melody \drum } + diff --git a/Documentation/snippets/horizontally-aligning-custom-dynamics-e.g.-sempre-pp,-piu-f,-subito-p.ly b/Documentation/snippets/horizontally-aligning-custom-dynamics-e.g.-sempre-pp,-piu-f,-subito-p.ly index e679a2fda5..4aa3058d15 100644 --- a/Documentation/snippets/horizontally-aligning-custom-dynamics-e.g.-sempre-pp,-piu-f,-subito-p.ly +++ b/Documentation/snippets/horizontally-aligning-custom-dynamics-e.g.-sempre-pp,-piu-f,-subito-p.ly @@ -64,9 +64,9 @@ semppMarkup = \markup { \halign #1.4 \italic "sempre" \dynamic "pp" } semppK = #(make-dynamic-script (markup #:line - (#:normal-text - #:italic "sempre" - #:dynamic "pp"))) + (#:normal-text + #:italic "sempre" + #:dynamic "pp"))) % Solution 3: Padding the dynamic script so the center-alignment % puts it at the correct position @@ -74,10 +74,10 @@ semppK = semppT = #(make-dynamic-script (markup #:line - (#:normal-text - #:italic "sempre" - #:dynamic "pp" - #:hspace 7.1))) + (#:normal-text + #:italic "sempre" + #:dynamic "pp" + #:hspace 7.1))) % Solution 4: Dynamic, setting the dimensions of the additional text to 0 % Drawback: To lilypond "sempre" has no extent, so it might put @@ -86,26 +86,37 @@ semppT = % same alignment as without the additional text semppM = #(make-dynamic-script - (markup #:line (#:with-dimensions '(0 . 0) '(0 . 0) - #:right-align #:normal-text #:italic "sempre" #:dynamic "pp"))) + (markup #:line + (#:with-dimensions '(0 . 0) '(0 . 0) + #:right-align + #:normal-text + #:italic "sempre" + #:dynamic "pp"))) % Solution 5: Dynamic with explicit shifting inside the scheme function semppG = #(make-dynamic-script - (markup - #:hspace 0 #:translate '(-18.85 . 0) - #:line( #:normal-text #:italic "sempre" #:dynamic "pp"))) - -% Solution 6: Dynamic with explicit alignment. This has only effect, if one sets X-offset! + (markup #:hspace 0 + #:translate '(-18.85 . 0) + #:line (#:normal-text + #:italic "sempre" + #:dynamic "pp"))) + +% Solution 6: Dynamic with explicit alignment. This has only effect +% if one sets X-offset! % Drawback: One needs to set DynamicText #'X-offset! -% Drawback: Aligned at the right edge of the additional text, not at the center of pp +% Drawback: Aligned at the right edge of the additional text, +% not at the center of pp semppMII = -#(make-dynamic-script (markup #:line(#:right-align - #:normal-text #:italic "sempre" #:dynamic "pp"))) +#(make-dynamic-script + (markup #:line (#:right-align + #:normal-text + #:italic "sempre" + #:dynamic "pp"))) \context StaffGroup << \context Staff = "s" << - \set Staff.instrumentName = "Normal" + \set Staff.instrumentName = #"Normal" \relative c'' { \key es \major c4\pp c\p c c | c\ff c c\pp c @@ -160,3 +171,4 @@ semppMII = } >> >> + diff --git a/Documentation/snippets/inserting-score-fragments-above-a-staff,-as-markups.ly b/Documentation/snippets/inserting-score-fragments-above-a-staff,-as-markups.ly index 336062a245..e70d22ab29 100644 --- a/Documentation/snippets/inserting-score-fragments-above-a-staff,-as-markups.ly +++ b/Documentation/snippets/inserting-score-fragments-above-a-staff,-as-markups.ly @@ -18,7 +18,8 @@ tuning = \markup { \score { \new Staff \with { \remove "Time_signature_engraver" } { - \clef bass 1 + \clef bass + 1 } \layout { ragged-right = ##t } } diff --git a/Documentation/snippets/jazz-combo-template.ly b/Documentation/snippets/jazz-combo-template.ly index 0d54057d2d..27d860f786 100644 --- a/Documentation/snippets/jazz-combo-template.ly +++ b/Documentation/snippets/jazz-combo-template.ly @@ -221,7 +221,7 @@ PianoRH = { PianoLH = { \clef bass \global - \set Staff.midiInstrument = "acoustic grand" + \set Staff.midiInstrument = #"acoustic grand" << \new Voice = "one" \lhUpper \new Voice = "two" \lhLower @@ -293,7 +293,6 @@ drumContents = { \new DrumStaff \drumContents >> >> - \layout { \context { \RemoveEmptyStaffContext } \context { @@ -303,7 +302,6 @@ drumContents = { skipBars = ##t } } - \midi { } } diff --git a/Documentation/snippets/keyboard-headword.ly b/Documentation/snippets/keyboard-headword.ly index 7a8f147366..aebd0beec5 100644 --- a/Documentation/snippets/keyboard-headword.ly +++ b/Documentation/snippets/keyboard-headword.ly @@ -90,7 +90,7 @@ fermataLong = \markup { \clef bass 4 ( ^ \markup \bold { Rall. } \override Script #'stencil = #(lambda (grob) - ly:script::print (grob-interpret-markup grob fermataLong)) + (grob-interpret-markup grob fermataLong)) 8 ) \fermata \noBeam \clef treble diff --git a/Documentation/snippets/letter-tablature-formatting.ly b/Documentation/snippets/letter-tablature-formatting.ly index c3baf70353..1646e3b529 100644 --- a/Documentation/snippets/letter-tablature-formatting.ly +++ b/Documentation/snippets/letter-tablature-formatting.ly @@ -1,6 +1,7 @@ -%% Do not edit this file; it is automatically -%% generated from LSR http://lsr.dsi.unimi.it -%% This file is in the public domain. +% Do not edit this file; it is automatically +% generated from Documentation/snippets/new +% This file is in the public domain. +%% Note: this file works from version 2.13.10 \version "2.13.10" \header { @@ -13,15 +14,6 @@ Tablature can be formatted using letters instead of numbers. doctitle = "Letter tablature formatting" } % begin verbatim -#(define (letter-tablature-format str context event) - (let ((tuning (ly:context-property context 'stringTunings)) - (pitch (ly:event-property event 'pitch))) - (make-whiteout-markup - (make-vcenter-markup - (string (integer->char - (+ (char->integer #\a) - (- (ly:pitch-semitones pitch) - (list-ref tuning (- str 1)))))))))) music = \relative c { c4 d e f @@ -35,7 +27,7 @@ music = \relative c { \music } \new TabStaff \with { - tablatureFormat = #letter-tablature-format + tablatureFormat = #fret-letter-tablature-format } { \music diff --git a/Documentation/snippets/making-slurs-with-complex-dash-structure.ly b/Documentation/snippets/making-slurs-with-complex-dash-structure.ly index 3a6e98de1e..8b068eca26 100644 --- a/Documentation/snippets/making-slurs-with-complex-dash-structure.ly +++ b/Documentation/snippets/making-slurs-with-complex-dash-structure.ly @@ -103,10 +103,10 @@ set to 1 for a solid slur. Slur #'dash-definition = #'((0 0.3 0.1 0.75) (0.3 0.6 1 1) (0.65 1.0 0.4 0.75)) - c( d e f) + c4( d e f) \once \override Slur #'dash-definition = #'((0 0.25 1 1) (0.3 0.7 0.4 0.75) (0.75 1.0 1 1)) - c( d e f) + c4( d e f) } diff --git a/Documentation/snippets/modifying-default-values-for-articulation-shorthand-notation.ly b/Documentation/snippets/modifying-default-values-for-articulation-shorthand-notation.ly index a9d0cbaf5b..8f10d91051 100644 --- a/Documentation/snippets/modifying-default-values-for-articulation-shorthand-notation.ly +++ b/Documentation/snippets/modifying-default-values-for-articulation-shorthand-notation.ly @@ -65,6 +65,8 @@ the default + symbol, assign the value @code{trill} to the variable } % begin verbatim \relative c'' { c1-+ } + dashPlus = "trill" + \relative c'' { c1-+ } diff --git a/Documentation/snippets/new/ancient-headword.ly b/Documentation/snippets/new/ancient-headword.ly index 6fb70574b4..d055bff585 100644 --- a/Documentation/snippets/new/ancient-headword.ly +++ b/Documentation/snippets/new/ancient-headword.ly @@ -1,10 +1,10 @@ \version "2.12.0" #(set-global-staff-size 15) -\paper{ - ragged-right=##t - line-width=17\cm - indent=0\cm +\paper { + ragged-right = ##t + line-width = 17\cm + indent = 0\cm } @@ -15,7 +15,8 @@ } \layout { - \context { \Score + \context { + \Score \override PaperColumn #'keep-inside-line = ##t \override NonMusicalPaperColumn #'keep-inside-line = ##t } @@ -136,7 +137,6 @@ \layout { \context { \Staff - \consists Custos_engraver + \consists "Custos_engraver" } } - diff --git a/Documentation/snippets/new/changing-the-time-signature-without-affecting-the-beaming.ly b/Documentation/snippets/new/changing-the-time-signature-without-affecting-the-beaming.ly index f045606ee7..b583f80430 100644 --- a/Documentation/snippets/new/changing-the-time-signature-without-affecting-the-beaming.ly +++ b/Documentation/snippets/new/changing-the-time-signature-without-affecting-the-beaming.ly @@ -17,4 +17,3 @@ printed without changing any of the other properties: \markup { This snippet is deprecated as of 2.13.5 and will be removed in 2.14 } - diff --git a/Documentation/snippets/new/chords-headword.ly b/Documentation/snippets/new/chords-headword.ly index 9fcc5ce5b6..f726138f43 100644 --- a/Documentation/snippets/new/chords-headword.ly +++ b/Documentation/snippets/new/chords-headword.ly @@ -1,9 +1,9 @@ \version "2.12.0" #(set-global-staff-size 15) -\paper{ - ragged-right=##f - line-width=15\cm - indent=0\cm +\paper { + ragged-right = ##f + line-width = 15\cm + indent = 0\cm } \header { @@ -14,7 +14,8 @@ \layout { - \context { \Score + \context { + \Score \override PaperColumn #'keep-inside-line = ##t \override NonMusicalPaperColumn #'keep-inside-line = ##t } @@ -26,15 +27,15 @@ theChords = \chordmode { f2 bes2 | f1 | c2:7 f | c1 | \break } -verseOne = \lyricmode{ - \set stanza = "1. " +verseOne = \lyricmode { + \set stanza = #"1." Fair is the sun - shine, Fair - er the moon - light And all the stars __ _ in heav'n a -- bove; } -verseTwo = \lyricmode{ - \set stanza = "2. " +verseTwo = \lyricmode { + \set stanza = #"2." Fair are the mead - ows, Fair - er the wood - land, Robed in the flow -- ers of bloom -- ing spring; @@ -45,7 +46,7 @@ Soprano = { \key f \major \stemUp f'2 f'4 f' | g'4 e' f'2 | a'4. a'8 a'4 a' | bes'4 g' a'2 | -c''2 f''4 d'' | c''2 bes'4 a' | bes'2 a' | g'1 | + c''2 f''4 d'' | c''2 bes'4 a' | bes'2 a' | g'1 | } Alto = { @@ -79,8 +80,8 @@ Bass = { >> } } - \context Lyrics="LyrOne" \lyricsto "sop" {\verseOne} - \context Lyrics="LyrTwo" \lyricsto "sop" {\verseTwo} + \context Lyrics = "LyrOne" \lyricsto "sop" { \verseOne } + \context Lyrics = "LyrTwo" \lyricsto "sop" { \verseTwo } \context Staff = lower { \new Voice { \clef bass @@ -93,16 +94,16 @@ Bass = { } >> -\layout { - %between-system-space = 1\mm - indent = 0 - \context { - \Score - \remove "Bar_number_engraver" - } - \context { \Staff - \override VerticalAxisGroup #'minimum-Y-extent = #'(-1 . 1) - } + \layout { + indent = 0 + \context { + \Score + \remove "Bar_number_engraver" + } + \context { + \Voice + \override StanzaNumber #'padding = #1.8 + } } } \paper { } diff --git a/Documentation/snippets/new/compound-time-signatures.ly b/Documentation/snippets/new/compound-time-signatures.ly index ec75ff2b76..25952ca158 100644 --- a/Documentation/snippets/new/compound-time-signatures.ly +++ b/Documentation/snippets/new/compound-time-signatures.ly @@ -15,12 +15,11 @@ database.) } #(define ((compound-time one two num) grob) - (grob-interpret-markup grob - (markup #:override '(baseline-skip . 0) #:number - (#:line ( - (#:column (one num)) - #:vcenter "+" - (#:column (two num))))))) + (grob-interpret-markup grob + (markup #:override '(baseline-skip . 0) #:number + (#:line ((#:column (one num)) + #:vcenter "+" + (#:column (two num))))))) \relative c' { \override Staff.TimeSignature #'stencil = #(compound-time "2" "3" "8") diff --git a/Documentation/snippets/new/displaying-grob-ancestry.ly b/Documentation/snippets/new/displaying-grob-ancestry.ly new file mode 100644 index 0000000000..343d5bb2c1 --- /dev/null +++ b/Documentation/snippets/new/displaying-grob-ancestry.ly @@ -0,0 +1,132 @@ +\version "2.13.10" + +\header { + lsrtags = "tweaks-and-overrides" + + texidoc = " +When working with grob callbacks, it can be helpful to understand a +grob's @qq{ancestry}. Most grobs have @qq{parents} which influence the +positioning of the grob. X- and Y-parents influence the horizontal and +vertical positions for the grob, respectively. Additionally, each +parent may have parents of its own. + + +Unfortunately, there are several aspects of a grob's ancestry that can +lead to confusion: + + +@itemize + +@item +The types of parents a grob has may depend on context. + +@item +For some grobs, the X- and Y-parents are the same. + +@item +A particular @qq{ancestor} may be related to a grob in multiple ways. + +@item +The concept of @qq{generations} is misleading. + +@end itemize + + +For example, the @code{System} grob can be both parent (on the Y-side) +and grandparent (twice on the X-side) to a @code{VerticalAlignment} +grob. + + +This macro prints (to the console) a textual representation of a grob's +ancestry. + + +When called this way + +@example +@{ + \\once \\override NoteHead #'before-line-breaking = #display-ancestry + c4 +@} +@end example + + +The following output is generated: + + +@example +------------------------------------ + +NoteHead X,Y: NoteColumn + X: PaperColumn + X,Y: System + Y: VerticalAxisGroup + X: NonMusicalPaperColumn + X,Y: System + Y: VerticalAlignment + X: NonMusicalPaperColumn + X,Y: System + Y: System +@end example + + +" + doctitle = "Displaying grob ancestry" +} + +#(define (grob-name grob) + (if (ly:grob? grob) + (assoc-ref (ly:grob-property grob 'meta) 'name) + #f)) + +#(define (get-ancestry grob) + (if (not (null? (ly:grob-parent grob X))) + (list (grob-name grob) + (get-ancestry (ly:grob-parent grob X)) + (get-ancestry (ly:grob-parent grob Y))) + (grob-name grob))) + +#(define (format-ancestry lst padding) + (string-append + (symbol->string (car lst)) + "\n" + (let ((X-ancestry + (if (list? (cadr lst)) + (format-ancestry (cadr lst) (+ padding 3)) + (symbol->string (cadr lst)))) + (Y-ancestry + (if (list? (caddr lst)) + (format-ancestry (caddr lst) (+ padding 3)) + (symbol->string (caddr lst))))) + (if (equal? X-ancestry Y-ancestry) + (string-append + (format #f "~&") + (make-string padding #\space) + "X,Y: " + (if (list? (cadr lst)) + (format-ancestry (cadr lst) (+ padding 5)) + (symbol->string (cadr lst)))) + (string-append + (format #f "~&") + (make-string padding #\space) + "X: " X-ancestry + "\n" + (make-string padding #\space) + "Y: " Y-ancestry + (format #f "~&")))) + (format #f "~&"))) + +#(define (display-ancestry grob) + (display + (string-append + (format #f "~3&~a~2%" (make-string 36 #\-)) + (format-ancestry (get-ancestry grob) 0) + (format #f "~2&")))) + +\relative c' { + \once \override NoteHead #'before-line-breaking = #display-ancestry + f4 + \once \override Accidental #'before-line-breaking = #display-ancestry + \once \override Arpeggio #'before-line-breaking = #display-ancestry + 4\arpeggio +} diff --git a/Documentation/snippets/new/dynamics-custom-text-spanner-postfix.ly b/Documentation/snippets/new/dynamics-custom-text-spanner-postfix.ly index 1afa020950..b698c498b3 100644 --- a/Documentation/snippets/new/dynamics-custom-text-spanner-postfix.ly +++ b/Documentation/snippets/new/dynamics-custom-text-spanner-postfix.ly @@ -1,4 +1,4 @@ -\version "2.13.4" +\version "2.13.8" \header { lsrtags = "expressive-marks, tweaks-and-overrides" @@ -11,12 +11,18 @@ otherwise the spanner start will rather be assigned to the next note. % Two functions for (de)crescendo spanners where you can explicitly give the % spanner text. -mycresc = #(define-music-function (parser location mymarkup) (string?) - (make-music 'CrescendoEvent 'span-direction START - 'span-type 'text 'span-text mymarkup)) -mydecresc = #(define-music-function (parser location mymarkup) (string?) - (make-music 'DecrescendoEvent 'span-direction START - 'span-type 'text 'span-text mymarkup)) +mycresc = +#(define-music-function (parser location mymarkup) (markup?) + (make-music 'CrescendoEvent + 'span-direction START + 'span-type 'text + 'span-text mymarkup)) +mydecresc = +#(define-music-function (parser location mymarkup) (markup?) + (make-music 'DecrescendoEvent + 'span-direction START + 'span-type 'text + 'span-text mymarkup)) \relative c' { c4-\mycresc "custom cresc" c4 c4 c4 | diff --git a/Documentation/snippets/new/dynamics-text-spanner-postfix.ly b/Documentation/snippets/new/dynamics-text-spanner-postfix.ly index 8f6a852833..2641209779 100644 --- a/Documentation/snippets/new/dynamics-text-spanner-postfix.ly +++ b/Documentation/snippets/new/dynamics-text-spanner-postfix.ly @@ -11,15 +11,27 @@ hairpins by default, \cresc etc. produce text spanners by default. } % Some sample text dynamic spanners, to be used as postfix operators -crpoco = #(make-music 'CrescendoEvent 'span-direction START - 'span-type 'text 'span-text "cresc. poco a poco") +crpoco = +#(make-music 'CrescendoEvent + 'span-direction START + 'span-type 'text + 'span-text "cresc. poco a poco") % Redefine the existing \cresc, \dim and \decresc commands to use postfix syntax -cresc = #(make-music 'CrescendoEvent 'span-direction START - 'span-type 'text 'span-text "cresc.") -dim = #(make-music 'DecrescendoEvent 'span-direction START - 'span-type 'text 'span-text "dim.") -decresc = #(make-music 'DecrescendoEvent 'span-direction START - 'span-type 'text 'span-text "decresc.") +cresc = +#(make-music 'CrescendoEvent + 'span-direction START + 'span-type 'text + 'span-text "cresc.") +dim = +#(make-music 'DecrescendoEvent + 'span-direction START + 'span-type 'text + 'span-text "dim.") +decresc = +#(make-music 'DecrescendoEvent + 'span-direction START + 'span-type 'text + 'span-text "decresc.") \relative c' { c4\cresc d4 e4 f4 | diff --git a/Documentation/snippets/new/editorial-headword.ly b/Documentation/snippets/new/editorial-headword.ly index e884268ef7..011f94badc 100644 --- a/Documentation/snippets/new/editorial-headword.ly +++ b/Documentation/snippets/new/editorial-headword.ly @@ -1,10 +1,10 @@ \version "2.12.0" \include "english.ly" #(set-global-staff-size 15) -\paper{ - ragged-right=##t - line-width=17\cm - indent=0\cm +\paper { + ragged-right = ##t + line-width = 17\cm + indent = 0\cm } @@ -15,7 +15,8 @@ } \layout { - \context { \Score + \context { + \Score \override PaperColumn #'keep-inside-line = ##t \override NonMusicalPaperColumn #'keep-inside-line = ##t } @@ -27,82 +28,80 @@ % Piano sonata 18, Movt II, Scherzo % Measures 9 - 14 -\layout { } - \new PianoStaff << - % RH Staff - \new Staff { - \clef treble - \key af \major - \time 2/4 - \set Staff.fingeringOrientations = #'(up up) - \set Score.currentBarNumber = #9 - \partial 8 - 8 \staccato - | - \set doubleSlurs = ##t - 4 ( - 8 \staccato ) - \noBeam - c''8-5 \staccato \pp - | - \set doubleSlurs = ##f - bf'8.. ( - af'32 - g'8 ) \staccato - f'8 \staccato - | - e'4-2 - r8 - \once \override Script #'script-priority = #-100 - \afterGrace - f'8 ( \trill ^ \markup { \finger "3-2" } - { e'16 [ f'16 ] } - | - g'8..-3 - f'32 - e'8-1 ) \staccato - d'8-2 \staccato - | - c'4 - r4 - } + % RH Staff + \new Staff { + \clef treble + \key af \major + \time 2/4 + \set Staff.fingeringOrientations = #'(up) + \set Score.currentBarNumber = #9 + \partial 8 + 8 \staccato + | + \set doubleSlurs = ##t + 4 ( + 8 \staccato ) + \noBeam + c''8-5 \staccato \pp + | + \set doubleSlurs = ##f + bf'8.. ( + af'32 + g'8 ) \staccato + f'8 \staccato + | + e'4-2 + r8 + \once \override Script #'script-priority = #-100 + \afterGrace + f'8 ( \trill ^ \markup { \finger "3-2" } + { e'16 [ f'16 ] } + | + g'8..-3 + f'32 + e'8-1 ) \staccato + d'8-2 \staccato + | + c'4 + r4 + } - % LH Staff - \new Staff { - \key af \major - \clef treble - \override Fingering #'direction = #down - \set Staff.fingeringOrientations = #'(down down) - \partial 8 - 8 \staccato - \set doubleSlurs = ##t - 4 ( - 8 ) \staccato - \noBeam - \clef bass - c'8-1 \staccato - | - \set doubleSlurs = ##f - bf8.. ( - af32 - g8-1 ) \staccato - f8 \staccato - | - e4 - r8 - \afterGrace - f8 ( \trill _ \markup { \finger "2-1" } - { e16 [ f16 ] } - | - g8..-1 - f32 - e8 ) \staccato - d8 \staccato - | - c4 - r4 - } + % LH Staff + \new Staff { + \key af \major + \clef treble + \override Fingering #'direction = #down + \set Staff.fingeringOrientations = #'(down) + \partial 8 + 8 \staccato + \set doubleSlurs = ##t + 4 ( + 8 ) \staccato + \noBeam + \clef bass + c'8-1 \staccato + | + \set doubleSlurs = ##f + bf8.. ( + af32 + g8-1 ) \staccato + f8 \staccato + | + e4 + r8 + \afterGrace + f8 ( \trill _ \markup { \finger "2-1" } + { e16 [ f16 ] } + | + g8..-1 + f32 + e8 ) \staccato + d8 \staccato + | + c4 + r4 + } >> diff --git a/Documentation/snippets/new/figured-bass-headword.ly b/Documentation/snippets/new/figured-bass-headword.ly index db86c2cac1..78403f7c4f 100644 --- a/Documentation/snippets/new/figured-bass-headword.ly +++ b/Documentation/snippets/new/figured-bass-headword.ly @@ -1,13 +1,14 @@ \version "2.12.0" #(set-global-staff-size 15) -\paper{ - ragged-right=##f - line-width=16\cm - indent=1.5\cm +\paper { + ragged-right = ##f + line-width = 16\cm + indent = 1.5\cm } \layout { - \context { \Score + \context { + \Score \override PaperColumn #'keep-inside-line = ##t \override NonMusicalPaperColumn #'keep-inside-line = ##t } @@ -38,7 +39,6 @@ extendOff = \bassFigureExtendersOff \new Staff = "violinoI" { \set Staff.instrumentName = \markup { - \hcenter-in #11 \line { Violino I. } } \time 4/4 @@ -57,7 +57,6 @@ extendOff = \bassFigureExtendersOff \new Staff = "violinoII" { \set Staff.instrumentName = \markup { - \hcenter-in #11 \line { Violino II. } } \time 4/4 @@ -76,11 +75,9 @@ extendOff = \bassFigureExtendersOff \new Staff = "violone" { \set Staff.instrumentName = \markup { - \hcenter-in #13 { - \center-column { - Violone, - \line { e Cembalo. } - } + \center-column { + Violone, + \line { e Cembalo. } } } \time 4/4 diff --git a/Documentation/snippets/new/flamenco-notation.ly b/Documentation/snippets/new/flamenco-notation.ly new file mode 100644 index 0000000000..dc1919ec31 --- /dev/null +++ b/Documentation/snippets/new/flamenco-notation.ly @@ -0,0 +1,250 @@ +\version "2.13.10" + +\header { + lsrtags = "fretted-strings" + + texidoc = " +For flamenco guitar, special notation is used: + + +@itemize + +@item +a golpe symbol to indicate a slap on the guitar body with the nail of +the ring finger + +@item +an arrow to indicate (the direction of) strokes + +@item +different letters for fingering (@qq{p}: thumb, @qq{i}: index finger, +@qq{m}: middle finger, @qq{a}: ring finger and @qq{x}: little finger) + +@item +3- and 4-finger rasgueados: stroke upwards with all fingers, ending +with an up- and down using the index finger + +@item +abanicos: strokes (in tuples) with thumb (down), little and index finger +(both up) (there is also an abanico 2 where middle and ring finger are +used instead of the little finger) + +@item +alza pua: fast playing with the thumb + +@end itemize + + +Most figures use arrows in combination with fingering; with abanicos +and rasgueados, noteheads are printed only for the first chord. + +This snippet contains some header-like code that can be copied as +@samp{flamenco.ly} and included in source files. + +" + doctitle = "Flamenco notation" +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%% Cut here ----- Start 'flamenco.ly' + +% Text indicators +abanico = \markup { \italic Abanico } +rasgueaso = \markup { \italic Ras. } +alzapua = \markup { \italic Alzapua } + +% Finger stroke symbols +strokeUp = \markup { \postscript #" + 0.1 setlinewidth + 0.5 0 moveto + 0.5 2 lineto + 0.2 1.4 lineto + 0.5 2 moveto + 0.8 1.4 lineto + stroke +"} + +strokeDown = \markup { \postscript #" + 0.1 setlinewidth + 0.5 2 moveto + 0.5 0 lineto + 0.2 0.6 lineto + 0.5 0 moveto + 0.8 0.6 lineto + stroke +"} + +% Golpe symbol +golpe = \markup { \postscript #" + 0.2 setlinewidth + 0 0 moveto + 1 0 lineto + 1 1 lineto + stroke + "\postscript #" + 0.1 setlinewidth + -0.6 -0.1 moveto + -0.6 1.0 lineto + 0.5 1.0 lineto + stroke +"} + +strokeUpGolpe = \markup { \column { \golpe \line { \strokeUp } } } +iUpGolpe = \markup { \column { \golpe \line { \small i } \line { \strokeUp } } } + +% Strokes for all fingers +pUp = \markup { \column { \small p \line { \strokeUp } } } +pDown = \markup { \column { \small p \line { \strokeDown } } } +iUp = \markup { \column { \small i \line { \strokeUp } } } +iDown = \markup { \column { \small i \line { \strokeDown } } } +mUp = \markup { \column { \small m \line { \strokeUp } } } +mDown = \markup { \column { \small m \line { \strokeDown } } } +aUp = \markup { \column { \small a \line { \strokeUp } } } +aDown = \markup { \column { \small a \line { \strokeDown } } } +xUp = \markup { \column { \small x \line { \strokeUp } } } +xDown = \markup { \column { \small x \line { \strokeDown } } } + + +% Just handy :) +tupletOff = { + \once \override TupletNumber #'stencil = ##f + \once \override TupletBracket #'stencil = ##f +} + +tupletsOff = { + \override TupletNumber #'stencil = ##f + \override TupletBracket #'bracket-visibility = #'if-no-beam +} + +tupletsOn = { + \override TupletBracket #'bracket-visibility = #'default + \revert TupletNumber #'stencil +} + +headsOff = { + \override TabNoteHead #'transparent = ##t + \override NoteHead #'transparent = ##t + \override NoteHead #'no-ledgers = ##t +} + +headsOn = { + \override TabNoteHead #'transparent = ##f + \override NoteHead #'transparent = ##f + \override NoteHead #'no-ledgers = ##f +} + +%%%%%%% Cut here ----- End 'flamenco.ly' +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +part = \relative c' { + 8^\iUp + 8^\iDown + r4 + r2^\golpe + + 8^\iUp + 8^\iDown + 8^\iUpGolpe + 8^\iDown + r2 + + 16^\aUp + \headsOff + ^\mUp + ^\iUp + ^\iDown~ + \headsOn + 2 + r4 + + \tupletOff + \times 4/5 { + 16^\xUp + \headsOff + ^\aUp + ^\mUp + ^\iUp + ^\iDown~ + \headsOn + } + 2 + r4 + + \tupletsOff + \times 2/3 { + 8^\pDown + \headsOff + ^\xUp + ^\iUp + \headsOn + } + + \times 2/3 { + 8^\pDown + \headsOff + ^\xUp + ^\iUp + \headsOn + } + + \times 2/3 { + 8^\pDown + \headsOff + ^\xUp + ^\iUp + \headsOn + } + \times 2/3 { + 8^\pDown + \headsOff + ^\xUp + ^\iUp + \headsOn + } + + \tupletsOff + \override Beam #'positions = #'(2 . 2) + \times 2/3 { + a8^\markup{ \small p } + ^\strokeUpGolpe + ^\strokeDown + } + \times 2/3 { + a,8^\markup{ \small p } + ^\strokeUpGolpe + ^\strokeDown + } + \times 2/3 { + a,8^\markup{ \small p } + ^\strokeUpGolpe + ^\strokeDown + } + \times 2/3 { + a,8^\markup{ \small p } + ^\strokeUpGolpe + ^\strokeDown + } + \tupletsOn + + \once \override TextScript #'extra-offset = #'(0 . -1) + 1_\golpe^\mUp + \bar "|." +} + +\score { + \new StaffGroup << + \context Staff = "part" << + \clef G + \transpose c c' + { + \part + } + >> + \context TabStaff { + \part + } + >> + \layout { + ragged-right = ##t + } +} diff --git a/Documentation/snippets/new/grouping-beats.ly b/Documentation/snippets/new/grouping-beats.ly index 0f0939928a..e67203c95e 100644 --- a/Documentation/snippets/new/grouping-beats.ly +++ b/Documentation/snippets/new/grouping-beats.ly @@ -9,12 +9,7 @@ Beaming patterns may be altered with the @code{beatGrouping} property: doctitle = "Grouping beats" } -\relative c'' { - \time 5/16 - \overrideBeamSettings #'Score #'(5 . 16) #'end - #'((* . (2 3))) - c8^"(2+3)" c16 c8 - \overrideBeamSettings #'Score #'(5 . 16) #'end - #'((* . (3 2))) - c8^"(3+2)" c16 c8 +\markup { + This snippet is deprecated as of version 2.13.5 and will be removed + in version 2.14. } diff --git a/Documentation/snippets/new/keyboard-headword.ly b/Documentation/snippets/new/keyboard-headword.ly index 57d59a74c4..3755bf757a 100644 --- a/Documentation/snippets/new/keyboard-headword.ly +++ b/Documentation/snippets/new/keyboard-headword.ly @@ -85,7 +85,7 @@ fermataLong = \markup { \clef bass 4 ( ^ \markup \bold { Rall. } \override Script #'stencil = #(lambda (grob) - ly:script::print (grob-interpret-markup grob fermataLong)) + (grob-interpret-markup grob fermataLong)) 8 ) \fermata \noBeam \clef treble diff --git a/Documentation/snippets/new/letter-tablature-formatting.ly b/Documentation/snippets/new/letter-tablature-formatting.ly new file mode 100644 index 0000000000..ca175361eb --- /dev/null +++ b/Documentation/snippets/new/letter-tablature-formatting.ly @@ -0,0 +1,30 @@ +\version "2.13.10" + +\header { + lsrtags = "staff-notation, fretted-strings" + + texidoc = " +Tablature can be formatted using letters instead of numbers. + +" + doctitle = "Letter tablature formatting" +} + +music = \relative c { + c4 d e f + g4 a b c + d4 e f g +} + +<< + \new Staff { + \clef "G_8" + \music + } + \new TabStaff \with { + tablatureFormat = #fret-letter-tablature-format + } + { + \music + } +>> diff --git a/Documentation/snippets/new/making-slurs-with-complex-dash-structure.ly b/Documentation/snippets/new/making-slurs-with-complex-dash-structure.ly index e2d1b8cff7..eb0031c9db 100644 --- a/Documentation/snippets/new/making-slurs-with-complex-dash-structure.ly +++ b/Documentation/snippets/new/making-slurs-with-complex-dash-structure.ly @@ -27,10 +27,10 @@ set to 1 for a solid slur. Slur #'dash-definition = #'((0 0.3 0.1 0.75) (0.3 0.6 1 1) (0.65 1.0 0.4 0.75)) - c( d e f) + c4( d e f) \once \override Slur #'dash-definition = #'((0 0.25 1 1) (0.3 0.7 0.4 0.75) (0.75 1.0 1 1)) - c( d e f) + c4( d e f) } diff --git a/Documentation/snippets/new/numbers-as-easy-note-heads.ly b/Documentation/snippets/new/numbers-as-easy-note-heads.ly index 16b6002d33..fc9a73c9c5 100644 --- a/Documentation/snippets/new/numbers-as-easy-note-heads.ly +++ b/Documentation/snippets/new/numbers-as-easy-note-heads.ly @@ -14,20 +14,22 @@ object it sees. doctitle = "Numbers as easy note heads" } -#(define Ez_numbers_engraver (list - (cons 'acknowledgers +#(define Ez_numbers_engraver (list - (cons 'note-head-interface - (lambda (engraver grob source-engraver) - (let* ( - (context (ly:translator-context engraver)) - (tonic-pitch (ly:context-property context 'tonic)) - (tonic-name (ly:pitch-notename tonic-pitch)) - (grob-pitch (ly:event-property (event-cause grob) 'pitch)) - (grob-name (ly:pitch-notename grob-pitch)) - (delta (modulo (- grob-name tonic-name) 7)) - (note-names (make-vector 7 (number->string (+ 1 delta))))) - (ly:grob-set-property! grob 'note-names note-names)))))))) + (cons 'acknowledgers + (list + (cons 'note-head-interface + (lambda (engraver grob source-engraver) + (let* ((context (ly:translator-context engraver)) + (tonic-pitch (ly:context-property context 'tonic)) + (tonic-name (ly:pitch-notename tonic-pitch)) + (grob-pitch + (ly:event-property (event-cause grob) 'pitch)) + (grob-name (ly:pitch-notename grob-pitch)) + (delta (modulo (- grob-name tonic-name) 7)) + (note-names + (make-vector 7 (number->string (1+ delta))))) + (ly:grob-set-property! grob 'note-names note-names)))))))) #(set-global-staff-size 26) diff --git a/Documentation/snippets/new/piano-template-with-centered-dynamics.ly b/Documentation/snippets/new/piano-template-with-centered-dynamics.ly index a8fed546fb..dcfa46dffc 100644 --- a/Documentation/snippets/new/piano-template-with-centered-dynamics.ly +++ b/Documentation/snippets/new/piano-template-with-centered-dynamics.ly @@ -4,8 +4,8 @@ lsrtags = "expressive-marks, keyboards, template" texidoc = " Many piano scores have the dynamics centered between the two staves. -This requires a bit of tweaking to implement, but since the template is -right here, you don't have to do the tweaking yourself. +The @code{Dynamics} context, if placed between staves, will +automatically position dynamics correctly. " doctitle = "Piano template with centered dynamics" diff --git a/Documentation/snippets/new/pitches-headword.ly b/Documentation/snippets/new/pitches-headword.ly index 0af775ec6e..f2d9f0dbdc 100644 --- a/Documentation/snippets/new/pitches-headword.ly +++ b/Documentation/snippets/new/pitches-headword.ly @@ -1,14 +1,15 @@ \version "2.12.0" \include "english.ly" #(set-global-staff-size 15) -\paper{ - ragged-right=##t - line-width=17\cm - indent=0\cm +\paper { + ragged-right = ##t + line-width = 17\cm + indent = 0\cm } \layout { - \context { \Score + \context { + \Score \override PaperColumn #'keep-inside-line = ##t \override NonMusicalPaperColumn #'keep-inside-line = ##t } @@ -29,122 +30,122 @@ \new PianoStaff << - % RH Staff - \new Staff << + % RH Staff + \new Staff << - % RH Voice 1 - \new Voice { - \set Score.currentBarNumber = #34 - \voiceOne - gs''2 ( ^ \markup \italic { dolce e molto ligato } - fs''4 - e''4 - | - ds''2 - cs''2 ) - | - ds''2 ( - e''4 - fs''4 - | - 2 - 2 ) - | - \oneVoice - \clef bass - 2 ( - 4 - 4 - | - 2 - 2 ) - | - \voiceOne - b2 %( - cs'4 - ds'4 - | - \clef treble - 4 %) - r4 r2 - } - - % RH Voice 2 - \new Voice { - \voiceTwo - \override Staff.DynamicLineSpanner #'staff-padding = #2.5 - 2 \p - 4 - 4 - | - 2 - e'2 - | - \once \override TextScript #'staff-padding = #2.5 - 2 _ \markup \italic { cresc. } - b'4 - 4 - | - b'2. ( \sf \> - a'4 ) - \clef bass - | \break - s1 \p - | - s1 - | - 4 ( - 2. ) - | - s4 - r4 r2 - } - - >> - - % LH Staff - \new Staff { - \override Staff.SustainPedalLineSpanner #'staff-padding = #5 - 2 ( \sustainOn - 4 \sustainOff - 4 + % RH Voice 1 + \new Voice { + \set Score.currentBarNumber = #34 + \voiceOne + gs''2 ( ^ \markup \italic { dolce e molto ligato } + fs''4 + e''4 + | + ds''2 + cs''2 ) + | + ds''2 ( + e''4 + fs''4 | - 2 - 2 ) \sustainOn + 2 + 2 ) | + \oneVoice \clef bass - \slurDown - 2 ( \sustainOff - 4 - 4 \sustainOn + 2 ( + 4 + 4 + | + 2 + 2 ) | - \clef treble \voiceOne - << - { - 2 - 2 ) - } - \new Voice { - \voiceTwo - b1 \sustainOff - } - >> - \oneVoice + b2 %( + cs'4 + ds'4 + | + \clef treble + 4 %) + r4 r2 + } + + % RH Voice 2 + \new Voice { + \voiceTwo + \override Staff.DynamicLineSpanner #'staff-padding = #2.5 + 2 \p + 4 + 4 + | + 2 + e'2 + | + \once \override TextScript #'staff-padding = #2.5 + 2 _ \markup \italic { cresc. } + b'4 + 4 | - %\break + b'2. ( \sf \> + a'4 ) \clef bass - 2 ( - 4 - 4 + | \break + s1 \p | - 2 - 2 ) \sustainOn + s1 | - 1 ( \sustainOff + 4 ( + 2. ) | - 4 ) + s4 r4 r2 - } + } + + >> + + % LH Staff + \new Staff { + \override Staff.SustainPedalLineSpanner #'staff-padding = #5 + 2 ( \sustainOn + 4 \sustainOff + 4 + | + 2 + 2 ) \sustainOn + | + \clef bass + \slurDown + 2 ( \sustainOff + 4 + 4 \sustainOn + | + \clef treble + \voiceOne + << + { + 2 + 2 ) + } + \new Voice { + \voiceTwo + b1 \sustainOff + } + >> + \oneVoice + | + %\break + \clef bass + 2 ( + 4 + 4 + | + 2 + 2 ) \sustainOn + | + 1 ( \sustainOff + | + 4 ) + r4 r2 + } >> diff --git a/Documentation/snippets/new/screech-boink.ly b/Documentation/snippets/new/screech-boink.ly index a4a4ef2000..5a24f1ff03 100644 --- a/Documentation/snippets/new/screech-boink.ly +++ b/Documentation/snippets/new/screech-boink.ly @@ -5,70 +5,69 @@ doctitle = "Screech and Boink" } - \score { - \context PianoStaff << - \new Staff = "up" { - \time 4/8 - \key c \minor - - - << { - \revert Stem #'direction - \change Staff = down - \set subdivideBeams = ##t - g16.[ - \change Staff = up - c'''32 \change Staff = down - g32 \change Staff = up - c'''32 \change Staff = down - g16] - \change Staff = up - \stemUp - \set followVoice = ##t - c'''32([ b''16 a''16 gis''16 g''32)] } \\ - { s4 \times 2/3 { d'16[ f' g'] } as'32[ b''32 e'' d''] } \\ - { s4 \autoBeamOff d''8.. f''32 } \\ - { s4 es''4 } - >> - } - - \new Staff = "down" { - \clef bass - \key c \minor - \set subdivideBeams = ##f - \override Stem #'french-beaming = ##t - \override Beam #'thickness = #0.3 - \override Stem #'thickness = #4.0 - g'16[ b16 fis16 g16] - << \makeClusters { - as16 - - - } \\ - { - \override Staff.Arpeggio #'arpeggio-direction =#down - 4\arpeggio } - >> - } - >> - + \context PianoStaff << + \new Staff = "up" { + \time 4/8 + \key c \minor + << + { + \revert Stem #'direction + \change Staff = down + \set subdivideBeams = ##t + g16.[ + \change Staff = up + c'''32 + \change Staff = down + g32 + \change Staff = up + c'''32 + \change Staff = down + g16] + \change Staff = up + \stemUp + \set followVoice = ##t + c'''32([ b''16 a''16 gis''16 g''32)] + } + \\ + { s4 \times 2/3 { d'16[ f' g'] } as'32[ b''32 e'' d''] } + \\ + { s4 \autoBeamOff d''8.. f''32 } + \\ + { s4 es''4 } + >> + } + \new Staff = "down" { + \clef bass + \key c \minor + \set subdivideBeams = ##f + \override Stem #'french-beaming = ##t + \override Beam #'thickness = #0.3 + \override Stem #'thickness = #4.0 + g'16[ b16 fis16 g16] + << + \makeClusters { + as16 + } + \\ + { + \override Staff.Arpeggio #'arpeggio-direction = #DOWN + 4\arpeggio + } + >> + } + >> \midi { \context { \Score tempoWholesPerMinute = #(ly:make-moment 60 8) - } } - - - - \layout { - ragged-right = ##t - - \context { - \Staff - \consists Horizontal_bracket_engraver - } - + } + \layout { + ragged-right = ##t + \context { + \Staff + \consists "Horizontal_bracket_engraver" } + } } diff --git a/Documentation/snippets/new/simultaneous-headword.ly b/Documentation/snippets/new/simultaneous-headword.ly index 71574f738f..201abbd928 100644 --- a/Documentation/snippets/new/simultaneous-headword.ly +++ b/Documentation/snippets/new/simultaneous-headword.ly @@ -1,14 +1,15 @@ \version "2.12.0" \include "english.ly" #(set-global-staff-size 15) -\paper{ - ragged-right=##t - line-width=17\cm - indent=0\cm +\paper { + ragged-right = ##t + line-width = 17\cm + indent = 0\cm } \layout { - \context { \Score + \context { + \Score \override PaperColumn #'keep-inside-line = ##t \override NonMusicalPaperColumn #'keep-inside-line = ##t } @@ -29,292 +30,290 @@ % measures 108 - 118 \layout { - \context { - \Score - \override SpacingSpanner #'base-shortest-duration = - #(ly:make-moment 1 18) - \override NonMusicalPaperColumn #'line-break-system-details = - #'((alignment-offsets . (0 -12))) - } + \context { + \Score + \override SpacingSpanner #'base-shortest-duration = + #(ly:make-moment 1 18) + \override NonMusicalPaperColumn #'line-break-system-details = + #'((alignment-distances . (12))) + } } trillflat = - \once \override TrillSpanner #'(bound-details left text) = - #(markup #:translate-scaled '(-0.05 . -1) - #:concat (#:musicglyph "scripts.trill" - #:translate '(-0.5 . 1.9) #:fontsize -7 #:flat)) +\once \override TrillSpanner #'(bound-details left text) = +#(markup #:translate-scaled '(-0.05 . -1) + #:concat (#:musicglyph "scripts.trill" + #:translate '(-0.5 . 1.9) #:fontsize -7 #:flat)) \new PianoStaff << - % RH - \new Staff << - \clef treble - \key c \major - \time 9/16 - \set Score.currentBarNumber = #108 + % RH + \new Staff << + \clef treble + \key c \major + \time 9/16 + \set Score.currentBarNumber = #108 - % RH voice 1 - \new Voice { + % RH voice 1 + \new Voice { - \voiceOne - s4. - s8. + \voiceOne + s4. + s8. - | + | - s4. - a''8 \p \> [ ( - g''16 ] ) + s4. + a''8 \p \> [ ( + g''16 ] ) - | + | - g''4. - af''8 [ ( - g''16 ] ) + g''4. + af''8 [ ( + g''16 ] ) - | + | - g''8. [ - g''8. - g''8. \pp ] + g''8. [ + g''8. + g''8. \pp ] - | + | - g''8. [ - af''8. - af''8. ] + g''8. [ + af''8. + af''8. ] - | + | - af''8. [ - af''8. - af''8. ] + af''8. [ + af''8. + af''8. ] - | - \break + | + \break - \trillflat - af''4. \startTrillSpan - ~ - af''8. - ~ + \trillflat + af''4. \startTrillSpan + ~ + af''8. + ~ - | + | - af''4. - ~ - af''8. - ~ + af''4. + ~ + af''8. + ~ - | + | - \oneVoice - 8. [ - a''8. \p \< - bf''8. ] - ~ + \oneVoice + 8. [ + a''8. \p \< + bf''8. ] + ~ - | + | - bf''8. [ - b''8. - c'''8. ] - ~ + bf''8. [ + b''8. + c'''8. ] + ~ - \bar "||" + \bar "||" - \key ef \major - c'''8. [ - cs'''8. \f ] \stopTrillSpan - r8. + \key ef \major + c'''8. [ + cs'''8. \f ] \stopTrillSpan + r8. - } + } - % RH voice 2 - \new Voice { - \voiceTwo - \override Voice.TrillSpanner #'direction = #down - d''4. \f \startTrillSpan - ~ - d''8. - ~ + % RH voice 2 + \new Voice { + \voiceTwo + \override Voice.TrillSpanner #'direction = #DOWN + d''4. \f \startTrillSpan + ~ + d''8. + ~ - | + | - d''4. - ~ - d''8. - ~ + d''4. + ~ + d''8. + ~ - | + | - d''8. \stopTrillSpan - \trillflat - d''4. \startTrillSpan - ~ + d''8. \stopTrillSpan + \trillflat + d''4. \startTrillSpan + ~ - | + | - d''4. - ~ - d''8. - ~ + d''4. + ~ + d''8. + ~ - | + | - d''4. - ~ - d''8. - ~ + d''4. + ~ + d''8. + ~ - | + | - d''4. - ~ - d''8. \stopTrillSpan - ~ + d''4. + ~ + d''8. \stopTrillSpan + ~ - | + | - \trillflat - d''4. \startTrillSpan - ~ - d''8. - ~ + \trillflat + d''4. \startTrillSpan + ~ + d''8. + ~ - | + | - d''4. - ~ - d''8. - ~ + d''4. + ~ + d''8. + ~ - | + | - \once \override NoteColumn #'ignore-collision = ##t - \once \override NoteHead #'transparent = ##t - \once \override Dots #'transparent = ##t - \once \override Stem #'transparent = ##t - d''8. \stopTrillSpan - s4. + \once \override NoteColumn #'ignore-collision = ##t + \hideNotes + d''8. \stopTrillSpan + s4. - | + | - s8. - s8. + s8. + s8. - } + } - >> + >> - % LH staff - \new Staff { - \clef bass - \key c \major - \time 9/16 + % LH staff + \new Staff { + \clef bass + \key c \major + \time 9/16 - r8. - r8. - 8 [ ( - 16 ] ) + r8. + r8. + 8 [ ( + 16 ] ) - | + | - 4. - \clef treble - c''8 [ ( - b'16 ] ) + 4. + \clef treble + c''8 [ ( + b'16 ] ) - | + | - b'4. - c''8 [ ( - b'16 ] ) + b'4. + c''8 [ ( + b'16 ] ) - | + | - b'8. [ - b'8. - b'8. ] + b'8. [ + b'8. + b'8. ] - | + | - b'8. [ - bf'8. ] - \clef bass - 8 [ ( - 16 ] ) + b'8. [ + bf'8. ] + \clef bass + 8 [ ( + 16 ] ) - | + | - 4. - \clef treble - f'8 [ ( - bf16 ] ) + 4. + \clef treble + f'8 [ ( + bf16 ] ) - | + | - << + << - \new Voice { - \voiceOne - \override Voice.TrillSpanner #'direction = #up - f'4. \startTrillSpan - ~ - f'8. - ~ + \new Voice { + \voiceOne + \override Voice.TrillSpanner #'direction = #UP + f'4. \startTrillSpan + ~ + f'8. + ~ - | + | - f'4. - ~ - f'8. - ~ + f'4. + ~ + f'8. + ~ - | + | - f'8. \stopTrillSpan - } + f'8. \stopTrillSpan + } - \new Voice { - \voiceTwo - \override Voice.TrillSpanner #'direction = #down - bf8. [ - bf8. - bf8. ] + \new Voice { + \voiceTwo + \override Voice.TrillSpanner #'direction = #DOWN + bf8. [ + bf8. + bf8. ] - | + | - bf8. [ - bf8. - bf8. ] + bf8. [ + bf8. + bf8. ] - | + | - bf8. - } + bf8. + } - >> + >> - \oneVoice - r8. - r8. + \oneVoice + r8. + r8. - | + | - r8. - r8. - r8. - \clef bass + r8. + r8. + r8. + \clef bass - | + | - \key ef \major - r8. - r8. - r8. + \key ef \major + r8. + r8. + r8. - } + } >> diff --git a/Documentation/snippets/new/text-headword.ly b/Documentation/snippets/new/text-headword.ly index 8a0237f0fd..798cef7c47 100644 --- a/Documentation/snippets/new/text-headword.ly +++ b/Documentation/snippets/new/text-headword.ly @@ -1,7 +1,7 @@ \version "2.12.0" \include "english.ly" #(set-global-staff-size 15) -\paper{ +\paper { line-width = 16\cm indent = 0\cm } @@ -14,7 +14,8 @@ } \layout { - \context { \Score + \context { + \Score \override PaperColumn #'keep-inside-line = ##t \override NonMusicalPaperColumn #'keep-inside-line = ##t } @@ -27,217 +28,215 @@ % measures 1 - 7 \layout { - \context { - \Score - \override SpacingSpanner #'base-shortest-duration = - #(ly:make-moment 1 20) - %\override NonMusicalPaperColumn #'line-break-system-details = - %#'((alignment-offsets . (0 -12))) - } + \context { + \Score + \override SpacingSpanner #'base-shortest-duration = + #(ly:make-moment 1 20) + } } \new PianoStaff << - % RH staff - \new Staff { - \clef treble - \key af \major - \time 3/4 - - \once \override TextScript #'staff-padding = #4 - 4. ( - _ \markup { \dynamic p \italic { con amabilità } } - 8 ) - 8. [ - 16 ] - - | - - 4 - 2 - _ \markup { \italic { ten. } } - - | - - << - - \new Voice { - \voiceOne - ef''4. ( - df''8 [ ) - ef'' ( - f'' ) ] - - | - - \once \override TextScript #'staff-padding = #4 - ef''8. ( - _ \markup { \italic { tranqu. } } - d''16 ) - df''8 \trill \fermata - _ \markup { \italic { ten. } } - } - - \new Voice { - \voiceTwo - af'4. - af'8 [ - af'8 - af'8 ] - - | + % RH staff + \new Staff { + \clef treble + \key af \major + \time 3/4 + + \once \override TextScript #'staff-padding = #4 + 4. ( + _ \markup { \dynamic p \italic { con amabilità } } + 8 ) + 8. [ + 16 ] + + | + + 4 + 2 + _ \markup { \italic { ten. } } + + | + + << + + \new Voice { + \voiceOne + ef''4. ( + df''8 [ ) + ef'' ( + f'' ) ] + + | + + \once \override TextScript #'staff-padding = #4 + ef''8. ( + _ \markup { \italic { tranqu. } } + d''16 ) + df''8 \trill \fermata + _ \markup { \italic { ten. } } + } + + \new Voice { + \voiceTwo + af'4. + af'8 [ + af'8 + af'8 ] + + | + + g'4 + g'8 + } + + >> + + \oneVoice + \once \override TextScript #'staff-padding = #4 + df''32 + _ \markup { \italic dolce } + c''32 + df''32 + ef''32 + \acciaccatura { df''[ ef'' ] } + f''8 + ef''16 + df''16 + + | + \break + \overrideProperty "Score.NonMusicalPaperColumn" + #'line-break-system-details #'((alignment-distances . (12))) + + c''4. ( + ^ \markup \italic { cantabile, con intimissimo sentimento, + ma sempre molto dolce e semplice } + ef''4 + af''8 ) + + | + + af''4 ( + g''2 ) + + | + + bf''4. ( + g''4 + ef''8 ) + + | + } - g'4 - g'8 - } - - >> - - \oneVoice - \once \override TextScript #'staff-padding = #4 - df''32 - _ \markup { \italic dolce } - c''32 - df''32 - ef''32 - \acciaccatura { df''[ ef'' ] } - f''8 - ef''16 - df''16 - - | - \break - \overrideProperty "Score.NonMusicalPaperColumn" - #'line-break-system-details #'((alignment-offsets . (0 -12))) - - c''4. ( - ^ \markup \italic { cantabile, con intimissimo sentimento, - ma sempre molto dolce e semplice } - ef''4 - af''8 ) - - | - - af''4 ( - g''2 ) - - | - - bf''4. ( - g''4 - ef''8 ) - - | - } - - % LH - \new Staff { - \clef bass - \key af \major - \time 3/4 - - 4. ( - 8 ) - 8. [ - 16 ] - - | - - 4 - 2 ^ \markup { \italic ten. } - - | - - << - - \new Voice { - \voiceOne - ef8 [ ( - af8 - c'8 - bf8 ) - c'8 ( \staccato - df'8 ] ) \staccato - - | - - bf4 - bf8 ^ \markup { \italic ten. } - } - - \new Voice { - \voiceTwo - c4. ( - f8 [ ) - ef8 ( \staccato - df8 ] ) \staccato - - | - - ef4 - ef8 \fermata - } - - >> - - \oneVoice - r8 - r4 - \clef treble - - | - - \override Staff.SustainPedalLineSpanner #'outside-staff-priority = #1000 - \override Staff.SustainPedalLineSpanner #'staff-padding = #7 - \once \override TextScript #'padding = #2 - af16 \sustainOn - ^ \markup \italic { non staccato } - _ \markup \italic { molto \concat {\dynamic {p},} sempre tranquillo - ed egualmente, non rubato } - 16 - 16 - 16 - af16 - 16 - 16 - 16 - af16 \sustainOn - 16 - 16 - 16 - - | - - bf16 \sustainOn - 16 - 16 - 16 - bf16 \sustainOn - 16 - 16 - 16 - bf16 - 16 - 16 - 16 - - | - - \override Staff.SustainPedalLineSpanner #'staff-padding = #4 - df'16 \sustainOn - 16 - 16 - 16 - df'16 - 16 - 16 - 16 - df'16 \sustainOn - 16 - 16 - 16 - - | - } + % LH + \new Staff { + \clef bass + \key af \major + \time 3/4 + + 4. ( + 8 ) + 8. [ + 16 ] + + | + + 4 + 2 ^ \markup { \italic ten. } + + | + + << + + \new Voice { + \voiceOne + ef8 [ ( + af8 + c'8 + bf8 ) + c'8 ( \staccato + df'8 ] ) \staccato + + | + + bf4 + bf8 ^ \markup { \italic ten. } + } + + \new Voice { + \voiceTwo + c4. ( + f8 [ ) + ef8 ( \staccato + df8 ] ) \staccato + + | + + ef4 + ef8 \fermata + } + + >> + + \oneVoice + r8 + r4 + \clef treble + + | + + \override Staff.SustainPedalLineSpanner #'outside-staff-priority = #1000 + \override Staff.SustainPedalLineSpanner #'staff-padding = #7 + \once \override TextScript #'padding = #2 + af16 \sustainOn + ^ \markup \italic { non staccato } + _ \markup \italic { molto \concat { \dynamic { p } , } sempre tranquillo + ed egualmente, non rubato } + 16 + 16 + 16 + af16 + 16 + 16 + 16 + af16 \sustainOn + 16 + 16 + 16 + + | + + bf16 \sustainOn + 16 + 16 + 16 + bf16 \sustainOn + 16 + 16 + 16 + bf16 + 16 + 16 + 16 + + | + + \override Staff.SustainPedalLineSpanner #'staff-padding = #4 + df'16 \sustainOn + 16 + 16 + 16 + df'16 + 16 + 16 + 16 + df'16 \sustainOn + 16 + 16 + 16 + + | + } >> diff --git a/Documentation/snippets/new/using-ly-grob-object-to-access-grobs-with--tweak.ly b/Documentation/snippets/new/using-ly-grob-object-to-access-grobs-with--tweak.ly new file mode 100644 index 0000000000..2fcb360272 --- /dev/null +++ b/Documentation/snippets/new/using-ly-grob-object-to-access-grobs-with--tweak.ly @@ -0,0 +1,75 @@ +\version "2.13.10" + +\header { + lsrtags = "tweaks-and-overrides" + + texidoc = " +Some grobs can be accessed @qq{laterally} from within another grob's +callback. These are usually listed as @qq{layout objects} in the +@qq{Internal properties} section of a grob-interface. The function +@code{ly:grob-object} is used to access these grobs. + + +Demonstrated below are some ways of accessing grobs from within a +NoteHead callback, but the technique is not limited to NoteHeads. +However, the NoteHead callback is particularly important, since it is +the implicit callback used by the @code{\\tweak} command. + + +The example function defined below (\"display-grobs\") is probably not +that useful, but it demonstrates that the grobs are indeed being +accessed. + + +Example console output: + + +@example +-------------------- +#-Grob Accidental - +#-Grob Arpeggio - +#-Grob Stem - +@end example + + +" + doctitle = "Using ly:grob-object to access grobs with \\tweak" +} + +#(define (notehead-get-accidental notehead) + ;; notehead is grob + (ly:grob-object notehead 'accidental-grob)) + +#(define (notehead-get-arpeggio notehead) + ;; notehead is grob + (let ((notecolumn (notehead-get-notecolumn notehead))) + (ly:grob-object notecolumn 'arpeggio))) + +#(define (notehead-get-notecolumn notehead) + ;; notehead is grob + (ly:grob-parent notehead X)) + +#(define (notehead-get-stem notehead) + ;; notehead is grob + (let ((notecolumn (notehead-get-notecolumn notehead))) + (ly:grob-object notecolumn 'stem))) + +#(define (display-grobs notehead) + ;; notehead is grob + (let ((accidental (notehead-get-accidental notehead)) + (arpeggio (notehead-get-arpeggio notehead)) + (stem (notehead-get-stem notehead))) + (format #t "~2&~a\n" (make-string 20 #\-)) + (for-each + (lambda (x) (format #t "~a\n" x)) + (list accidental arpeggio stem)))) + +\relative c' { + %% display grobs for each note head: + %\override NoteHead #'before-line-breaking = #display-grobs + 1\arpeggio +} diff --git a/Documentation/snippets/numbers-as-easy-note-heads.ly b/Documentation/snippets/numbers-as-easy-note-heads.ly index 7cd88fa11b..4bdf474d57 100644 --- a/Documentation/snippets/numbers-as-easy-note-heads.ly +++ b/Documentation/snippets/numbers-as-easy-note-heads.ly @@ -19,20 +19,22 @@ object it sees. } % begin verbatim -#(define Ez_numbers_engraver (list - (cons 'acknowledgers +#(define Ez_numbers_engraver (list - (cons 'note-head-interface - (lambda (engraver grob source-engraver) - (let* ( - (context (ly:translator-context engraver)) - (tonic-pitch (ly:context-property context 'tonic)) - (tonic-name (ly:pitch-notename tonic-pitch)) - (grob-pitch (ly:event-property (event-cause grob) 'pitch)) - (grob-name (ly:pitch-notename grob-pitch)) - (delta (modulo (- grob-name tonic-name) 7)) - (note-names (make-vector 7 (number->string (+ 1 delta))))) - (ly:grob-set-property! grob 'note-names note-names)))))))) + (cons 'acknowledgers + (list + (cons 'note-head-interface + (lambda (engraver grob source-engraver) + (let* ((context (ly:translator-context engraver)) + (tonic-pitch (ly:context-property context 'tonic)) + (tonic-name (ly:pitch-notename tonic-pitch)) + (grob-pitch + (ly:event-property (event-cause grob) 'pitch)) + (grob-name (ly:pitch-notename grob-pitch)) + (delta (modulo (- grob-name tonic-name) 7)) + (note-names + (make-vector 7 (number->string (1+ delta))))) + (ly:grob-set-property! grob 'note-names note-names)))))))) #(set-global-staff-size 26) diff --git a/Documentation/snippets/piano-template-with-centered-dynamics.ly b/Documentation/snippets/piano-template-with-centered-dynamics.ly index 829d32c7be..a62a95fb59 100644 --- a/Documentation/snippets/piano-template-with-centered-dynamics.ly +++ b/Documentation/snippets/piano-template-with-centered-dynamics.ly @@ -44,8 +44,8 @@ obtenir un tel résultat. lsrtags = "expressive-marks, keyboards, template" texidoc = " Many piano scores have the dynamics centered between the two staves. -This requires a bit of tweaking to implement, but since the template is -right here, you don't have to do the tweaking yourself. +The @code{Dynamics} context, if placed between staves, will +automatically position dynamics correctly. " doctitle = "Piano template with centered dynamics" diff --git a/Documentation/snippets/pitches-headword.ly b/Documentation/snippets/pitches-headword.ly index 5e7799b4df..253b0b0eee 100644 --- a/Documentation/snippets/pitches-headword.ly +++ b/Documentation/snippets/pitches-headword.ly @@ -5,14 +5,15 @@ \version "2.13.10" \include "english.ly" #(set-global-staff-size 15) -\paper{ - ragged-right=##t - line-width=17\cm - indent=0\cm +\paper { + ragged-right = ##t + line-width = 17\cm + indent = 0\cm } \layout { - \context { \Score + \context { + \Score \override PaperColumn #'keep-inside-line = ##t \override NonMusicalPaperColumn #'keep-inside-line = ##t } @@ -34,122 +35,122 @@ \new PianoStaff << - % RH Staff - \new Staff << + % RH Staff + \new Staff << - % RH Voice 1 - \new Voice { - \set Score.currentBarNumber = #34 - \voiceOne - gs''2 ( ^ \markup \italic { dolce e molto ligato } - fs''4 - e''4 - | - ds''2 - cs''2 ) - | - ds''2 ( - e''4 - fs''4 - | - 2 - 2 ) - | - \oneVoice - \clef bass - 2 ( - 4 - 4 - | - 2 - 2 ) - | - \voiceOne - b2 %( - cs'4 - ds'4 - | - \clef treble - 4 %) - r4 r2 - } - - % RH Voice 2 - \new Voice { - \voiceTwo - \override Staff.DynamicLineSpanner #'staff-padding = #2.5 - 2 \p - 4 - 4 - | - 2 - e'2 - | - \once \override TextScript #'staff-padding = #2.5 - 2 _ \markup \italic { cresc. } - b'4 - 4 - | - b'2. ( \sf \> - a'4 ) - \clef bass - | \break - s1 \p - | - s1 - | - 4 ( - 2. ) - | - s4 - r4 r2 - } - - >> - - % LH Staff - \new Staff { - \override Staff.SustainPedalLineSpanner #'staff-padding = #5 - 2 ( \sustainOn - 4 \sustainOff - 4 + % RH Voice 1 + \new Voice { + \set Score.currentBarNumber = #34 + \voiceOne + gs''2 ( ^ \markup \italic { dolce e molto ligato } + fs''4 + e''4 + | + ds''2 + cs''2 ) + | + ds''2 ( + e''4 + fs''4 | - 2 - 2 ) \sustainOn + 2 + 2 ) | + \oneVoice \clef bass - \slurDown - 2 ( \sustainOff - 4 - 4 \sustainOn + 2 ( + 4 + 4 + | + 2 + 2 ) | - \clef treble \voiceOne - << - { - 2 - 2 ) - } - \new Voice { - \voiceTwo - b1 \sustainOff - } - >> - \oneVoice + b2 %( + cs'4 + ds'4 + | + \clef treble + 4 %) + r4 r2 + } + + % RH Voice 2 + \new Voice { + \voiceTwo + \override Staff.DynamicLineSpanner #'staff-padding = #2.5 + 2 \p + 4 + 4 + | + 2 + e'2 + | + \once \override TextScript #'staff-padding = #2.5 + 2 _ \markup \italic { cresc. } + b'4 + 4 | - %\break + b'2. ( \sf \> + a'4 ) \clef bass - 2 ( - 4 - 4 + | \break + s1 \p | - 2 - 2 ) \sustainOn + s1 | - 1 ( \sustainOff + 4 ( + 2. ) | - 4 ) + s4 r4 r2 - } + } + + >> + + % LH Staff + \new Staff { + \override Staff.SustainPedalLineSpanner #'staff-padding = #5 + 2 ( \sustainOn + 4 \sustainOff + 4 + | + 2 + 2 ) \sustainOn + | + \clef bass + \slurDown + 2 ( \sustainOff + 4 + 4 \sustainOn + | + \clef treble + \voiceOne + << + { + 2 + 2 ) + } + \new Voice { + \voiceTwo + b1 \sustainOff + } + >> + \oneVoice + | + %\break + \clef bass + 2 ( + 4 + 4 + | + 2 + 2 ) \sustainOn + | + 1 ( \sustainOff + | + 4 ) + r4 r2 + } >> diff --git a/Documentation/snippets/printing-a-repeat-sign-at-the-beginning-of-a-piece.ly b/Documentation/snippets/printing-a-repeat-sign-at-the-beginning-of-a-piece.ly index 51e2f79b33..1dc9d5f429 100644 --- a/Documentation/snippets/printing-a-repeat-sign-at-the-beginning-of-a-piece.ly +++ b/Documentation/snippets/printing-a-repeat-sign-at-the-beginning-of-a-piece.ly @@ -41,17 +41,23 @@ overriding the relevant property: \relative c'' { \once \override Score.BreakAlignment #'break-align-orders = - #(make-vector 3 '(instrument-name - left-edge - ambitus - span-bar - breathing-sign - clef - key-signature - time-signature - staff-bar - custos - span-bar)) + #(make-vector 3 '(instrument-name + left-edge + ambitus + span-bar + breathing-sign + clef + key-signature + time-signature + staff-bar + custos + span-bar)) + \once \override Staff.TimeSignature #'space-alist = + #'((first-note . (fixed-space . 2.0)) + (right-edge . (extra-space . 0.5)) + ;; free up some space between time signature + ;; and repeat bar line + (staff-bar . (extra-space . 1))) \bar "|:" c1 d1 diff --git a/Documentation/snippets/printing-bar-numbers-at-regular-intervals.ly b/Documentation/snippets/printing-bar-numbers-at-regular-intervals.ly index 39f7516633..8ff776c818 100644 --- a/Documentation/snippets/printing-bar-numbers-at-regular-intervals.ly +++ b/Documentation/snippets/printing-bar-numbers-at-regular-intervals.ly @@ -50,7 +50,7 @@ measures except at the end of the line. } % begin verbatim \relative c' { - \override Score.BarNumber #'break-visibility = #'#(#f #t #t) + \override Score.BarNumber #'break-visibility = #end-of-line-invisible \set Score.currentBarNumber = #11 % Permit first bar number to be printed \bar "" diff --git a/Documentation/snippets/printing-bar-numbers-inside-boxes-or-circles.ly b/Documentation/snippets/printing-bar-numbers-inside-boxes-or-circles.ly index d08d4a3223..3067f03a9a 100644 --- a/Documentation/snippets/printing-bar-numbers-inside-boxes-or-circles.ly +++ b/Documentation/snippets/printing-bar-numbers-inside-boxes-or-circles.ly @@ -39,7 +39,7 @@ Bar numbers can also be printed inside boxes or circles. \relative c' { % Prevent bar numbers at the end of a line and permit them elsewhere - \override Score.BarNumber #'break-visibility = #end-of-line-invisible + \override Score.BarNumber #'break-visibility = #end-of-line-invisible \set Score.barNumberVisibility = #(every-nth-bar-number-visible 4) % Increase the size of the bar number by 2 diff --git a/Documentation/snippets/printing-hairpins-using-al-niente-notation.ly b/Documentation/snippets/printing-hairpins-using-al-niente-notation.ly index 34ab00d139..d109419b9b 100644 --- a/Documentation/snippets/printing-hairpins-using-al-niente-notation.ly +++ b/Documentation/snippets/printing-hairpins-using-al-niente-notation.ly @@ -35,9 +35,9 @@ propriété @code{circled-tip}, ce qui affiche un cercle à leur extrémité. texidoc = " -Hairpins may be printed with a circled tip (al niente notation) by -setting the @code{circled-tip} property of the @code{Hairpin} object to -@code{#t}. +Hairpin dynamics may be printed with a circled tip (@qq{al niente} +notation) by setting the @code{circled-tip} property of the +@code{Hairpin} object to @code{#t}. " doctitle = "Printing hairpins using al niente notation" diff --git a/Documentation/snippets/printing-the-bar-number-for-the-first-measure.ly b/Documentation/snippets/printing-the-bar-number-for-the-first-measure.ly index 64cc2fd9f0..cd0cda6ef7 100644 --- a/Documentation/snippets/printing-the-bar-number-for-the-first-measure.ly +++ b/Documentation/snippets/printing-the-bar-number-for-the-first-measure.ly @@ -61,6 +61,7 @@ must be inserted before the first note for this to work. \relative c' { \set Score.barNumberVisibility = #all-bar-numbers-visible \bar "" - c1 d e f \break - g1 e d c + c1 | d | e | f \break + g1 | e | d | c } + diff --git a/Documentation/snippets/rest-styles.ly b/Documentation/snippets/rest-styles.ly index 76462057b3..e35ce49293 100644 --- a/Documentation/snippets/rest-styles.ly +++ b/Documentation/snippets/rest-styles.ly @@ -37,7 +37,7 @@ Rests may be used in various styles. } % begin verbatim \layout { - indent = 0.0 + indent = 0 \context { \Staff \remove "Time_signature_engraver" diff --git a/Documentation/snippets/screech-boink.ly b/Documentation/snippets/screech-boink.ly index 7e4dd5a854..db205ee48a 100644 --- a/Documentation/snippets/screech-boink.ly +++ b/Documentation/snippets/screech-boink.ly @@ -10,70 +10,69 @@ } % begin verbatim - \score { - \context PianoStaff << - \new Staff = "up" { - \time 4/8 - \key c \minor - - - << { - \revert Stem #'direction - \change Staff = down - \set subdivideBeams = ##t - g16.[ - \change Staff = up - c'''32 \change Staff = down - g32 \change Staff = up - c'''32 \change Staff = down - g16] - \change Staff = up - \stemUp - \set followVoice = ##t - c'''32([ b''16 a''16 gis''16 g''32)] } \\ - { s4 \times 2/3 { d'16[ f' g'] } as'32[ b''32 e'' d''] } \\ - { s4 \autoBeamOff d''8.. f''32 } \\ - { s4 es''4 } - >> - } - - \new Staff = "down" { - \clef bass - \key c \minor - \set subdivideBeams = ##f - \override Stem #'french-beaming = ##t - \override Beam #'thickness = #0.3 - \override Stem #'thickness = #4.0 - g'16[ b16 fis16 g16] - << \makeClusters { - as16 - - - } \\ - { - \override Staff.Arpeggio #'arpeggio-direction =#down - 4\arpeggio } - >> - } - >> - + \context PianoStaff << + \new Staff = "up" { + \time 4/8 + \key c \minor + << + { + \revert Stem #'direction + \change Staff = down + \set subdivideBeams = ##t + g16.[ + \change Staff = up + c'''32 + \change Staff = down + g32 + \change Staff = up + c'''32 + \change Staff = down + g16] + \change Staff = up + \stemUp + \set followVoice = ##t + c'''32([ b''16 a''16 gis''16 g''32)] + } + \\ + { s4 \times 2/3 { d'16[ f' g'] } as'32[ b''32 e'' d''] } + \\ + { s4 \autoBeamOff d''8.. f''32 } + \\ + { s4 es''4 } + >> + } + \new Staff = "down" { + \clef bass + \key c \minor + \set subdivideBeams = ##f + \override Stem #'french-beaming = ##t + \override Beam #'beam-thickness = #0.3 + \override Stem #'thickness = #4.0 + g'16[ b16 fis16 g16] + << + \makeClusters { + as16 + } + \\ + { + \override Staff.Arpeggio #'arpeggio-direction = #DOWN + 4\arpeggio + } + >> + } + >> \midi { \context { \Score tempoWholesPerMinute = #(ly:make-moment 60 8) - } } - - - - \layout { - ragged-right = ##t - - \context { - \Staff - \consists Horizontal_bracket_engraver - } - + } + \layout { + ragged-right = ##t + \context { + \Staff + \consists "Horizontal_bracket_engraver" } + } } diff --git a/Documentation/snippets/showing-the-same-articulation-above-and-below-a-note-or-chord.ly b/Documentation/snippets/showing-the-same-articulation-above-and-below-a-note-or-chord.ly index 721e117693..6e8be0988b 100644 --- a/Documentation/snippets/showing-the-same-articulation-above-and-below-a-note-or-chord.ly +++ b/Documentation/snippets/showing-the-same-articulation-above-and-below-a-note-or-chord.ly @@ -27,10 +27,11 @@ The direction will always be above, but one can tweak this via a % The same as \flageolet, just a little smaller smallFlageolet = -#(let ((m (make-music 'ArticulationEvent 'articulation-type "flageolet"))) - (ly:music-set-property! m 'tweaks - (acons 'font-size -2 (ly:music-property m 'tweaks))) - m) +#(let ((m (make-articulation "flageolet"))) + (set! (ly:music-property m 'tweaks) + (acons 'font-size -2 + (ly:music-property m 'tweaks))) + m) \relative c' { s4^"wrong:" diff --git a/Documentation/snippets/simultaneous-headword.ly b/Documentation/snippets/simultaneous-headword.ly index 624f6948b9..f64e03f713 100644 --- a/Documentation/snippets/simultaneous-headword.ly +++ b/Documentation/snippets/simultaneous-headword.ly @@ -5,14 +5,15 @@ \version "2.13.10" \include "english.ly" #(set-global-staff-size 15) -\paper{ - ragged-right=##t - line-width=17\cm - indent=0\cm +\paper { + ragged-right = ##t + line-width = 17\cm + indent = 0\cm } \layout { - \context { \Score + \context { + \Score \override PaperColumn #'keep-inside-line = ##t \override NonMusicalPaperColumn #'keep-inside-line = ##t } @@ -34,292 +35,290 @@ % measures 108 - 118 \layout { - \context { - \Score - \override SpacingSpanner #'base-shortest-duration = - #(ly:make-moment 1 18) - \override NonMusicalPaperColumn #'line-break-system-details = - #'((alignment-offsets . (0 -12))) - } + \context { + \Score + \override SpacingSpanner #'base-shortest-duration = + #(ly:make-moment 1 18) + \override NonMusicalPaperColumn #'line-break-system-details = + #'((alignment-distances . (12))) + } } trillflat = - \once \override TrillSpanner #'(bound-details left text) = - #(markup #:translate-scaled '(-0.05 . -1) - #:concat (#:musicglyph "scripts.trill" - #:translate '(-0.5 . 1.9) #:fontsize -7 #:flat)) +\once \override TrillSpanner #'(bound-details left text) = +#(markup #:translate-scaled '(-0.05 . -1) + #:concat (#:musicglyph "scripts.trill" + #:translate '(-0.5 . 1.9) #:fontsize -7 #:flat)) \new PianoStaff << - % RH - \new Staff << - \clef treble - \key c \major - \time 9/16 - \set Score.currentBarNumber = #108 + % RH + \new Staff << + \clef treble + \key c \major + \time 9/16 + \set Score.currentBarNumber = #108 - % RH voice 1 - \new Voice { + % RH voice 1 + \new Voice { - \voiceOne - s4. - s8. + \voiceOne + s4. + s8. - | + | - s4. - a''8 \p \> [ ( - g''16 ] ) + s4. + a''8 \p \> [ ( + g''16 ] ) - | + | - g''4. - af''8 [ ( - g''16 ] ) + g''4. + af''8 [ ( + g''16 ] ) - | + | - g''8. [ - g''8. - g''8. \pp ] + g''8. [ + g''8. + g''8. \pp ] - | + | - g''8. [ - af''8. - af''8. ] + g''8. [ + af''8. + af''8. ] - | + | - af''8. [ - af''8. - af''8. ] + af''8. [ + af''8. + af''8. ] - | - \break + | + \break - \trillflat - af''4. \startTrillSpan - ~ - af''8. - ~ + \trillflat + af''4. \startTrillSpan + ~ + af''8. + ~ - | + | - af''4. - ~ - af''8. - ~ + af''4. + ~ + af''8. + ~ - | + | - \oneVoice - 8. [ - a''8. \p \< - bf''8. ] - ~ + \oneVoice + 8. [ + a''8. \p \< + bf''8. ] + ~ - | + | - bf''8. [ - b''8. - c'''8. ] - ~ + bf''8. [ + b''8. + c'''8. ] + ~ - \bar "||" + \bar "||" - \key ef \major - c'''8. [ - cs'''8. \f ] \stopTrillSpan - r8. + \key ef \major + c'''8. [ + cs'''8. \f ] \stopTrillSpan + r8. - } + } - % RH voice 2 - \new Voice { - \voiceTwo - \override Voice.TrillSpanner #'direction = #down - d''4. \f \startTrillSpan - ~ - d''8. - ~ + % RH voice 2 + \new Voice { + \voiceTwo + \override Voice.TrillSpanner #'direction = #DOWN + d''4. \f \startTrillSpan + ~ + d''8. + ~ - | + | - d''4. - ~ - d''8. - ~ + d''4. + ~ + d''8. + ~ - | + | - d''8. \stopTrillSpan - \trillflat - d''4. \startTrillSpan - ~ + d''8. \stopTrillSpan + \trillflat + d''4. \startTrillSpan + ~ - | + | - d''4. - ~ - d''8. - ~ + d''4. + ~ + d''8. + ~ - | + | - d''4. - ~ - d''8. - ~ + d''4. + ~ + d''8. + ~ - | + | - d''4. - ~ - d''8. \stopTrillSpan - ~ + d''4. + ~ + d''8. \stopTrillSpan + ~ - | + | - \trillflat - d''4. \startTrillSpan - ~ - d''8. - ~ + \trillflat + d''4. \startTrillSpan + ~ + d''8. + ~ - | + | - d''4. - ~ - d''8. - ~ + d''4. + ~ + d''8. + ~ - | + | - \once \override NoteColumn #'ignore-collision = ##t - \once \override NoteHead #'transparent = ##t - \once \override Dots #'transparent = ##t - \once \override Stem #'transparent = ##t - d''8. \stopTrillSpan - s4. + \once \override NoteColumn #'ignore-collision = ##t + \hideNotes + d''8. \stopTrillSpan + s4. - | + | - s8. - s8. + s8. + s8. - } + } - >> + >> - % LH staff - \new Staff { - \clef bass - \key c \major - \time 9/16 + % LH staff + \new Staff { + \clef bass + \key c \major + \time 9/16 - r8. - r8. - 8 [ ( - 16 ] ) + r8. + r8. + 8 [ ( + 16 ] ) - | + | - 4. - \clef treble - c''8 [ ( - b'16 ] ) + 4. + \clef treble + c''8 [ ( + b'16 ] ) - | + | - b'4. - c''8 [ ( - b'16 ] ) + b'4. + c''8 [ ( + b'16 ] ) - | + | - b'8. [ - b'8. - b'8. ] + b'8. [ + b'8. + b'8. ] - | + | - b'8. [ - bf'8. ] - \clef bass - 8 [ ( - 16 ] ) + b'8. [ + bf'8. ] + \clef bass + 8 [ ( + 16 ] ) - | + | - 4. - \clef treble - f'8 [ ( - bf16 ] ) + 4. + \clef treble + f'8 [ ( + bf16 ] ) - | + | - << + << - \new Voice { - \voiceOne - \override Voice.TrillSpanner #'direction = #up - f'4. \startTrillSpan - ~ - f'8. - ~ + \new Voice { + \voiceOne + \override Voice.TrillSpanner #'direction = #UP + f'4. \startTrillSpan + ~ + f'8. + ~ - | + | - f'4. - ~ - f'8. - ~ + f'4. + ~ + f'8. + ~ - | + | - f'8. \stopTrillSpan - } + f'8. \stopTrillSpan + } - \new Voice { - \voiceTwo - \override Voice.TrillSpanner #'direction = #down - bf8. [ - bf8. - bf8. ] + \new Voice { + \voiceTwo + \override Voice.TrillSpanner #'direction = #DOWN + bf8. [ + bf8. + bf8. ] - | + | - bf8. [ - bf8. - bf8. ] + bf8. [ + bf8. + bf8. ] - | + | - bf8. - } + bf8. + } - >> + >> - \oneVoice - r8. - r8. + \oneVoice + r8. + r8. - | + | - r8. - r8. - r8. - \clef bass + r8. + r8. + r8. + \clef bass - | + | - \key ef \major - r8. - r8. - r8. + \key ef \major + r8. + r8. + r8. - } + } >> diff --git a/Documentation/snippets/stemlets.ly b/Documentation/snippets/stemlets.ly index 759f0d0478..8702f355f3 100644 --- a/Documentation/snippets/stemlets.ly +++ b/Documentation/snippets/stemlets.ly @@ -37,7 +37,8 @@ the different notations. \override Staff.Stem #'stemlet-length = #0.75 c'16[^\markup { stemlets over rests } d' r f'] - g'16[^\markup { stemlets and no rests } f' \once \override Rest #'transparent = ##t r d'] + g'16[^\markup { stemlets and no rests } f' + \once \override Rest #'transparent = ##t + r16 d'] } - diff --git a/Documentation/snippets/sub-dividing-beams.ly b/Documentation/snippets/sub-dividing-beams.ly index 4602b9d6a4..534d03cc5f 100644 --- a/Documentation/snippets/sub-dividing-beams.ly +++ b/Documentation/snippets/sub-dividing-beams.ly @@ -67,8 +67,8 @@ intervals defined by the current value of @code{beatLength} by reducing the multiple beams to just one beam between the sub-groups. Note that @code{beatLength} defaults to one over the denominator of the current time signature if not set explicitly. It must be set to a fraction -giving the duration of the beam sub-group using the @code{make-moment} -function, as shown here: +giving the duration of the beam sub-group using the +@code{ly:make-moment} function, as shown here: diff --git a/Documentation/snippets/text-headword.ly b/Documentation/snippets/text-headword.ly index 6ecbbfd67d..3243663f66 100644 --- a/Documentation/snippets/text-headword.ly +++ b/Documentation/snippets/text-headword.ly @@ -5,7 +5,7 @@ \version "2.13.10" \include "english.ly" #(set-global-staff-size 15) -\paper{ +\paper { line-width = 16\cm indent = 0\cm } @@ -19,7 +19,8 @@ \layout { - \context { \Score + \context { + \Score \override PaperColumn #'keep-inside-line = ##t \override NonMusicalPaperColumn #'keep-inside-line = ##t } @@ -32,217 +33,215 @@ % measures 1 - 7 \layout { - \context { - \Score - \override SpacingSpanner #'base-shortest-duration = - #(ly:make-moment 1 20) - %\override NonMusicalPaperColumn #'line-break-system-details = - %#'((alignment-offsets . (0 -12))) - } + \context { + \Score + \override SpacingSpanner #'base-shortest-duration = + #(ly:make-moment 1 20) + } } \new PianoStaff << - % RH staff - \new Staff { - \clef treble - \key af \major - \time 3/4 - - \once \override TextScript #'staff-padding = #4 - 4. ( - _ \markup { \dynamic p \italic { con amabilità } } - 8 ) - 8. [ - 16 ] - - | - - 4 - 2 - _ \markup { \italic { ten. } } - - | - - << - - \new Voice { - \voiceOne - ef''4. ( - df''8 [ ) - ef'' ( - f'' ) ] - - | - - \once \override TextScript #'staff-padding = #4 - ef''8. ( - _ \markup { \italic { tranqu. } } - d''16 ) - df''8 \trill \fermata - _ \markup { \italic { ten. } } - } - - \new Voice { - \voiceTwo - af'4. - af'8 [ - af'8 - af'8 ] - - | + % RH staff + \new Staff { + \clef treble + \key af \major + \time 3/4 + + \once \override TextScript #'staff-padding = #4 + 4. ( + _ \markup { \dynamic p \italic { con amabilità } } + 8 ) + 8. [ + 16 ] + + | + + 4 + 2 + _ \markup { \italic { ten. } } + + | + + << + + \new Voice { + \voiceOne + ef''4. ( + df''8 [ ) + ef'' ( + f'' ) ] + + | + + \once \override TextScript #'staff-padding = #4 + ef''8. ( + _ \markup { \italic { tranqu. } } + d''16 ) + df''8 \trill \fermata + _ \markup { \italic { ten. } } + } + + \new Voice { + \voiceTwo + af'4. + af'8 [ + af'8 + af'8 ] + + | + + g'4 + g'8 + } + + >> + + \oneVoice + \once \override TextScript #'staff-padding = #4 + df''32 + _ \markup { \italic dolce } + c''32 + df''32 + ef''32 + \acciaccatura { df''[ ef'' ] } + f''8 + ef''16 + df''16 + + | + \break + \overrideProperty "Score.NonMusicalPaperColumn" + #'line-break-system-details #'((alignment-distances . (12))) + + c''4. ( + ^ \markup \italic { cantabile, con intimissimo sentimento, + ma sempre molto dolce e semplice } + ef''4 + af''8 ) + + | + + af''4 ( + g''2 ) + + | + + bf''4. ( + g''4 + ef''8 ) + + | + } - g'4 - g'8 - } - - >> - - \oneVoice - \once \override TextScript #'staff-padding = #4 - df''32 - _ \markup { \italic dolce } - c''32 - df''32 - ef''32 - \acciaccatura { df''[ ef'' ] } - f''8 - ef''16 - df''16 - - | - \break - \overrideProperty "Score.NonMusicalPaperColumn" - #'line-break-system-details #'((alignment-offsets . (0 -12))) - - c''4. ( - ^ \markup \italic { cantabile, con intimissimo sentimento, - ma sempre molto dolce e semplice } - ef''4 - af''8 ) - - | - - af''4 ( - g''2 ) - - | - - bf''4. ( - g''4 - ef''8 ) - - | - } - - % LH - \new Staff { - \clef bass - \key af \major - \time 3/4 - - 4. ( - 8 ) - 8. [ - 16 ] - - | - - 4 - 2 ^ \markup { \italic ten. } - - | - - << - - \new Voice { - \voiceOne - ef8 [ ( - af8 - c'8 - bf8 ) - c'8 ( \staccato - df'8 ] ) \staccato - - | - - bf4 - bf8 ^ \markup { \italic ten. } - } - - \new Voice { - \voiceTwo - c4. ( - f8 [ ) - ef8 ( \staccato - df8 ] ) \staccato - - | - - ef4 - ef8 \fermata - } - - >> - - \oneVoice - r8 - r4 - \clef treble - - | - - \override Staff.SustainPedalLineSpanner #'outside-staff-priority = #1000 - \override Staff.SustainPedalLineSpanner #'staff-padding = #7 - \once \override TextScript #'padding = #2 - af16 \sustainOn - ^ \markup \italic { non staccato } - _ \markup \italic { molto \concat {\dynamic {p},} sempre tranquillo - ed egualmente, non rubato } - 16 - 16 - 16 - af16 - 16 - 16 - 16 - af16 \sustainOn - 16 - 16 - 16 - - | - - bf16 \sustainOn - 16 - 16 - 16 - bf16 \sustainOn - 16 - 16 - 16 - bf16 - 16 - 16 - 16 - - | - - \override Staff.SustainPedalLineSpanner #'staff-padding = #4 - df'16 \sustainOn - 16 - 16 - 16 - df'16 - 16 - 16 - 16 - df'16 \sustainOn - 16 - 16 - 16 - - | - } + % LH + \new Staff { + \clef bass + \key af \major + \time 3/4 + + 4. ( + 8 ) + 8. [ + 16 ] + + | + + 4 + 2 ^ \markup { \italic ten. } + + | + + << + + \new Voice { + \voiceOne + ef8 [ ( + af8 + c'8 + bf8 ) + c'8 ( \staccato + df'8 ] ) \staccato + + | + + bf4 + bf8 ^ \markup { \italic ten. } + } + + \new Voice { + \voiceTwo + c4. ( + f8 [ ) + ef8 ( \staccato + df8 ] ) \staccato + + | + + ef4 + ef8 \fermata + } + + >> + + \oneVoice + r8 + r4 + \clef treble + + | + + \override Staff.SustainPedalLineSpanner #'outside-staff-priority = #1000 + \override Staff.SustainPedalLineSpanner #'staff-padding = #7 + \once \override TextScript #'padding = #2 + af16 \sustainOn + ^ \markup \italic { non staccato } + _ \markup \italic { molto \concat { \dynamic { p } , } sempre tranquillo + ed egualmente, non rubato } + 16 + 16 + 16 + af16 + 16 + 16 + 16 + af16 \sustainOn + 16 + 16 + 16 + + | + + bf16 \sustainOn + 16 + 16 + 16 + bf16 \sustainOn + 16 + 16 + 16 + bf16 + 16 + 16 + 16 + + | + + \override Staff.SustainPedalLineSpanner #'staff-padding = #4 + df'16 \sustainOn + 16 + 16 + 16 + df'16 + 16 + 16 + 16 + df'16 \sustainOn + 16 + 16 + 16 + + | + } >> diff --git a/Documentation/snippets/three-sided-box.ly b/Documentation/snippets/three-sided-box.ly index b69e07ae3e..3589080e49 100644 --- a/Documentation/snippets/three-sided-box.ly +++ b/Documentation/snippets/three-sided-box.ly @@ -16,38 +16,37 @@ around some text (or other markup). % New command to add a three sided box, with sides north, west and south % Based on the box-stencil command defined in scm/stencil.scm -% Note that ";" is used to comment a line in Scheme +% Note that ";;" is used to comment a line in Scheme #(define-public (NWS-box-stencil stencil thickness padding) - "Add a box around STENCIL, producing a new stencil." - (let* ((x-ext (interval-widen (ly:stencil-extent stencil 0) padding)) - (y-ext (interval-widen (ly:stencil-extent stencil 1) padding)) - (y-rule (make-filled-box-stencil (cons 0 thickness) y-ext)) - (x-rule (make-filled-box-stencil - (interval-widen x-ext thickness) (cons 0 thickness)))) -; (set! stencil (ly:stencil-combine-at-edge stencil X 1 y-rule padding)) - (set! stencil (ly:stencil-combine-at-edge stencil X -1 y-rule padding)) - (set! stencil (ly:stencil-combine-at-edge stencil Y 1 x-rule 0.0)) - (set! stencil (ly:stencil-combine-at-edge stencil Y -1 x-rule 0.0)) - stencil)) + "Add a box around STENCIL, producing a new stencil." + (let* ((x-ext (interval-widen (ly:stencil-extent stencil X) padding)) + (y-ext (interval-widen (ly:stencil-extent stencil Y) padding)) + (y-rule (make-filled-box-stencil (cons 0 thickness) y-ext)) + (x-rule (make-filled-box-stencil + (interval-widen x-ext thickness) (cons 0 thickness)))) + ;; (set! stencil (ly:stencil-combine-at-edge stencil X 1 y-rule padding)) + (set! stencil (ly:stencil-combine-at-edge stencil X LEFT y-rule padding)) + (set! stencil (ly:stencil-combine-at-edge stencil Y UP x-rule 0.0)) + (set! stencil (ly:stencil-combine-at-edge stencil Y DOWN x-rule 0.0)) + stencil)) % The corresponding markup command, based on the \box command defined % in scm/define-markup-commands.scm #(define-markup-command (NWS-box layout props arg) (markup?) - "Draw a box round @var{arg}. Looks at @code{thickness}, + "Draw a box round @var{arg}. Looks at @code{thickness}, @code{box-padding} and @code{font-size} properties to determine line thickness and padding around the markup." - (let* ((th (chain-assoc-get 'thickness props 0.1)) - (size (chain-assoc-get 'font-size props 0)) - (pad (* (magstep size) - (chain-assoc-get 'box-padding props 0.2))) - (m (interpret-markup layout props arg))) - (NWS-box-stencil m th pad))) + (let* ((th (chain-assoc-get 'thickness props 0.1)) + (size (chain-assoc-get 'font-size props 0)) + (pad (* (magstep size) + (chain-assoc-get 'box-padding props 0.2))) + (m (interpret-markup layout props arg))) + (NWS-box-stencil m th pad))) % Test it: -\layout { ragged-right = ##f } \relative c' { - c2^\markup { \NWS-box ABCD } - c2^\markup { \NWS-box \note #"4" #1.0 } + c1^\markup { \NWS-box ABCD } + c1^\markup { \NWS-box \note #"4" #1.0 } } diff --git a/Documentation/snippets/time-signature-printing-only-the-numerator-as-a-number-instead-of-the-fraction.ly b/Documentation/snippets/time-signature-printing-only-the-numerator-as-a-number-instead-of-the-fraction.ly index 22b8349254..db00abc9c2 100644 --- a/Documentation/snippets/time-signature-printing-only-the-numerator-as-a-number-instead-of-the-fraction.ly +++ b/Documentation/snippets/time-signature-printing-only-the-numerator-as-a-number-instead-of-the-fraction.ly @@ -9,11 +9,11 @@ texidoc = " Sometimes, a time signature should not print the whole fraction (e.g. 7/4), but only the numerator (7 in this case). This can be easily done -by using \\override Staff.TimeSignature #'style = #'single-digit to -change the style permanently. By using \\revert Staff.TimeSignature -#'style, this setting can be reversed. To apply the single-digit style -to only one time signature, use the \\override command and prefix it -with a \\once. +by using @code{\\override Staff.TimeSignature #'style = #'single-digit} +to change the style permanently. By using @code{\\revert +Staff.TimeSignature #'style}, this setting can be reversed. To apply +the single-digit style to only one time signature, use the +@code{\\override} command and prefix it with a @code{\\once}. " doctitle = "Time signature printing only the numerator as a number (instead of the fraction)" @@ -25,17 +25,18 @@ with a \\once. % Change the style permanently \override Staff.TimeSignature #'style = #'single-digit \time 2/4 - c c + c4 c \time 3/4 - c c c + c4 c c % Revert to default style: \revert Staff.TimeSignature #'style \time 2/4 - c c + c4 c % single-digit style only for the next time signature \once \override Staff.TimeSignature #'style = #'single-digit \time 5/4 - c c c c c + c4 c c c c \time 2/4 - c c + c4 c } + diff --git a/Documentation/snippets/transcription-of-ancient-music-with-incipit.ly b/Documentation/snippets/transcription-of-ancient-music-with-incipit.ly index c2db77be24..50f987169e 100644 --- a/Documentation/snippets/transcription-of-ancient-music-with-incipit.ly +++ b/Documentation/snippets/transcription-of-ancient-music-with-incipit.ly @@ -33,22 +33,18 @@ global = { \set Score.skipBars = ##t \key g \major \time 4/4 - %make the staff lines invisible on staves \override Staff.BarLine #'transparent = ##t \skip 1*8 % the actual music - % let finis bar go through all staves \override Staff.BarLine #'transparent = ##f - % finis bar \bar "|." } - discantusNotes = { \transpose c' c'' { - \clef "treble" + \clef treble d'2. d'4 | b e' d'2 | c'4 e'4.( d'8 c' b | @@ -71,7 +67,7 @@ discantusLyrics = \lyricmode { altusNotes = { \transpose c' c'' { - \clef "treble" + \clef treble r2 g2. e4 fis g | % two bars a2 g4 e | fis g4.( fis16 e fis4) | @@ -109,7 +105,7 @@ tenorLyrics = \lyricmode { bassusNotes = { \transpose c' c' { - \clef "bass" + \clef bass R1 | R1 | R1 | @@ -126,137 +122,143 @@ bassusLyrics = \lyricmode { -us. } -incipitDiscantus = \markup{ - \score{ - { - \set Staff.instrumentName="Discantus " - \override NoteHead #'style = #'neomensural - \override Rest #'style = #'neomensural - \override Staff.TimeSignature #'style = #'neomensural - \cadenzaOn - \clef "neomensural-c1" - \key f \major - \time 2/2 - c''1._"IV-" s2 %two bars - \skip 1*8 % eight bars - } - \layout { - \context {\Voice - \remove Ligature_bracket_engraver - \consists Mensural_ligature_engraver - } - line-width=4.5\cm - } - } +incipitDiscantus = \markup { + \score { + { + \set Staff.instrumentName = #"Discantus " + \override NoteHead #'style = #'neomensural + \override Rest #'style = #'neomensural + \override Staff.TimeSignature #'style = #'neomensural + \cadenzaOn + \clef "neomensural-c1" + \key f \major + \time 2/2 + c''1._"IV-" s2 %two bars + \skip 1*8 % eight bars + } + \layout { + \context { + \Voice + \remove "Ligature_bracket_engraver" + \consists "Mensural_ligature_engraver" + } + line-width = 4.5\cm + } + } } -incipitAltus = \markup{ - \score{ - { - \set Staff.instrumentName="Altus " - \override NoteHead #'style = #'neomensural - \override Rest #'style = #'neomensural - \override Staff.TimeSignature #'style = #'neomensural - \cadenzaOn - \clef "neomensural-c3" - \key f \major - \time 2/2 - r1 % one bar - f'1._"IV-" s2 % two bars - \skip 1*7 % seven bars - } - \layout { - \context {\Voice - \remove Ligature_bracket_engraver - \consists Mensural_ligature_engraver - } - line-width=4.5\cm - } - } +incipitAltus = \markup { + \score { + { + \set Staff.instrumentName = #"Altus " + \override NoteHead #'style = #'neomensural + \override Rest #'style = #'neomensural + \override Staff.TimeSignature #'style = #'neomensural + \cadenzaOn + \clef "neomensural-c3" + \key f \major + \time 2/2 + r1 % one bar + f'1._"IV-" s2 % two bars + \skip 1*7 % seven bars + } + \layout { + \context { + \Voice + \remove "Ligature_bracket_engraver" + \consists "Mensural_ligature_engraver" + } + line-width = 4.5\cm + } + } } -incipitTenor = \markup{ - \score{ { - \set Staff.instrumentName = "Tenor " - \override NoteHead #'style = #'neomensural - \override Rest #'style = #'neomensural - \override Staff.TimeSignature #'style = #'neomensural - \cadenzaOn - \clef "neomensural-c4" - \key f \major - \time 2/2 - r\longa % four bars - r\breve % two bars - r1 % one bar - c'1._"IV-" s2 % two bars - \skip 1 % one bar +incipitTenor = \markup { + \score { + { + \set Staff.instrumentName = #"Tenor " + \override NoteHead #'style = #'neomensural + \override Rest #'style = #'neomensural + \override Staff.TimeSignature #'style = #'neomensural + \cadenzaOn + \clef "neomensural-c4" + \key f \major + \time 2/2 + r\longa % four bars + r\breve % two bars + r1 % one bar + c'1._"IV-" s2 % two bars + \skip 1 % one bar } \layout { - \context {\Voice - \remove Ligature_bracket_engraver - \consists Mensural_ligature_engraver - } - line-width=4.5\cm -} -} + \context { + \Voice + \remove "Ligature_bracket_engraver" + \consists "Mensural_ligature_engraver" + } + line-width = 4.5\cm + } + } } -incipitBassus = \markup{ - \score{ { - \set Staff.instrumentName = "Bassus " - \override NoteHead #'style = #'neomensural - \override Rest #'style = #'neomensural - \override Staff.TimeSignature #'style = #'neomensural - \cadenzaOn - \clef "bass" - \key f \major - \time 2/2 - % incipit - r\maxima % eight bars - f1._"IV-" s2 % two bars +incipitBassus = \markup { + \score { + { + \set Staff.instrumentName = #"Bassus " + \override NoteHead #'style = #'neomensural + \override Rest #'style = #'neomensural + \override Staff.TimeSignature #'style = #'neomensural + \cadenzaOn + \clef "bass" + \key f \major + \time 2/2 + % incipit + r\maxima % eight bars + f1._"IV-" s2 % two bars } \layout { - \context {\Voice - \remove Ligature_bracket_engraver - \consists Mensural_ligature_engraver - } - line-width=4.5\cm - } - } + \context { + \Voice + \remove "Ligature_bracket_engraver" + \consists "Mensural_ligature_engraver" + } + line-width = 4.5\cm + } + } } %StaffGroup is used instead of ChoirStaff to get bar lines between systems \score { << - \new StaffGroup = choirStaff << - \new Voice = - "discantusNotes" << \global - \set Staff.instrumentName=\incipitDiscantus - \discantusNotes >> - \new Lyrics = - "discantusLyrics" \lyricsto discantusNotes { \discantusLyrics } + \new StaffGroup = choirStaff << + \new Voice = "discantusNotes" << + \global + \set Staff.instrumentName = \incipitDiscantus + \discantusNotes + >> + \new Lyrics = "discantusLyrics" \lyricsto discantusNotes { \discantusLyrics } - \new Voice = - "altusNotes" << \global - \set Staff.instrumentName=\incipitAltus - \altusNotes >> - \new Lyrics = - "altusLyrics" \lyricsto altusNotes { \altusLyrics } + \new Voice = "altusNotes" << + \global + \set Staff.instrumentName = \incipitAltus + \altusNotes + >> + \new Lyrics = "altusLyrics" \lyricsto altusNotes { \altusLyrics } - \new Voice = - "tenorNotes" << \global - \set Staff.instrumentName=\incipitTenor - \tenorNotes >> - \new Lyrics = - "tenorLyrics" \lyricsto tenorNotes { \tenorLyrics } + \new Voice = "tenorNotes" << + \global + \set Staff.instrumentName = \incipitTenor + \tenorNotes + >> + \new Lyrics = "tenorLyrics" \lyricsto tenorNotes { \tenorLyrics } - \new Voice = - "bassusNotes" << \global - \set Staff.instrumentName=\incipitBassus - \bassusNotes >> + \new Voice = "bassusNotes" << + \global + \set Staff.instrumentName = \incipitBassus + \bassusNotes >> - \new Lyrics = - "bassusLyrics" \lyricsto bassusNotes { \bassusLyrics } + >> + \new Lyrics = "bassusLyrics" \lyricsto bassusNotes { \bassusLyrics } %Keep the bass lyrics outside of the staff group to avoid bar lines %between the lyrics. >> @@ -264,21 +266,23 @@ incipitBassus = \markup{ \layout { \context { \Score - % no bars in staves \override BarLine #'transparent = ##t } - % the next three instructions keep the lyrics between the barlines - \context { \Lyrics - \consists "Bar_engraver" - \override BarLine #'transparent = ##t } - \context { \StaffGroup \consists "Separating_line_group_engraver" } + % the next three instructions keep the lyrics between the bar lines + \context { + \Lyrics + \consists "Bar_engraver" + \override BarLine #'transparent = ##t + } + \context { + \StaffGroup + \consists "Separating_line_group_engraver" + } \context { \Voice - % no slurs \override Slur #'transparent = ##t - % Comment in the below "\remove" command to allow line % breaking also at those barlines where a note overlaps % into the next bar. The command is commented out in this @@ -287,7 +291,7 @@ incipitBassus = \markup{ % overall spacing if you comment in the following command. %\remove "Forbid_line_break_engraver" } - indent=5\cm + indent = 5\cm } } diff --git a/Documentation/snippets/transposing-pitches-with-minimum-accidentals-smart-transpose.ly b/Documentation/snippets/transposing-pitches-with-minimum-accidentals-smart-transpose.ly index b3697ad2d9..b738ad4518 100644 --- a/Documentation/snippets/transposing-pitches-with-minimum-accidentals-smart-transpose.ly +++ b/Documentation/snippets/transposing-pitches-with-minimum-accidentals-smart-transpose.ly @@ -123,47 +123,47 @@ In this manner, the most natural enharmonic notes are chosen. } % begin verbatim #(define (naturalize-pitch p) - (let ((o (ly:pitch-octave p)) - (a (* 4 (ly:pitch-alteration p))) - ;; alteration, a, in quarter tone steps, - ;; for historical reasons - (n (ly:pitch-notename p))) - (cond - ((and (> a 1) (or (eq? n 6) (eq? n 2))) - (set! a (- a 2)) - (set! n (+ n 1))) - ((and (< a -1) (or (eq? n 0) (eq? n 3))) - (set! a (+ a 2)) - (set! n (- n 1)))) - (cond - ((> a 2) (set! a (- a 4)) (set! n (+ n 1))) - ((< a -2) (set! a (+ a 4)) (set! n (- n 1)))) - (if (< n 0) (begin (set! o (- o 1)) (set! n (+ n 7)))) - (if (> n 6) (begin (set! o (+ o 1)) (set! n (- n 7)))) - (ly:make-pitch o n (/ a 4)))) + (let ((o (ly:pitch-octave p)) + (a (* 4 (ly:pitch-alteration p))) + ;; alteration, a, in quarter tone steps, + ;; for historical reasons + (n (ly:pitch-notename p))) + (cond + ((and (> a 1) (or (eq? n 6) (eq? n 2))) + (set! a (- a 2)) + (set! n (+ n 1))) + ((and (< a -1) (or (eq? n 0) (eq? n 3))) + (set! a (+ a 2)) + (set! n (- n 1)))) + (cond + ((> a 2) (set! a (- a 4)) (set! n (+ n 1))) + ((< a -2) (set! a (+ a 4)) (set! n (- n 1)))) + (if (< n 0) (begin (set! o (- o 1)) (set! n (+ n 7)))) + (if (> n 6) (begin (set! o (+ o 1)) (set! n (- n 7)))) + (ly:make-pitch o n (/ a 4)))) #(define (naturalize music) - (let ((es (ly:music-property music 'elements)) - (e (ly:music-property music 'element)) - (p (ly:music-property music 'pitch))) - (if (pair? es) - (ly:music-set-property! - music 'elements - (map (lambda (x) (naturalize x)) es))) - (if (ly:music? e) - (ly:music-set-property! - music 'element - (naturalize e))) - (if (ly:pitch? p) - (begin - (set! p (naturalize-pitch p)) - (ly:music-set-property! music 'pitch p))) - music)) + (let ((es (ly:music-property music 'elements)) + (e (ly:music-property music 'element)) + (p (ly:music-property music 'pitch))) + (if (pair? es) + (ly:music-set-property! + music 'elements + (map (lambda (x) (naturalize x)) es))) + (if (ly:music? e) + (ly:music-set-property! + music 'element + (naturalize e))) + (if (ly:pitch? p) + (begin + (set! p (naturalize-pitch p)) + (ly:music-set-property! music 'pitch p))) + music)) naturalizeMusic = #(define-music-function (parser location m) - (ly:music?) - (naturalize m)) + (ly:music?) + (naturalize m)) music = \relative c' { c4 d e g } @@ -176,3 +176,4 @@ music = \relative c' { c4 d e g } } \layout { } } + diff --git a/Documentation/snippets/using-ly-grob-object-to-access-grobs-with--tweak.ly b/Documentation/snippets/using-ly-grob-object-to-access-grobs-with--tweak.ly index 5e38377ccf..2c085aa669 100644 --- a/Documentation/snippets/using-ly-grob-object-to-access-grobs-with--tweak.ly +++ b/Documentation/snippets/using-ly-grob-object-to-access-grobs-with--tweak.ly @@ -1,6 +1,7 @@ -%% Do not edit this file; it is automatically -%% generated from LSR http://lsr.dsi.unimi.it -%% This file is in the public domain. +% Do not edit this file; it is automatically +% generated from Documentation/snippets/new +% This file is in the public domain. +%% Note: this file works from version 2.13.10 \version "2.13.10" \header { @@ -8,8 +9,8 @@ texidoc = " Some grobs can be accessed @qq{laterally} from within another grob's -callback. These are usually listed as @qq{layout objects} in the -@qq{Internal properties} section of a grob-interface. The function +callback. These are usually listed as @qq{layout objects} in the +@qq{Internal properties} section of a grob-interface. The function @code{ly:grob-object} is used to access these grobs. @@ -27,14 +28,19 @@ accessed. Example console output: --------------------- #-Grob Accidental - #-Grob Arpeggio - #-Grob Stem - - +@example +-------------------- +#-Grob Accidental - +#-Grob Arpeggio - +#-Grob Stem - +@end example " doctitle = "Using ly:grob-object to access grobs with \\tweak" } % begin verbatim + #(define (notehead-get-accidental notehead) ;; notehead is grob (ly:grob-object notehead 'accidental-grob)) @@ -72,4 +78,3 @@ Example console output: es g>1\arpeggio } - diff --git a/Documentation/snippets/vertical-line-as-a-baroque-articulation-mark.ly b/Documentation/snippets/vertical-line-as-a-baroque-articulation-mark.ly index 9414d96a71..2a44e5b4cf 100644 --- a/Documentation/snippets/vertical-line-as-a-baroque-articulation-mark.ly +++ b/Documentation/snippets/vertical-line-as-a-baroque-articulation-mark.ly @@ -17,7 +17,7 @@ demonstrates how to achieve such a notation. } % begin verbatim upline = -#(let ((m stopped)) +#(let ((m (make-articulation "stopped"))) (set! (ly:music-property m 'tweaks) (acons 'font-size 3 (acons 'stencil (lambda (grob) diff --git a/Documentation/snippets/volta-multi-staff.ly b/Documentation/snippets/volta-multi-staff.ly index c9b745bfef..7e06acb5ea 100644 --- a/Documentation/snippets/volta-multi-staff.ly +++ b/Documentation/snippets/volta-multi-staff.ly @@ -20,7 +20,7 @@ voltaMusic = \relative c'' { } \alternative { d1 - e + e1 } } @@ -35,3 +35,4 @@ voltaMusic = \relative c'' { \new Staff \voltaMusic >> >> +