% test notes, which will be shown in different styles:
-testnotes = { \autoBeamOff c'8 d'16 c'32 d'64 \acciaccatura {c'8} d'64
+testnotes = { \autoBeamOff c'8 d'16 c'32 d'64 \acciaccatura {c'8} d'64
c''8 d''16 c''32 d''64 \acciaccatura {\stemDown c''8 \stemNeutral} d''64 }
{
\mark "old straight (large angles)"
\override Flag.stencil = #old-straight-flag
\testnotes
+
+ \mark "flat"
+ \override Flag.stencil = #flat-flag
+ \testnotes
%
% \mark "custom slant"
-% % Custom straight flag. The parameters are:
+% % Custom straight flag. The parameters are:
% % flag thickness and spacing
% % up-flag angle and length
% % down-flag angle and length
\show-note-styles #'(default)
}
}
+
+\markup {
+ \column {
+ \combine \null \vspace #1
+ \underline "Flat-flag:"
+ \override #'(flag-style . flat-flag)
+ \show-note-styles #'(default)
+ }
+}
\override #'(style . mensural) \mrkp
\override #'(flag-style . modern-straight-flag) \mrkp
\override #'(flag-style . old-straight-flag) \mrkp
+ \override #'(flag-style . flat-flag) \mrkp
}
}
\override NoteHead.style = #'triangle
Construct a note symbol, with stem and flag. By using fractional values for
@var{dir}, longer or shorter stems can be obtained.
Supports all note-head-styles.
-Supported flag-styles are @code{default}, @code{old-straight-flag} and
-@code{modern-straight-flag}.
+Supported flag-styles are @code{default}, @code{old-straight-flag},
+@code{modern-straight-flag} and @code{flat-flag}.
@lilypond[verbatim,quote]
\\markup {
(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))
+ (flag-end (if (= angle 0)
+ (cons flag-length (* half-stem-thickness dir))
+ (polar->rectangular flag-length angle)))
(thickness (* flag-thickness factor))
(thickness-offset (cons 0 (* -1 thickness dir)))
(spacing (* -1 flag-spacing factor 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))
+ (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)
;; Straight-flags. Values taken from /scm/flag-style.scm
(modern-straight-flag (straight-flag-mrkp 0.55 1 -18 1.1 22 1.2 dir))
(old-straight-flag (straight-flag-mrkp 0.55 1 -45 1.2 45 1.4 dir))
+ (flat-flag (straight-flag-mrkp 0.55 1.0 0 1.0 0 1.0 dir))
;; Calculate a corrective to avoid a gap between
;; straight-flags and the stem.
(flag-style-Y-corr (if (or (eq? flag-style 'modern-straight-flag)
- (eq? flag-style 'old-straight-flag))
+ (eq? flag-style 'old-straight-flag)
+ (eq? flag-style 'flat-flag))
(/ blot 10 (* -1 dir))
0))
(flaggl (and (> log 2)
modern-straight-flag)
((eq? flag-style 'old-straight-flag)
old-straight-flag)
+ ((eq? flag-style 'flat-flag)
+ flat-flag)
(else
(ly:font-get-glyph font
(format #f (if ancient-flags?
;;;; along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
;;;; This file implements different flag styles in Scheme / GUILE, most
-;;;; notably the old-straight-flag and the modern-straight-flag styles.
+;;;; notably the old-straight-flag, the modern-straight-flag and the flat-flag
+;;;; styles.
(define-public (no-flag grob)
(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))
+ ;; For flat flags the points to create the stencil using
+ ;; ly:round-filled-polygon need to be different concerning flag-end
+ (flag-end (if (= angle 0)
+ (cons flag-length (* half-stem-thickness dir))
+ (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))
+ (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)
flags are both 45 degrees."
((straight-flag 0.55 1 -45 1.2 45 1.4) grob))
+(define-public (flat-flag grob)
+ "Flat flag style. The angles of the flags are both 0 degrees"
+ ((straight-flag 0.55 1.0 0 1.0 0 1.0) grob))
+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; Flags created from feta glyphs (normal and mensural flags)