On 6 mars 2013, at 20:06, Trevor Bača <trevorb...@gmail.com> wrote:

> 
> 
> 
> On Tue, Mar 5, 2013 at 11:26 PM, Trevor Bača <trevorb...@gmail.com> wrote:
> 
> 
> 
> On Mon, Mar 4, 2013 at 3:42 PM, Thomas Morley <thomasmorle...@googlemail.com> 
> wrote:
> 2013/3/4 Joseph Rushton Wakeling <joseph.wakel...@webdrake.net>:
> > On 03/04/2013 05:29 PM, Trevor Bača wrote:
> >>
> >> I'm considering sponsoring the work and I'm curious to know if there would
> >> be
> >> any other adopters if the feature were implemented.
> 
> This workaround was posted more than 2 years ago in the german forum
> http://www.lilypondforum.de/index.php?topic=755.msg4238#msg4238
> It's 2.12.3, though, compiles with 2.16.2, too.
> Might be starting point:
> 
> \version "2.12.3"
> 
> flarePS = \markup { \postscript #"
>         .1 setlinewidth
>         -1 0.6666 translate
>         0 0 moveto
>         0 0 1 .1 1 .5 curveto
>         stroke
> 
>         0 -1.3332 translate
>         0 0 moveto
>         0 0 1 -.1 1 -.5 curveto
>         stroke"
> }
> 
> flare = #(make-dynamic-script flarePS)
> 
> { g'2.\< a'4\flare }
> 
> 
> 
> -Harm
> 
> 
> Hi Harm,
> 
> Thanks fort this; I appreciate the workaround.
> 
> I implemented a number of the missing dynamics, narrowed the width of the 
> hairpins (which is customary when using these flared endings), and changed 
> the curved flares to angled flares (which is also customary).
> 
> The results are as follows. 
> 
> 
> ### BEGIN FLARED HAIRPIN EXAMPLE ###
> 
> \version "2.17.9"
> \language "english"
> 
> flare_ps = \markup \with-dimensions #'(0 . 0.1) #'(-1.3333 . 1.3333) { 
> \postscript #"
>         .1 setlinewidth
>         -1 0.3333 translate
>         0 0 moveto
>         0.25 0.75 lineto
>         stroke
> 
>         0 -0.65 translate
>         0 0 moveto
>         0.25 -0.75 lineto
>         stroke"
> }
> 
> flare_sf_ps = \markup \with-dimensions #'(0 . 0.1) #'(-1.3333 . 1.3333) { 
> \postscript #"
>         .1 setlinewidth
>         -1 0.3333 translate
>         0 0 moveto
>         0.25 0.75 lineto
>         stroke
> 
>         0 -0.65 translate
>         0 0 moveto
>         0.25 -0.75 lineto
>         stroke"
>         \translate #'(-1 . -0.625) \dynamic sf
> }
> 
> flare_sfz_ps = \markup \with-dimensions #'(0 . 0.1) #'(-1.3333 . 1.3333) { 
> \postscript #"
>         .1 setlinewidth
>         -1 0.3333 translate
>         0 0 moveto
>         0.25 0.75 lineto
>         stroke
> 
>         0 -0.65 translate
>         0 0 moveto
>         0.25 -0.75 lineto
>         stroke"
>         \translate #'(-1 . -0.625) \dynamic sfz
> }
> 
> flare_sffz_ps = \markup \with-dimensions #'(0 . 0.1) #'(-1.3333 . 1.3333) { 
> \postscript #"
>         .1 setlinewidth
>         -1 0.3333 translate
>         0 0 moveto
>         0.25 0.75 lineto
>         stroke
> 
>         0 -0.65 translate
>         0 0 moveto
>         0.25 -0.75 lineto
>         stroke"
>         \translate #'(-1 . -0.625) \dynamic sffz
> }
> 
> flare_pp_ps = \markup { \concat { \raise #0.3333 \flare_ps \dynamic { pp } } }
> flare_p_ps = \markup { \concat { \raise #0.3333 \flare_ps \dynamic { p } } }
> flare_mp_ps = \markup { \concat { \raise #0.3333 \flare_ps \dynamic { mp } } }
> flare_mf_ps = \markup { \concat { \raise #0.6 \flare_ps \dynamic { mf } } }
> flare_f_ps = \markup { \concat { \raise #0.6 \flare_ps \dynamic { f } } }
> flare_ff_ps = \markup { \concat { \raise #0.6 \flare_ps \dynamic { ff } } }
> flare_fff_ps = \markup { \concat { \raise #0.6 \flare_ps \dynamic { fff } } }
> 
> flare_pp = #(make-dynamic-script flare_pp_ps)
> flare_p = #(make-dynamic-script flare_p_ps)
> flare_mp = #(make-dynamic-script flare_mp_ps)
> flare_mf = #(make-dynamic-script flare_mf_ps)
> flare_f = #(make-dynamic-script flare_f_ps)
> flare_ff = #(make-dynamic-script flare_ff_ps)
> flare_fff = #(make-dynamic-script flare_fff_ps)
> 
> flare_sf = #(make-dynamic-script flare_sf_ps)
> flare_sfz = #(make-dynamic-script flare_sfz_ps)
> flare_sffz = #(make-dynamic-script flare_sffz_ps)
> 
> \new Score {
>     \new Staff \with {
>         \override DynamicLineSpanner #'Y-extent = #'(-1.5 . 1.5)
>         \override DynamicLineSpanner #'staff-padding = #3
>     } {
>         \time 4/2
>         \override Hairpin #'height = #0.3333
>         c'2 \pp \< d'2 e'2 f'2 \flare_p
>         c'2 \pp \< d'2 e'2 f'2 \flare_mp
>         c'2 \pp \< d'2 e'2 f'2 \flare_mf
>         \break
>         c'2 \pp \< d'2 e'2 f'2 \flare_f
>         c'2 \pp \< d'2 e'2 f'2 \flare_ff
>         c'2 \pp \< d'2 e'2 f'2 \flare_fff
>         \break
>         c'2 \pp \< d'2 e'2 f'2 \flare_sf
>         c'2 \pp \< d'2 e'2 f'2 \flare_sfz
>         c'2 \pp \< d'2 e'2 f'2 \flare_sffz
>     }
> }
> 
> ### END FLARED HAIRPIN EXAMPLE ###
>  
> 
> See the attached PNG for a table of results.
> 
> 
> Does anyone have an opinion on this type of solution?
> 
> My feeling is that it basically works but feels a bit breaky. (It also means 
> maintaining a rather large inventory of custom markup definitions, and 
> suddenly realizing late one night while composing that "rfz" has been left 
> out and needs to be added in.) Which makes me think the right thing to do is 
> to commission Mike to implement a general solution.
> 
> (The original thread from which Harm took the solution also points out that 
> the postscript-rendered flares become too thin when you set a relatively 
> small global staff for your score. Rendering the above example with 
> #(set-global-staff-size 12) shows that this is true.)
> 
> Any other opinions or workarounds before moving on to sponsorship?
> 
> 
> 
> And here is a corresponding implementation of mantenimento spanners:
> 
> 
> ### BEGIN MANTENIMENTO EXAMPLE ###
> 
> nib_ps = \markup { \postscript #"
>         .1 setlinewidth
>         -1 0 translate
>         0 0 moveto
>         0 0.5 lineto
>         stroke"
> }
> 
> nib_ppp_ps = \markup { \concat { \nib_ps \raise #-0.25 \dynamic { ppp } } }
> nib_pp_ps = \markup { \concat { \nib_ps \raise #-0.25 \dynamic { pp } } }
> nib_p_ps = \markup { \concat { \nib_ps \raise #-0.25 \dynamic { p } } }
> nib_mp_ps = \markup { \concat { \nib_ps \raise #-0.25 \dynamic { mp } } }
> nib_mf_ps = \markup { \concat { \nib_ps \raise #-0.66 \dynamic { mf } } }
> nib_f_ps = \markup { \concat { \nib_ps \raise #-0.66 \dynamic { f } } }
> nib_ff_ps = \markup { \concat { \nib_ps \raise #-0.66 \dynamic { ff } } }
> nib_fff_ps = \markup { \concat { \nib_ps \raise #-0.66 \dynamic { fff } } }
> nib_sfz_ps = \markup { \concat { \nib_ps \raise #-0.66 \dynamic { sfz } } }
> nib_sffz_ps = \markup { \concat { \nib_ps \raise #-0.66 \dynamic { sffz } } }
> nib_sfffz_ps = \markup { \concat { \nib_ps \raise #-0.66 \dynamic { sfffz } } 
> }
> 
> nib_ppp = #(make-dynamic-script nib_ppp_ps)
> nib_pp = #(make-dynamic-script nib_pp_ps)
> nib_p = #(make-dynamic-script nib_p_ps)
> nib_mp = #(make-dynamic-script nib_mp_ps)
> nib_mf = #(make-dynamic-script nib_mf_ps)
> nib_f = #(make-dynamic-script nib_f_ps)
> nib_ff = #(make-dynamic-script nib_ff_ps)
> nib_fff = #(make-dynamic-script nib_fff_ps)
> nib_sfz = #(make-dynamic-script nib_sfz_ps)
> nib_sffz = #(make-dynamic-script nib_sffz_ps)
> nib_sfffz = #(make-dynamic-script nib_sfffz_ps)
> 
> \layout { indent = #0 }
> 
> \new Score {
>     \new Staff \with {
>         \override DynamicLineSpanner #'staff-padding = #3
>         \override DynamicLineSpanner #'Y-extent = #'(-1.5 . 1.5)
>     } {
>         \time 4/2
>         \override Hairpin #'height = #0
>         c'2 \f \< d'2 e'2 f'2  \nib_ppp
>         c'2 \p \< d'2 e'2 f'2  \nib_pp
>         c'2 \f \< d'2 e'2 f'2  \nib_p
>         c'2 \f \< d'2 e'2 f'2  \nib_mp
>         \break
>         c'2 \f \< d'2 e'2 f'2  \nib_mf
>         c'2 \p \< d'2 e'2 f'2  \nib_f
>         c'2 \f \< d'2 e'2 f'2  \nib_ff
>         c'2 \f \< d'2 e'2 f'2  \nib_fff
>         \break
>         c'2 \p \< d'2 e'2 f'2  \nib_sfz
>         c'2 \p \< d'2 e'2 f'2  \nib_sffz
>         c'2 \f \< d'2 e'2 f'2  \nib_sfffz
>     }
> }
> 
> ### END MANTENIMENTO EXAMPLE ###
> 
> 
> Table of results attached.
> 
> 
> Trevor. 
> 

Here's another way to do it.

Cheers,
MS

\version "2.17.13"

#(define (mantenimento grob)
  (let* ((sten (ly:hairpin::print grob))
         (xex (ly:stencil-extent sten X))
         (yex (ly:stencil-extent sten Y))
         (len (interval-length yex)))
  (ly:stencil-translate
    (make-connected-path-stencil
      `((,(cdr xex) 0) (,(cdr xex) ,(/ len 2)))
      0.1
      1.0
      1.0
      #f
      #f)
    (cons (car xex) (car yex)))))

\relative c'' {
  \override Hairpin #'stencil = #mantenimento
  a4\< a a a\f
  a4\< a a a\p
  a4\< a a a\sfz
}
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to