]> git.donarmstrong.com Git - lilypond.git/blob - ly/grace-init.ly
* lily/dynamic-engraver.cc (process_music): take dynamic direction
[lilypond.git] / ly / grace-init.ly
1 \version "1.5.68"
2
3 startGraceMusic = {
4     \property Voice.Stem \override  #'direction = #1
5     \property Voice.Stem \override #'length = #5.5
6     \property Voice.Stem \override #'lengths = 
7         #(map (lambda (x) (* 0.8 x)) '(3.5 3.5 3.5 4.5 5.0))
8     \property Voice.Stem \override #'beamed-lengths =
9         #(map (lambda (x) (* 0.8 x)) '(3.26))
10     \property Voice.Stem \override #'beamed-minimum-free-lengths =
11         #(map (lambda (x) (* 0.8 x)) '(2.5 2.0 1.5))
12     \property Voice.Stem \override #'beamed-extreme-minimum-free-lengths =
13         #(map (lambda (x) (* 0.8 x)) '(1.83 1.5))
14
15     \property Voice.Stem \override #'no-stem-extend = ##t
16     \property Voice.Stem \override #'stroke-style  = #"grace"
17     \property Voice.Beam \override #'thickness = #0.384
18
19     %% Instead of calling Beam::space_function, we should invoke
20     %% the previously active beam function...
21     \property Voice.Beam \override #'space-function =
22       #(lambda (beam mult) (* 0.8 (Beam::space_function beam mult)))
23
24     \property Voice.Beam \override #'position-callbacks =
25       #`(,Beam::least_squares
26          ,Beam::check_concave
27          ,Beam::slope_damping)
28     
29     % Can't use Staff.fontSize, since time sigs, keys sigs, etc. will
30     % be smaller as well.
31
32     \property Voice.fontSize = #-2
33     \property Staff.Accidental \override #'font-relative-size = #-2
34     \property Voice.Slur \override #'direction = #-1
35 }
36
37 stopGraceMusic = {
38     \property Voice.Slur \revert #'direction
39     \property Staff.Accidental \revert #'font-relative-size
40     \property Voice.Beam \revert #'thickness
41
42     \property Voice.Stem \revert #'stroke-style
43     \property Voice.Stem \revert #'no-stem-extend
44     \property Voice.Stem \revert #'beamed-lengths
45     \property Voice.Stem \revert #'beamed-minimum-free-lengths
46     \property Voice.Stem \revert #'beamed-extreme-minimum-free-lengths
47     \property Voice.Stem \revert #'lengths    
48     \property Voice.Stem \revert #'length
49     \property Voice.Stem \revert #'direction    
50     \property Voice.Beam \revert #'space-function
51     
52     \property Voice.Beam \revert #'position-callbacks
53     
54     % Can't use Staff.fontSize, since time sigs, keys sigs, etc. will
55     % be smaller as well.
56
57     \property Voice.fontSize \unset
58 }
59
60 #(define (add-to-grace-init context object prop val)
61    " Override context.object #'property before entering grace context,
62 and restore afterwards. Use this to add settings to default grace notes.
63 "
64    (set! stopGraceMusic
65     (make-sequential-music
66      (cons
67       (context-spec-music  (make-grob-property-revert object prop) context)
68       (ly-get-mus-property stopGraceMusic 'elements)
69      )))
70    (set! startGraceMusic
71     (make-sequential-music
72      (append
73       (ly-get-mus-property startGraceMusic 'elements)
74       (list (context-spec-music  (make-grob-property-set object prop val) context))
75       )
76      )))
77    
78