[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Conductor cues using brackets
From: |
Thomas Morley |
Subject: |
Re: Conductor cues using brackets |
Date: |
Wed, 15 Nov 2017 22:49:53 +0100 |
2017-11-15 18:08 GMT+01:00 Pierre-Luc Gauthier <address@hidden>:
> Hi there,
>
> Is there a way to add a bracket (say, a piano bracket) in the middle
> of a multiple staff score that would be spanning vertically over an
> arbitrary number of staff?
>
> Since it is rather hard to explain, please see attached PNG.
>
> I often spend hours writing cue notes by hand (sharpy + color coded
> pen, etc) on conductor scores mainly for notating player entry and
> specific cues. The problem is that it obviously cannot be reproduced
> if I, for whatever reason, reprint the score as those cues are hand
> written.
>
> So, what I would hope for, is some way of getting LilyPond to insert
> brackets inside a score like the one in the attached PNG.
>
> Thanks for any pointers.
> --
> Pierre-Luc Gauthier
Best I can think of is something at the lines of my older coding
below, hacking GridLine/GridPoint.
You may want to replace make-bow-stencil with a stencil derived from
left-brace-markup or with the ones from
http://lsr.di.unimi.it/LSR/Item?id=988
\version "2.19.56"
parentheses =
#(define-music-function (shorten-pair padding dir)
((pair? '(0 . 0)) number? ly:dir?)
"@var{dir} sets the opening/closing direction of the parentheses.
@var{padding} moves the parentheses in X-axis direction, recognized by the
spacing-engine. See limitations below, though.
The optional @var{shorten-pair} may be used to adjust the parentheses in
Y-axis direction.
The final parentheses will cover all Staffs of the current system.
Limitation:
Accidentals, dots, etc are not taken into account.
To avoid collisions adjusting @var{padding} neds to be done manually."
#{
\once \override Staff.GridPoint.X-offset = $padding
\once\override Score.GridLine.shorten-pair = $shorten-pair
\once \override Score.GridLine.stencil =
#(lambda (grob)
(let* ((stil (ly:grid-line-interface::print grob))
(stil-y-ext (ly:stencil-extent stil Y))
(thick (ly:grob-property grob 'thickness 0.1))
;; hijacking shorten-pair
(shorten-pair (ly:grob-property grob 'shorten-pair '(0 . 0)))
;; GridLine goes from the middle of top to bottom staff
;; Thus we extend it by 2 (the default staff-space) and add a
;; little extra over-shoot, i.e 0.5.
;; The new parentheses starts at '(- dir) in X-axis direction to
;; avoid collisions with preceding grobs
;; The values are tweakable via overrides for
;; Score.GridLine.shorten-pair.
;; TODO get staff-space from layout
(start
(cons (- dir)
(- (car stil-y-ext) 2.5 (- (car shorten-pair)))))
(stop
(cons (- dir)
(+ (cdr stil-y-ext) 2.5 (- (cdr shorten-pair)))))
;; see 'make-tie-stencil' from stencil.scm
(height-limit 0.7)
(ratio 0.33)
;; taken from bezier-bow.cc
(F0_1
(lambda (x) (* (/ 2 PI) (atan (* PI x 0.5)))))
(slur-height
(lambda (w h_inf r_0) (F0_1 (* (/ (* w r_0) h_inf) h_inf))))
(width (abs (- (cdr start) (cdr stop))))
(angularity 0.5)
(height (slur-height width height-limit ratio)))
(make-bow-stencil
start
stop
thick angularity height (- dir))))
#})
\layout {
\context {
\Staff
\consists "Grid_point_engraver"
%% adjust the value if needed
gridInterval = #(ly:make-moment 1/64)
}
\context {
\Score
\consists "Grid_line_span_engraver"
\override GridLine.stencil = ##f
}
}
\new StaffGroup
<<
\relative {
\parentheses #-2.5 #LEFT
cis''2
\parentheses #'(9 . 0) #-1.5 #LEFT
d
\parentheses #'(9 . 9) #-1.5 #LEFT
c
\parentheses #'(9 . 9) #2.5 #RIGHT
d
\parentheses #'(9 . 0) #2.5 #RIGHT
c
\parentheses #2.5 #RIGHT
d
}
\relative { c'' d c d c d }
\relative { c'' d c d c d }
>>
HTH a bit,
Harm