1 ;;; paper.scm -- scm paper variables and functions
3 ;;; source file of the GNU LilyPond music typesetter
5 ;;; (c) 1999 Jan Nieuwenhuizen <janneke@gnu.org>
7 ;;; All dimensions are measured in staff-spaces
11 ;; Beams should be prevented to conflict with the stafflines,
12 ;; especially at small slopes
13 ;; ----------------------------------------------------------
17 ;; --------------########------------------------------------
20 ;; hang straddle sit inter hang
22 ;; inter seems to be a modern quirk, we don't use that
24 (define beam-normal-dy-quants
25 '(0 (/2 (+ beam-thickness staff-line) 2) (+ beam-thickness staff-line) 1))
27 ;; two popular veritcal beam quantings
28 ;; see params.ly: #'beam-vertical-quants
29 (define (beam-normal-y-quants multiplicity dy)
30 (let ((quants `(,beam-hang 1)))
31 (if (or (<= multiplicity 1) (>= (abs dy) (/ staff-line 2)))
32 (set! quants (cons beam-sit quants)))
33 (if (or (<= multiplicity 2) (>= (abs dy) (/ staff-line 2)))
34 (set! quants (cons beam-straddle quants)))
37 (define (beam-traditional-y-quants multiplicity dy)
39 (if (>= dy (/ staff-line -2))
40 (set! quants (cons beam-hang quants)))
41 (if (and (<= multiplicity 1) (<= dy (/ staff-line 2)))
42 (set! quants (cons beam-sit quants)))
43 (if (or (<= multiplicity 2) (>= (abs dy) (/ staff-line 2)))
44 (set! quants (cons beam-straddle quants)))
48 ;;; Default variables and settings
50 (define staff-line 0.10)
51 (define beam-thickness (* 0.52 (- 1 staff-line)))
52 (define beam-straddle 0)
53 (define beam-sit (/ (+ beam-thickness staff-line) 2))
54 (define beam-hang (- 1 (/ (- beam-thickness staff-line) 2)))
56 (define beam-height-quants beam-normal-dy-quants)
57 (define beam-vertical-position-quants beam-normal-y-quants)
60 ;; array index flag-2 (what a name!!), last if index>size
62 (define stem-length '(3.5 3.5 3.5 4.5 5.0))
63 (define grace-length-factor 0.8)
64 (define grace-stem-length
65 (map (lambda (x) (* grace-length-factor x)) stem-length))
67 ;; array index multiplicity, last if index>size
69 (define beamed-stem-shorten '(0.5))
70 (define beamed-stem-length '(0.0 2.5 2.0 1.5))
71 (define beamed-stem-minimum-length '(0.0 3.0 2.5 2.0))
72 (define grace-beamed-stem-minimum-length
73 (map (lambda (x) (* grace-length-factor x)) beamed-stem-minimum-length))
75 ;; Stems in unnatural (forced) direction should be shortened,
76 ;; according to [Roush & Gourlay]. Their suggestion to knock off
77 ;; a whole staffspace seems a bit drastical: we'll do half.
80 ;; - take #forced stems into account (now done in C++)?
81 ;; - take y-position of chord or beam into account
83 (define stem-shorten '(0.5))
84 (define grace-stem-shorten '(0.0))