]> git.donarmstrong.com Git - lilypond.git/blob - input/regression/accidental-octave.ly
* buildscripts/mf-to-table.py (base): break table every three
[lilypond.git] / input / regression / accidental-octave.ly
1
2 \version "1.7.18"
3
4 \header {
5 texidoc="
6 This shows how accidentals in different octaves are handled.
7 FIXME: Shorten and docu
8
9 "
10
11
12 }
13
14 #(define  (lo-octave p)
15   (let* ((a (ly:pitch-alteration p))
16          (n (ly:pitch-notename p)))
17     (ly:make-pitch -1 n a)))
18
19 #(define (no-octaves music)
20   (let* ((es (ly:get-mus-property music 'elements))
21          (e (ly:get-mus-property music 'element))
22          (p (ly:get-mus-property music 'pitch)))
23
24     (if (pair? es)
25         (ly:set-mus-property!
26          music 'elements
27          (map no-octaves es)))
28
29     (if (ly:music? e)
30         (ly:set-mus-property!
31          music 'element
32          (no-octaves e)))
33
34     (if (ly:pitch? p)
35         (begin
36           (set! p (lo-octave p))
37           (ly:set-mus-property! music 'pitch p)))
38
39
40     music))
41
42
43
44 mel = \notes \transpose c c' {
45   \time 4/4 \key d \major
46   gis4 g' g gis' | gis2 g' | g1 | gis | g | gis' | g |
47   fis4 f' f fis' | fis2 f' | f1 | fis | f | fis' | f |
48   \bar "|." \break
49 }
50
51 mus = \notes {
52    \mel
53
54 %% FIXME.
55 %   \property Score.oneMeasureLazy = ##t
56
57
58    \property Score.autoAccidentals = #'(Staff (same-octave . 0))
59    < s1^""^""^"$\\backslash$property Score.autoAccidentals = \\#'(Staff (same-octave . 0))" \mel >
60    \property Score.autoAccidentals = #'(Staff (same-octave . 1))
61    < s1^""^""^"$\\backslash$property Score.autoAccidentals = \\#'(Staff (same-octave . 1))" \mel >
62    \property Score.autoAccidentals = #'(Staff (any-octave . 0))
63    < s1^""^""^"$\\backslash$property Score.autoAccidentals = \\#'(Staff (any-octave . 0))" \mel >
64    \property Score.autoAccidentals = #'(Staff (any-octave . 1))
65    < s1^""^""^"$\\backslash$property Score.autoAccidentals = \\#'(Staff (any-octave . 1))" \mel >
66    \modernAccidentals
67    < s1^""^""^"$\\backslash$modernAccidentals" \mel >
68    \modernCautionaries
69    < s1^""^""^"$\\backslash$modernCautionaries" \mel >
70    \noResetKey
71    < s1^""^""^"$\\backslash$noResetKey" \mel >
72    \forgetAccidentals
73    < s1^""^""^"$\\backslash$forgetAccidentals" \mel >
74 }
75
76
77 \score {
78   < \context Staff \mus
79     \context NoteNames \apply #no-octaves \mus
80   >
81   \paper {
82     indent=0.0
83   }
84 }
85