]> git.donarmstrong.com Git - lilypond.git/blob - scm/basic-properties.scm
469cc1e3fea762aa7a3c828f15bc9f389731fd58
[lilypond.git] / scm / basic-properties.scm
1 ; Definition of backend properties (aka. element properties).
2
3 ;; See documentation of Item::visibility_lambda_
4 (define (begin-of-line-visible d) (if (= d 1) '(#f . #f) '(#t . #t)))
5 (define (spanbar-begin-of-line-invisible d) (if (= d -1) '(#t . #t) '(#f . #f)))
6 (define (all-visible d) '(#f . #f))
7 (define (all-invisible d) '(#t . #t))
8 (define (begin-of-line-invisible d) (if (= d 1) '(#t . #t) '(#f . #f)))
9 (define (end-of-line-invisible d) (if (= d -1) '(#t . #t) '(#f . #f)))
10
11
12 (define mark-visibility end-of-line-invisible)
13
14 ; ugh: should calculate from beam-thickness.
15 ; result in staff-space
16
17 ;beam_thickness = 0.52 * (\staffspace - \stafflinethickness);
18 ;interbeam = (2.0 * \staffspace + \stafflinethickness - \beam_thickness) / 2.0;
19 ;interbeam4 = (3.0 * \staffspace - \beam_thickness) / 3.0;
20
21
22 (define (default-beam-space-function multiplicity)
23   (if (<= multiplicity 3) 0.816 0.844)
24   )
25
26 ;
27 ; width in staff space.
28 ;
29 (define (default-beam-flag-width-function type)
30   (cond
31    ((eq? type 1) 1.98)
32    ((eq? type 1) 1.65)
33    (else 1.32)
34    ))
35
36
37 (define basic-beam-properties
38   `(
39     (interfaces . (beam-interface))
40     (molecule-callback . ,Beam::brew_molecule)
41     (beam-thickness . 0.42) ; staff-space, should use stafflinethick?
42     (before-line-breaking-callback . ,Beam::before_line_breaking)
43     (after-line-breaking-callback . ,Beam::after_line_breaking)
44     (default-neutral-direction . 1)
45     (outer-stem-length-limit . 0.2)
46     (slope-limit . 0.2)
47     (beam-flag-width-function . ,default-beam-flag-width-function)
48     (beam-space-function . ,default-beam-space-function)
49     (damping . 1)
50     (name . "beam")             
51     )
52   )