lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Pedal gradual release


From: Aaron Hill
Subject: Re: Pedal gradual release
Date: Sun, 20 Jan 2019 06:27:55 -0800
User-agent: Roundcube Webmail/1.3.8

On 2019-01-20 5:16 am, Andrew Bernard wrote:
Hi Aaron,

What we really want is a lovely curved bezier spline! I appreciate your
suggestion, but I personally would rather code PostScript than hack
hairpins to be pedal dynamics. I went through all that when I tried to do
this by hijacking text spanners, and it was never satisfactory.

The desire for nice gradual release curves was what led to a PostScript
concept.

Ah, well how about something like this:

%%%%
gradualSustain = #(define-event-function (coords) (list?) #{
  -\tweak stencil #(lambda (grob)
    (let* ((sten (ly:piano-pedal-bracket::print grob))
           (xex (ly:stencil-extent sten X))
           (lenx (interval-length xex))
           (yex (ly:stencil-extent sten Y))
           (leny (interval-length yex))
           (thick (layout-line-thickness grob))
           (eh (ly:grob-property grob 'edge-height)))
      (ly:stencil-translate (ly:stencil-add
          (make-connected-line (list
            (cons 0 (car eh)) (cons 0 0)
            (cons lenx 0) (cons lenx (cdr eh))) grob)
          (make-connected-path-stencil coords thick lenx leny #f #f))
        (cons (car xex) (car yex)))))
  \sustainOn #})

sustainPedal = {
  s4-\tweak edge-height #'(1 . 2)
    \gradualSustain #'((0.3 0)(0.5 1.5 0.8 -0.5 1 1))
  s s s s s\sustainOff
}
%%%%

This doesn't have the dashed line for the curve, but I presume that would be possible by digging more into make-connected-path-stencil. Unfortunately, I am running out of time to look at this further.

-- Aaron Hill



reply via email to

[Prev in Thread] Current Thread [Next in Thread]