]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/snippets/adding-orchestral-cues-to-a-vocal-score.ly
Merge branch 'master' into lilypond/translation
[lilypond.git] / Documentation / snippets / adding-orchestral-cues-to-a-vocal-score.ly
1 % Do not edit this file; it is automatically
2 % generated from Documentation/snippets/new
3 % This file is in the public domain.
4 %% Note: this file works from version 2.13.34
5 \version "2.13.34"
6
7 \header {
8   lsrtags="vocal-music, staff-notation"
9   texidoc="
10   This shows one approach to simplify adding many orchestral cues to
11 the piano reduction in a vocal score.  The music function
12 @code{\\cueWhile} takes four arguments: the music from which the cue
13 is to be taken, as defined by @code{\\addQuote}, the name to be
14 inserted before the cue notes, then either @code{#UP} or @code{#DOWN}
15 to specify either @code{\\voiceOne} with the name above the staff or
16 @code{\\voiceTwo} with the name below the staff, and finally the piano
17 music in parallel with which the cue notes are to appear.  The name
18 of the cued instrument is positioned to the left of the cued notes.
19 Many passages can be cued, but they cannot overlap each other in time.
20 "
21   doctitle = "Adding orchestral cues to a vocal score"
22 } % begin verbatim
23
24
25 cueWhile =
26   #(define-music-function
27     (parser location instrument name dir music)
28     (string? string? ly:dir? ly:music?)
29     #{
30       \cueDuring $instrument #$dir {
31         \once \override CueVoice.InstrumentSwitch #'self-alignment-X = #RIGHT
32         \once \override CueVoice.InstrumentSwitch #'direction = $dir
33         \set CueVoice.instrumentCueName = $name
34         { $music }
35       }
36     #}
37   )
38
39 flute = \relative c'' {
40   \transposition c'
41   s4 s4 e g
42 }
43 \addQuote "flute" { \flute }
44
45 clarinet = \relative c' {
46   \transposition bes
47   fis4 d d c
48 }
49 \addQuote "clarinet" { \clarinet }
50
51 singer = \relative c'' { c4. g8 g4 bes4 }
52 words = \lyricmode { here's the lyr -- ics }
53
54 pianoRH = \relative c'' {
55   \transposition c'
56   \cueWhile "clarinet" "Clar." #DOWN { c4. g8 }
57   \cueWhile "flute" "Flute" #UP { g4 bes4 }
58 }
59 pianoLH = \relative c { c4 <c' e> e, <g c> }
60
61 \score {
62   <<
63     \new Staff {
64       \new Voice = "singer" {
65         \singer
66       }
67     }
68     \new Lyrics {
69       \lyricsto "singer"
70       \words
71     }
72     \new PianoStaff <<
73       \new Staff {
74         \new Voice {
75           \pianoRH
76         }
77       }
78       \new Staff {
79         \clef "bass"
80         \pianoLH
81       }
82     >>
83   >>
84 }