Sorry I was in a hurry few minutes ago and I simply copy/paste an old
coding.
Well, having some more time and re-reading the code I've seen some minor
things:

\version "2.19.35"

%%% Credit to the LSR => http://lsr.di.unimi.it/LSR/Item?id=82
#(define (add-gliss m)
   (case (ly:music-property m 'name)
     ((NoteEvent) (set! (ly:music-property m 'articulations)
                      (append (ly:music-property m 'articulations)
                         (list (make-music (quote GlissandoEvent)))))
                   m)
     (else #f)))

addGliss = #(define-music-function (music)(ly:music?) (map-some-music
add-gliss music))

%%% Credit to Harm =>
http://lilypond.1069038.n5.nabble.com/Stem-length-at-a-fixed-height-td172661.html#a172686
equal-staff-stems =
#(define-music-function (val)(number?)
  #{
    \override Stem.direction =
      #(lambda (grob)
        (if (negative? val)
            DOWN
            UP))

    \override Stem.after-line-breaking =
      #(lambda (grob)
        (let* ((stem-begin-position (ly:grob-property grob
'stem-begin-position)))
          ;; the override for Beam.positions counts from staff-position 0
          ;; thus we need to go there for the (unbeamed) stem-length as well
        ;; beam-thickness is taken from engraver-init.ly:
        (ly:grob-set-property! grob
          'length
          (+ (if (negative? val)
                 stem-begin-position
                 (- stem-begin-position))
             (* (abs val) 2)
             ;; beam-thickness:
             0.32))))

    \override Beam.positions = #(cons val val)
  #})

%%% Snippet %%%%%
\score {
  \new Staff  \relative {
    \addGliss {
      e'8[ g b g e d' e,]
    }
  }
  \layout {
    \override NoteHead.transparent =##t
    \equal-staff-stems #4
    \override Glissando.minimum-length = #3
    \override Glissando.springs-and-rods = #ly:spanner::set-spacing-rods
    \override Glissando.thickness = #4
    \override Glissando.bound-details =#'(
       (right (attach-dir . 1) (padding . 0))
       (left  (attach-dir . 1) (padding . 0)))
    \override NoteHead.no-ledgers = ##t
    \stemUp
  }
}

Well I think this is it ;) and, again, sorry for the noise.
Cheers,
Pierre


2016-01-27 20:05 GMT+01:00 Pierre Perol-Schneider <
pierre.schneider.pa...@gmail.com>:

> Sorry, too fast:
>
>
> #(define (add-gliss m)
>    (case (ly:music-property m 'name)
>      ((NoteEvent) (set! (ly:music-property m 'articulations)
>                       (append (ly:music-property m 'articulations)
>                          (list (make-music (quote GlissandoEvent)))))
>                    m)
>      (else #f)))
>
> addGliss = #(define-music-function (music)(ly:music?) (map-some-music
> add-gliss music))
>
> equal-staff-stems =
> %%% =>
> http://lilypond.1069038.n5.nabble.com/Stem-length-at-a-fixed-height-td172661.html#a172686
> #(define-music-function (val)(number?)
>   #{
>     \override Stem.direction =
>       #(lambda (grob)
>         (if (negative? val)
>             DOWN
>             UP))
>
>     \override Stem.after-line-breaking =
>       #(lambda (grob)
>         (let* ((stem-begin-position (ly:grob-property grob
> 'stem-begin-position)))
>           ;; the override for Beam.positions counts from staff-position 0
>           ;; thus we need to go there for the (unbeamed) stem-length as
> well
>         ;; beam-thickness is taken from engraver-init.ly:
>         (ly:grob-set-property! grob
>           'length
>           (+ (if (negative? val)
>                  stem-begin-position
>                  (- stem-begin-position))
>              (* (abs val) 2)
>              ;; beam-thickness:
>              0.32))))
>
>     \override Beam.positions = #(cons val val)
>   #})
>
> %%% So, here it goes:
> \score {
>   \new Staff  \relative {
>     \addGliss {
>       e'8[ g b g e d' e,]
>     }
>   }
>   \layout {
>     \override NoteHead.transparent =##t
>     \equal-staff-stems #6
>     \override Stem.avoid-note-head =##t
>     \override Glissando.minimum-length = #3
>     \override Glissando.springs-and-rods = #ly:spanner::set-spacing-rods
>     \override Glissando.thickness = #4
>     \override Glissando.bound-details =#'(
>        (right (attach-dir . 1) (padding . 0))
>        (left  (attach-dir . 1) (padding . 0)))
>     \override NoteHead.no-ledgers = ##t
>     \stemUp
>   }
> }
>
> Pierre
>
> 2016-01-27 20:02 GMT+01:00 Pierre Perol-Schneider <
> pierre.schneider.pa...@gmail.com>:
>
>>
>>
>> 2016-01-27 19:38 GMT+01:00 Caio Giovaneti de Barros <
>> caio.bar...@gmail.com>:
>>
>> Well, you can see that this code is much bigger than mine.
>>>
>>
>> Yep, plus some copy/paste errors. So here again:
>>
>> \version "2.19.32"
>>
>> #(define path-gliss
>>     (lambda (grob)
>>     (if (ly:stencil? (ly:line-spanner::print grob))
>>         (let* ((stencil (ly:line-spanner::print grob)))
>>           (ly:stencil-translate
>>             (grob-interpret-markup grob
>>               (markup
>>                 (#:path glissWidth
>>                   (list (list 'moveto 0 0)
>>                     (list 'curveto 0 0 (first handle) (second handle)
>> width (* height dir))))))
>>                         (if (> dir 0)
>>                             (cons (interval-start X-ext) (+
>> (interval-start Y-ext) 0.1))
>>                             (cons (interval-start X-ext) (+
>> (interval-start Y-ext) height)))))
>>        )))
>>
>> #(define (add-gliss m)
>>    (case (ly:music-property m 'name)
>>      ((NoteEvent) (set! (ly:music-property m 'articulations)
>>                       (append (ly:music-property m 'articulations)
>>                          (list (make-music (quote GlissandoEvent)))))
>>                    m)
>>      (else #f)))
>>
>> addGliss = #(define-music-function (music)(ly:music?) (map-some-music
>> add-gliss music))
>>
>>
>> equal-staff-stems =
>> %%% =>
>> http://lilypond.1069038.n5.nabble.com/Stem-length-at-a-fixed-height-td172661.html#a172686
>> #(define-music-function (val)(number?)
>>   #{
>>     \override Stem.direction =
>>       #(lambda (grob)
>>         (if (negative? val)
>>             DOWN
>>             UP))
>>
>>     \override Stem.after-line-breaking =
>>       #(lambda (grob)
>>         (let* ((stem-begin-position (ly:grob-property grob
>> 'stem-begin-position)))
>>           ;; the override for Beam.positions counts from staff-position 0
>>           ;; thus we need to go there for the (unbeamed) stem-length as
>> well
>>         ;; beam-thickness is taken from engraver-init.ly:
>>         (ly:grob-set-property! grob
>>           'length
>>           (+ (if (negative? val)
>>                  stem-begin-position
>>                  (- stem-begin-position))
>>              (* (abs val) 2)
>>              ;; beam-thickness:
>>              0.32))))
>>
>>     \override Beam.positions = #(cons val val)
>>   #})
>>
>> %%% So, here it goes:
>> \score {
>>   \new Staff  \relative {
>>     \addGliss {
>>       e'8[ g b g e d' e,]
>>     }
>>   }
>>   \layout {
>>     \override NoteHead.transparent =##t
>>     \equal-staff-stems #6
>>     \override Stem.avoid-note-head =##t
>>     \override Glissando.minimum-length = #5
>>     \override Glissando.springs-and-rods = #ly:spanner::set-spacing-rods
>>     \override Glissando.thickness = #4
>>     \override Glissando.bound-details =#'(
>>        (right (attach-dir . 1) (padding . 0))
>>        (left  (attach-dir . 1) (padding . 0)))
>>     \override NoteHead.no-ledgers = ##t
>>     \stemUp
>>   }
>> }
>>
>> Cheers,
>> Pierre
>>
>>
>>
>>
>>
>
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to