1 %% DO NOT EDIT this file manually; it is automatically
2 %% generated from LSR http://lsr.dsi.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} command, which adds
14 arrows in north-east and south-east directions at a bar line, to denote
15 that several voices sharing a staff will each continue on a staff of
16 their own in the next system.
19 doctitle = "Adding indicators to staves which get split after a break"
22 #(define-markup-command (arrow-at-angle layout props angle-deg length fill)
23 (number? number? boolean?)
25 ;; PI-OVER-180 and degrees->radians are taken from flag-styles.scm
26 (PI-OVER-180 (/ (atan 1 1) 45))
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)))))
39 splitStaffBarLineMarkup = \markup \with-dimensions #'(0 . 0) #'(0 . 0) {
41 \arrow-at-angle #45 #(sqrt 8) ##f
42 \arrow-at-angle #-45 #(sqrt 8) ##f
46 \once \override Staff.BarLine #'stencil =
48 (ly:stencil-combine-at-edge
49 (ly:bar-line::print grob)
51 (grob-interpret-markup grob splitStaffBarLineMarkup)
64 \new Staff \with { instrumentName = #"High I + II" } {
72 \new Staff \with { instrumentName = #"Low" } {
80 \new Staff \with { shortInstrumentName = #"H I" } {
82 \repeat unfold 2 { r4 f''2 r4 } \repeat unfold 2 e''1
84 \new Staff \with { shortInstrumentName = #"H II" } {
86 \repeat unfold 4 b'2 \repeat unfold 2 c''1
88 \new Staff \with { shortInstrumentName = #"L" } {
100 \Staff \RemoveEmptyStaves
101 \override VerticalAxisGroup #'remove-first = ##t