2012/11/11 David Nalesnik <david.nales...@gmail.com>: > On Sun, Nov 11, 2012 at 3:36 PM, Daniel Rosen <drose...@gmail.com> wrote: >> Fantastic. I had a feeling that it would be a relatively simple function (it >> certainly appears to be), but I know absolutely nothing about Scheme. I'll >> have to read the Extending manual one of these days. >> > > Yes--Scheme certainly opens up a lot of possibilities, and it's great > fun if you like solving puzzles.
Hi David, Big surprise: I _do_ like solving puzzles. :D On topic: Your function doesn't cover the case, where a rest is first in a tuplet. Try it with: \relative c'' { \times 2/3 { r8 c, c } } Here my approach, covering the rest-case and emitting a warning if kneed beam is occurring: \version "2.16.0" \relative c' { \override TupletBracket #'after-line-breaking = #(lambda (grob) (let* ((tuplet-dir (ly:grob-property grob 'direction)) (note-columns (ly:grob-array->list (ly:grob-object grob 'note-columns))) (note-heads-array-list (flatten-list (map (lambda (x) (ly:grob-object x 'note-heads)) note-columns))) (note-heads (flatten-list (map (lambda (x) (ly:grob-array->list x)) note-heads-array-list))) (stems (map (lambda (x) (ly:grob-object x 'stem)) note-heads)) (stem-dirs (map (lambda (x) (ly:grob-property x 'direction)) stems)) (sorted-stems-dirs-list (sort-list stem-dirs (lambda (a b) (< a b)))) (equal-stems-dir? (= (car sorted-stems-dirs-list) (car (reverse sorted-stems-dirs-list))))) (if (and equal-stems-dir? (= (car sorted-stems-dirs-list) tuplet-dir)) (ly:grob-set-property! grob 'direction (* -1 (car sorted-stems-dirs-list))) (ly:warning "Kneed beam detected - if desired, adjust TupletBracket manually.")))) \times 2/3 { c'8 c c } \times 2/3 { r8 c c } \times 2/3 { r8 r c } \times 2/3 { c c'' r } \break \times 2/3 { c,,,8 c c } \times 2/3 { r8 c c } \times 2/3 { r8 r c } \times 2/3 { c c'' r } } Best, Harm _______________________________________________ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user