2013/10/1 Gilberto Agostinho <gilbertohasn...@googlemail.com>: > Hi all, > > According to the manual, the command necessary to create flat flags (\set > stemLeftBeamCount) is "always equivalent to \once \set. In other words, beam > count settings are not “sticky” [...]". Does this mean that the only way I > can produce a score such as the one below is to use a \set stemLeftBeamCount > for each single pitch? > > Also, does anyone knows how to generate grace notes with a flat flag as > well? (After so many questions of mine on this mailing list, some of you > might be thinking I have some psychotic fixation on grace notes) > > \version "2.17.26" > > { > > \relative c' { > > \set stemLeftBeamCount = #0 f16[] r8. > > \set stemLeftBeamCount = #0 e16[] > > \set stemLeftBeamCount = #0 gis16[] r8 > > \set stemLeftBeamCount = #0 fis[] > > \set stemLeftBeamCount = #0 a32[] r64 > > \set stemLeftBeamCount = #0 f64[] r16 > > \grace{c8} > > \set stemLeftBeamCount = #0 ees8[] r8 > > } > > } > > > If this is too much headache, I will just keep using \override Flag > #'stencil = #modern-straight-flag which is close enough to what I want. > > > Thanks a lot for all the help. Regards, > > Gilberto
Hi Gilberto, modern-straight-flag etc is defined in flag-styles.scm It's a pity that the main definition there uses 'ly:round-filled-polygon'. Setting the points of the polygon to fit a cuboid will result in inclined flags, perhaps a rounding issue. If it would work this way it would be a two-liner to define flat flags. I had to change ly:round-filled-polygon to ly:round-filled-box. Though, now the whole definitions of straight-flag and buildflag have to be present in file: \version "2.17.26" #(define (buildflag flag-stencil remain curr-stencil spacing) (if (> remain 0) (let* ((translated-stencil (ly:stencil-translate-axis curr-stencil spacing Y)) (new-stencil (ly:stencil-add flag-stencil translated-stencil))) (buildflag new-stencil (- remain 1) translated-stencil spacing)) flag-stencil)) #(define-public (straight-flag flag-thickness flag-spacing upflag-angle upflag-length downflag-angle downflag-length) (lambda (grob) (let* ((stem-grob (ly:grob-parent grob X)) (log (ly:grob-property stem-grob 'duration-log)) (dir (ly:grob-property stem-grob 'direction)) (stem-up (eqv? dir UP)) (layout (ly:grob-layout grob)) ;; scale with the note size (e.g. for grace notes) (factor (magstep (ly:grob-property grob 'font-size 0))) (grob-stem-thickness (ly:grob-property stem-grob 'thickness)) (line-thickness (ly:output-def-lookup layout 'line-thickness)) (half-stem-thickness (/ (* grob-stem-thickness line-thickness) 2)) (raw-length (if stem-up upflag-length downflag-length)) (angle (if stem-up upflag-angle downflag-angle)) (flag-length (+ (* raw-length factor) half-stem-thickness)) (flag-end (polar->rectangular flag-length angle)) (thickness (* flag-thickness factor)) (thickness-offset (cons 0 (* -1 thickness dir))) (spacing (* -1 flag-spacing factor dir )) (start (cons (- half-stem-thickness) (* half-stem-thickness dir))) ;; The points of a round-filled-polygon need to be given in clockwise ;; order, otherwise the polygon will be enlarged by blot-size*2! (points (if stem-up (list start flag-end (offset-add flag-end thickness-offset) (offset-add start thickness-offset)) (list start (offset-add start thickness-offset) (offset-add flag-end thickness-offset) flag-end))) ;(stencil (ly:round-filled-polygon points half-stem-thickness)) (stencil (ly:round-filled-box (ordered-cons (caar points) (caaddr points)) (ordered-cons (cdar points) (cdaddr points)) half-stem-thickness)) ;; Log for 1/8 is 3, so we need to subtract 3 (flag-stencil (buildflag stencil (- log 3) stencil spacing)) (stroke-style (ly:grob-property grob 'stroke-style))) (if (equal? stroke-style "grace") (add-stroke-straight flag-stencil grob dir log stroke-style flag-end flag-length thickness (* half-stem-thickness 2)) flag-stencil)))) #(define-public (flat-flag grob) ((straight-flag 0.41 0.8 0 1.0 0 1.0) grob)) \version "2.17.26" { \relative c' { \autoBeamOff \override Flag.stencil = #flat-flag f16 r8. e16 gis16 r8 fis a32 r64 f64 r16 \grace{c8} ees8 r8 } } HTH, Harm _______________________________________________ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user