Re: Hairpin solid with dashed end

2018-02-21 Thread Andrew Bernard
Hi Karlin,

I have to tell you, the thought has crossed my mind more than once! :-)

Andrew


On 21 February 2018 at 22:33, Karlin High  wrote:

>
> Interesting. I was imagining your composers sitting around a table
> late at night, grinning maliciously and saying, "Let's see ol' Andy
> try to engrave THIS thing!"
>
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Hairpin solid with dashed end

2018-02-21 Thread Karlin High
On Wed, Feb 21, 2018 at 12:32 AM, Andrew Bernard
 wrote:
> For the composer I engrave for, the hairpin with a dashed section is used
> when transitioning between two dynamic levels, but there is a rest or
> silence in the line, and it is a way of reminding the performer that the
> cresc or decresc continues but to be aware of the rest and not carry the
> volume through it.

Interesting. I was imagining your composers sitting around a table
late at night, grinning maliciously and saying, "Let's see ol' Andy
try to engrave THIS thing!"
-- 
Karlin High
Missouri, USA

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Hairpin solid with dashed end

2018-02-21 Thread Thomas Morley
2018-02-21 3:25 GMT+01:00 Andrew Bernard :
> Is there any example of how to make a hairpin with normal solid lines, but
> dashed at the end, say the last quarter or so? [Yep, some new complexity
> notation again.]
>
> Andrew


Hi Andrew,

some time ago I made the code below.
It will not work with a niente-circle and at line-breaks the behaviour
is not limitrd to single part of a broken Hairpin.
Nevertheless it might be a starting-point.

#(define (solid-dashed-print-proc grob startx starty endx endy)
  (let* ((dash-def (ly:grob-property grob 'dash-definition))
 (thick
   (* (layout-line-thickness grob)
  (ly:grob-property grob 'thickness 0.1
(if (null? dash-def)
(ly:line-interface::line grob startx starty endx endy)
(reduce ly:stencil-add empty-stencil
  (map
(lambda (dash-def-elt)
  (let* ((start-x
   (+ startx (* (- endx startx) (first dash-def-elt
 (start-y
   (+ starty (* (- endy starty) (first dash-def-elt
 (end-x
   (+ startx (* (- endx startx) (second dash-def-elt
 (end-y
   (+ starty (* (- endy starty)  (second dash-def-elt)
(ly:stencil-translate
  (ly:make-stencil
(list 'dashed-line
  ;; thickness
  thick
  ;; on
  (third dash-def-elt)
  ;; off
  (- 1 (fourth dash-def-elt)) ;; calculation correct?
  ;; x-dest
  (- end-x start-x)
  ;; y-dest
  (- end-y start-y)
  ;; phase
  0)
;; x-ext
(cons start-x (- end-x start-x))
;; y-ext
(ordered-cons 0 (- end-y start-y)))
  (cons start-x start-y
dash-def)

#(define ((open-hairpin open-gap close-gap) grob)
   (let* ((stencil (ly:hairpin::print grob))
  (thick (layout-line-thickness grob))
  (dir (ly:grob-property grob 'grow-direction))
  (X-ext (ly:stencil-extent stencil X))
  (Y-ext (ly:stencil-extent stencil Y))
  (width (- (interval-length X-ext) thick))
  (height (- (interval-length Y-ext) thick))
  (scaled-height (* height (max open-gap close-gap)))
  (scaled-gap (* height (min open-gap close-gap)))
  (upper-stil-part
(solid-dashed-print-proc
  grob
  0
  (/ (if (= dir -1) scaled-height scaled-gap) 2)
  width
  (/ (if (= dir -1) scaled-gap scaled-height) 2
 (ly:stencil-translate
   (ly:stencil-add
 upper-stil-part
 (ly:stencil-scale upper-stil-part 1 -1))
   (cons (interval-start X-ext) (interval-start Y-ext)

{
  \once \override Hairpin.dash-definition =
#'((00.711)
   (0.7  1.00.4  0.75))
  \override Hairpin.stencil = #(open-hairpin 0 1.0)
  c'1\fff\> c'1 c'2 c'2\\!
}

Cheers,
  Harm

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Hairpin solid with dashed end

2018-02-20 Thread Andrew Bernard
Hi All,

For the composer I engrave for, the hairpin with a dashed section is used
when transitioning between two dynamic levels, but there is a rest or
silence in the line, and it is a way of reminding the performer that the
cresc or decresc continues but to be aware of the rest and not carry the
volume through it. This is by no means a universal or accepted convention.
It's what my colleague refers to as over specifying notation, to make sure
that as things get lost in performance as much as possible of the notated
meaning is captured.

Will try your code Stefano, thanks.


Andrew
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Hairpin solid with dashed end

2018-02-20 Thread Stefano Troncaro
Well, I worked a bit with the stencil drawing procedure earlier, so I
adapted it for what you describe. It is not working well with line
breaks... I'll have to figure out why later, but for normal hairpins it
should do what you describe.

Hope that helps.

By the way I'm also curious about their meaning.

2018-02-20 23:44 GMT-03:00 Shane Brandes :

> Just out of curiosity what does it signify?
>
> Shane
>
>
>
> On Tue, Feb 20, 2018 at 9:25 PM, Andrew Bernard
>  wrote:
> > Is there any example of how to make a hairpin with normal solid lines,
> but
> > dashed at the end, say the last quarter or so? [Yep, some new complexity
> > notation again.]
> >
> > Andrew
> >
> >
> > ___
> > lilypond-user mailing list
> > lilypond-user@gnu.org
> > https://lists.gnu.org/mailman/listinfo/lilypond-user
> >
>
> ___
> lilypond-user mailing list
> lilypond-user@gnu.org
> https://lists.gnu.org/mailman/listinfo/lilypond-user
>
\version "2.19.80"

#(define (proc-number-or-false? obj)
   (or (procedure? obj)
   (number? obj)
   (eq? obj #f)))

#(define (define-grob-property symbol type? description)
   (if (not (equal? (object-property symbol 'backend-doc) #f))
   (ly:error (_ "symbol ~S redefined") symbol))

   (set-object-property! symbol 'backend-type? type?)
   (set-object-property! symbol 'backend-doc description)
   symbol)

#(map
  (lambda (x)
(apply define-grob-property x))

  `(
 ;(circled-tip-radius ,number? "Radius for hairpin circled tip")
 (style-break-point ,number? "From 0 to 1")
 (styled-direction ,number? "-1 for LEFT and 1 for RIGHT")
 ))


#(define broken-neighbor
   (lambda (grob)
 (let* ((pieces (ly:spanner-broken-into (ly:grob-original grob)))
(me-list (member grob pieces)))
   (if (> (length me-list) 1)
   (cadr me-list)
   '()

#(define (interval-dir-set i val dir)
   (cond ((= dir LEFT) (set-car! i val))
 ((= dir RIGHT) (set-cdr! i val))
 (else (ly:error "dir must be LEFT or RIGHT"

#(define (other-dir dir) (- dir))

#(define hairpin::print-scheme
   (lambda (grob)
 (let ((grow-dir (ly:grob-property grob 'grow-direction)))
   (if (not (ly:dir? grow-dir))
   (begin
(ly:grob-suicide! grob)
'()))

   (let* ((padding (ly:grob-property grob 'bound-padding 0.5))
  (bounds (cons (ly:spanner-bound grob LEFT)
(ly:spanner-bound grob RIGHT)))
  (broken (cons
   (not (= (ly:item-break-dir (car bounds)) CENTER))
   (not (= (ly:item-break-dir (cdr bounds)) CENTER)

 (if (cdr broken)
 (let ((next (broken-neighbor grob)))
   (if (ly:spanner? next)
   (begin
(ly:grob-property next 'after-line-breaking)
(set-cdr! broken (grob::is-live? next)))
   (set-cdr! broken #f

 (let* ((common
 (ly:grob-common-refpoint (car bounds) (cdr bounds) X))
(x-points (cons 0 0))
(circled-tip (ly:grob-property grob 'circled-tip))
(height (* (ly:grob-property grob 'height 0.2)
  (ly:staff-symbol-staff-space grob)))
(rad (ly:grob-property grob 'circled-tip-radius (* 0.525 height)))
(thick (* (ly:grob-property grob 'thickness 1.0)
 (ly:staff-symbol-line-thickness grob)))
(shorten (ly:grob-property grob 'shorten-pair '(0 . 0

   (define (inner dir)
 (let* ((b (interval-bound bounds dir))
(e (ly:generic-bound-extent b common)))
   (interval-dir-set
x-points (ly:grob-relative-coordinate b common X) dir)

   (if (interval-bound broken dir)
   (if (= dir LEFT)
   (interval-dir-set
x-points (interval-bound e (other-dir dir)) dir)
   (let* ((broken-bound-padding
   (ly:grob-property grob 'broken-bound-padding 0.0))
  (chp (ly:grob-object grob 'concurrent-hairpins)))
 (let loop ((i 0))
   (if (and (ly:grob-array? chp)
(< i (ly:grob-array-length chp)))
   (let ((span-elt (ly:grob-array-ref chp i)))
 (if (= (ly:item-break-dir (ly:spanner-bound span-elt RIGHT))
LEFT)
 (set! broken-bound-padding
   (max broken-bound-padding
 (ly:grob-property span-elt 'broken-bound-padding 0.0
 (loop 

Re: Hairpin solid with dashed end

2018-02-20 Thread Shane Brandes
Just out of curiosity what does it signify?

Shane



On Tue, Feb 20, 2018 at 9:25 PM, Andrew Bernard
 wrote:
> Is there any example of how to make a hairpin with normal solid lines, but
> dashed at the end, say the last quarter or so? [Yep, some new complexity
> notation again.]
>
> Andrew
>
>
> ___
> lilypond-user mailing list
> lilypond-user@gnu.org
> https://lists.gnu.org/mailman/listinfo/lilypond-user
>

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Hairpin solid with dashed end

2018-02-20 Thread Andrew Bernard
Is there any example of how to make a hairpin with normal solid lines, but
dashed at the end, say the last quarter or so? [Yep, some new complexity
notation again.]

Andrew
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user