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
10 ;; - make easily customisable from mudela
11 ;; - take #forced stems into account (now done in C++)
12 ;; - take y-position of chord or beam into account
13 (define (stem-shorten flags) 0.5)
14 (define (beamed-stem-shorten multiplicity) 0.5)
17 ;; Beams should be prevented to conflict with the stafflines,
18 ;; especially at small slopes
19 ;; ----------------------------------------------------------
23 ;; --------------########------------------------------------
26 ;; hang straddle sit inter hang
28 ;; inter seems to be a modern quirk, we don't use that
30 (define beam-normal-dy-quants
31 '(0 (/2 (+ beam-thickness staff-line) 2) (+ beam-thickness staff-line) 1))
33 ;; two popular veritcal beam quantings
34 ;; see params.ly: #'beam-vertical-quants
35 (define (beam-normal-y-quants multiplicity dy)
36 (let ((quants `(,beam-hang 1)))
37 (if (or (<= multiplicity 1) (>= (abs dy) (/ staff-line 2)))
38 (set! quants (cons beam-sit quants)))
39 (if (or (<= multiplicity 2) (>= (abs dy) (/ staff-line 2)))
40 (set! quants (cons beam-straddle quants)))
43 (define (beam-traditional-y-quants multiplicity dy)
45 (if (>= dy (/ staff-line -2))
46 (set! quants (cons beam-hang quants)))
47 (if (and (<= multiplicity 1) (<= dy (/ staff-line 2)))
48 (set! quants (cons beam-sit quants)))
49 (if (or (<= multiplicity 2) (>= (abs dy) (/ staff-line 2)))
50 (set! quants (cons beam-straddle quants)))
54 ;;; Default variables and settings
56 (define staff-line 0.10)
57 (define beam-thickness (* 0.52 (- 1 staff-line)))
58 (define beam-straddle 0)
59 (define beam-sit (/ (+ beam-thickness staff-line) 2))
60 (define beam-hang (- 1 (/ (- beam-thickness staff-line) 2)))
62 (define beam-height-quants beam-normal-dy-quants)
63 (define beam-vertical-position-quants beam-normal-y-quants)