]> git.donarmstrong.com Git - lilypond.git/blob - input/test/move-accidentals.ly
469ea32ee945051cdb8d08e32e606f8c4dcf6bdb
[lilypond.git] / input / test / move-accidentals.ly
1 \version "2.1.26"
2
3 % possible rename to scheme- or something like that.  -gp
4 \header { texidoc= "@cindex Scheme Manual Accidentals
5 The positions of accidentals may be manually set by incorporating
6 some Scheme code. " }
7
8 #(define (make-acc-position-checker pos)
9   (lambda (elt)
10    (and
11       (not (eq? #f (memq 'accidental-interface
12                     (ly:grob-property elt 'interfaces))))
13       (eq? (ly:grob-property
14             (ly:grob-parent elt 1) 'staff-position) pos))))
15
16 \score {
17   \context Voice \notes \relative c'' {
18     c2.
19     <<
20 \set Staff.AccidentalPlacement = \turnOff
21 \context Staff \applyoutput #(outputproperty-compatibility (make-acc-position-checker 9)
22                                'extra-offset  '(-1 . 0))
23 \context Staff \applyoutput #(outputproperty-compatibility (make-acc-position-checker 5)
24                                'extra-offset  '(-2 . 0))
25 \context Staff \applyoutput #(outputproperty-compatibility (make-acc-position-checker 3)
26                                'extra-offset  '(-3 . 0))
27 \context Staff \applyoutput #(outputproperty-compatibility (make-acc-position-checker 2)
28                                'extra-offset  '(-4 . 0))
29       d!4
30       eis
31       gis
32       d'!
33     >>
34   }
35   \paper {
36     raggedright = ##t
37   }
38 }
39