Am 11.08.2015 um 10:00 schrieb Robin Bannister:
  Dominic wrote:

hoist = % for moving StemTremolo beams further from notehead
{
   \once \override Stem.length =
   #(lambda (grob) (+ 1 (ly:stem::calc-length grob)))
}


I made a scheme function from this that extends stems of quarter and half notes if they have a tremolo of 32nd or shorter notes (see attachment). Because I don’t know scheme well this looks like sort of spaghetti code to me and might break soon; sorry for that, maybe it could be improved.

Comment indicates I had reservations about 'unpure only'.
Someone else might be able to explain that.


I don’t know what this is so I don’t understand David’s answer. I read NR 5.5.5 but I don’t see how this has to do with our problem …
\version "2.19.24"

% ideas found at
% http://www.lilypondforum.de/index.php?topic=1734.msg9614#msg9614
% http://lsr.di.unimi.it/LSR/Item?id=884
unstrangleTremolos =
#(define-music-function (music) (ly:music?)
   (music-map
    (lambda (m)
      (if (music-is-of-type? m 'note-event)
          (let*
           ((a (ly:music-property m 'articulations))
            (d (ly:music-property m 'duration))
            (r (filter
                (lambda (v)
                  (eq? (ly:music-property v 'name) 'TremoloEvent))
                a))
            (t (if (null? r) #f (car r))))
           (if (and (> (ly:duration-log d) 0) (< (ly:duration-log d) 3))
               (if (and t (> (ly:music-property t 'tremolo-type) 16))
                   (begin
                    (ly:music-set-property! m 'tweaks
                      (append
                       (ly:music-property m 'tweaks)
                       (list (cons (cons (quote Stem) (quote length))
                               (lambda (grob) (+ 1 (ly:stem::calc-length grob)))))))
                    m)
                   m)
               m))
          m))
    music))

music = \relative {
  b'1:32
  b2: b4: b8: b:
  b4:8 b:16 b:32 b:64
  b!2:32 b8:16 b: b: b:
  \tweak color #green b2:32 b
}

\markup "original LilyPond behaviour"
{ \music \stemUp \music }
\markup "“unstrangled”"
% Does anyone know a better word? I used this because with original behaviour
% some notes look like they were strangled by the tremolo.
\unstrangleTremolos { \music \stemUp \music }

Attachment: unstrangleTremolos.pdf
Description: Adobe PDF document

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

Reply via email to