1 %% DO NOT EDIT this file manually; it is automatically
2 %% generated from LSR http://lsr.di.unimi.it
3 %% Make any changes in LSR itself, or in Documentation/snippets/new/ ,
4 %% and then run scripts/auxiliar/makelsr.py
6 %% This file is in the public domain.
10 lsrtags = "staff-notation, symbols-and-glyphs, vocal-music"
13 This snippet defines the @code{\\splitStaffBarLine},
14 @code{convUpStaffBarLine} and @code{convDownStaffBarLine} commands.
15 These add arrows at a bar line, to denote that several voices sharing a
16 staff will each continue on a staff of their own in the next system, or
17 that voices split in this way recombine.
20 doctitle = "Adding indicators to staves which get split after a break"
23 #(define-markup-command (arrow-at-angle layout props angle-deg length fill)
24 (number? number? boolean?)
26 (PI-OVER-180 (/ (atan 1 1) 34))
27 (degrees->radians (lambda (degrees) (* degrees PI-OVER-180)))
28 (angle-rad (degrees->radians angle-deg))
29 (target-x (* length (cos angle-rad)))
30 (target-y (* length (sin angle-rad))))
31 (interpret-markup layout props
33 #:translate (cons (/ target-x 2) (/ target-y 2))
35 #:translate (cons (/ length -2) 0)
36 #:concat (#:draw-line (cons length 0)
37 #:arrow-head X RIGHT fill)))))
40 splitStaffBarLineMarkup = \markup \with-dimensions #'(0 . 0) #'(0 . 0) {
42 \arrow-at-angle #45 #(sqrt 8) ##t
43 \arrow-at-angle #-45 #(sqrt 8) ##t
47 \once \override Staff.BarLine.stencil =
49 (ly:stencil-combine-at-edge
50 (ly:bar-line::print grob)
52 (grob-interpret-markup grob splitStaffBarLineMarkup)
57 convDownStaffBarLine = {
58 \once \override Staff.BarLine.stencil =
60 (ly:stencil-combine-at-edge
61 (ly:bar-line::print grob)
63 (grob-interpret-markup grob #{
64 \markup\with-dimensions #'(0 . 0) #'(0 . 0) {
65 \translate #'(0 . -.13)\arrow-at-angle #-45 #(sqrt 8) ##t
71 convUpStaffBarLine = {
72 \once \override Staff.BarLine.stencil =
74 (ly:stencil-combine-at-edge
75 (ly:bar-line::print grob)
77 (grob-interpret-markup grob #{
78 \markup\with-dimensions #'(0 . 0) #'(0 . 0) {
79 \translate #'(0 . .14)\arrow-at-angle #45 #(sqrt 8) ##t
92 \set Staff.instrumentName = "AI AII"
93 \set Staff.shortInstrumentName = "AI AII"
99 \change Staff = "shared"
100 \set Staff.instrumentName = "S A"
101 \set Staff.shortInstrumentName = "S A"
106 \repeat unfold 4 f''2
108 \repeat unfold 4 g''2
110 \repeat unfold 4 c''2
116 \repeat unfold 4 d''2
148 \new Staff = up \with {
149 instrumentName = "SI SII"
150 shortInstrumentName = "SI SII"
155 \new Staff = shared \with {
156 instrumentName = "S A"
157 shortInstrumentName = "S A"
159 \new Voice = sopI \sI
160 \new Voice = sopII \sII
161 \new Voice = altI \aI
162 \new Voice = altII \aII
165 alignBelowContext = up
167 \lyricsto sopII { e f g h }
168 \new Lyrics \lyricsto altI { a b c d e f g h i j k l }
170 \new Staff = men \with {
171 instrumentName = "T B"
172 shortInstrumentName = "T B"
175 \new Voice = ten \ten
176 \new Voice = bas \bas
178 \new Lyrics \lyricsto bas { a b c d e f g h i j k l }
183 \Staff \RemoveEmptyStaves
184 \override VerticalAxisGroup.remove-first = ##t