]> git.donarmstrong.com Git - lilypond.git/blob - input/regression/accidental-octave.ly
*** empty log message ***
[lilypond.git] / input / regression / accidental-octave.ly
1
2 \version "2.1.22"
3
4 \header {
5 texidoc="
6 This shows how accidentals in different octaves are handled.
7 (DOCME)
8 "
9
10
11 }
12
13 #(define  (lo-octave p)
14   (let* ((a (ly:pitch-alteration p))
15          (n (ly:pitch-notename p)))
16     (ly:make-pitch -1 n a)))
17
18 #(define (no-octaves music)
19   (let* ((es (ly:get-mus-property music 'elements))
20          (e (ly:get-mus-property music 'element))
21          (p (ly:get-mus-property music 'pitch)))
22
23     (if (pair? es)
24         (ly:set-mus-property!
25          music 'elements
26          (map no-octaves es)))
27
28     (if (ly:music? e)
29         (ly:set-mus-property!
30          music 'element
31          (no-octaves e)))
32
33     (if (ly:pitch? p)
34         (begin
35           (set! p (lo-octave p))
36           (ly:set-mus-property! music 'pitch p)))
37
38
39     music))
40
41
42
43 mel = \notes \transpose c c' {
44   \time 4/4 \key d \major
45   gis4 g' g gis' | gis2 g' | g1 | gis | g | gis' | g |
46   fis4 f' f fis' | fis2 f' | f1 | fis | f | fis' | f |
47   \bar "|." \break
48 }
49
50 \score {
51   << \context Staff \mel
52      \context NoteNames \apply #no-octaves \mel
53   >>
54 }
55