]> git.donarmstrong.com Git - lilypond.git/blob - input/test/improv.ly
* scripts/convert-ly.py (FatalConversionError.subst_in_trans):
[lilypond.git] / input / test / improv.ly
1 \version "2.1.23"
2 \header {
3
4     texidoc =
5 "
6
7 In improvisation, noteheads do not have a pitch, and have different
8 shapes. In this example, this is achieved by adding
9 @code{Pitch_squash_engraver} and setting @code{squashedPosition} when the
10 improvisation is active.
11
12 "
13
14 }
15
16
17 improOn = \notes {
18     \set squashedPosition = #0
19     \override NoteHead  #'style = #'slash
20 }
21
22 improOff = \notes {
23     \unset squashedPosition 
24     \revert NoteHead #'style
25 }
26
27 global = \notes { s1*3 \bar "|." }
28
29 \score {
30     <<
31         \context ChordNames \chords {
32             e8*7:m7 a2.:m7 bes4:m7 b1:m7 e8:m
33         }
34         \notes <<
35             \context Voice = melo \transpose c c' {
36                 e8 e g a a16(bes)(a8) g \improOn
37                 e8
38                 ~e2~e8 f4 fis8
39                 ~fis2 \improOff a16(bes) a8 g e
40             }
41         >>
42     >>
43     \paper { 
44         \translator {
45             \VoiceContext
46             \consists Pitch_squash_engraver
47         }
48         raggedright = ##t
49     }
50 }
51