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