Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > ffe16b32b9f5eec0add70c0a6bc8cec8 > files > 814

lilypond-doc-2.12.2-3mdv2009.1.i586.rpm

%% Generated by lilypond-book.py
%% Options: [quote,alt=[image of music],indent=0\mm]
\include "lilypond-book-preamble.ly"


% ****************************************************************
% Start cut-&-pastable-section
% ****************************************************************



\paper {
  #(define dump-extents #t)
  
  line-width = 5\in - 2.0 * 0.4\in
  indent = 0\mm
  force-assignment = #""
  line-width = #(- line-width (* mm  3.000000))
}

\layout {
  
}



% ****************************************************************
% ly snippet:
% ****************************************************************
\sourcefileline 220
testnotes = {
  \autoBeamOff
  c'8 d'16 c''8 d''16
}

#(define (inverted-flag stem-grob)
  (let* ((dir (if (eqv? (ly:grob-property stem-grob 'direction) UP) "d" "u"))
         (flag (retrieve-glyph-flag "" dir "" stem-grob))
         (line-thickness (ly:staff-symbol-line-thickness stem-grob))
         (stem-thickness (ly:grob-property stem-grob 'thickness))
         (stem-width (* line-thickness stem-thickness))
         (stroke-style (ly:grob-property stem-grob 'stroke-style))
         (stencil (if (null? stroke-style) flag
                         (add-stroke-glyph flag stem-grob dir stroke-style "")))
                         (rotated-flag (ly:stencil-rotate-absolute stencil 180 0 0)))
    (ly:stencil-translate rotated-flag (cons (- (/ stem-width 2))  0))))

#(define-public (weight-flag stem-grob)
  (let* ((log (- (ly:grob-property stem-grob 'duration-log) 2))
         (is-up (eqv? (ly:grob-property stem-grob 'direction) UP))
         (yext (if is-up (cons (* log -0.8) 0) (cons 0 (* log 0.8))))
         (flag-stencil (make-filled-box-stencil '(-0.4 . 0.4) yext))
         (stroke-style (ly:grob-property stem-grob 'stroke-style))
         (stroke-stencil (if (equal? stroke-style "grace")
             (make-line-stencil 0.2 -0.9 -0.4 0.9 -0.4)
             empty-stencil)))
    (ly:stencil-add flag-stencil stroke-stencil)))

{
  \time 3/8
  \override Stem #'flag = #weight-flag
  \testnotes

  \override Stem #'flag = #inverted-flag
  \testnotes
}



% ****************************************************************
% end ly snippet
% ****************************************************************