]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/snippets/score-for-diatonic-accordion.ly
fddf7c230b014720c8a6fbc924b7ae8630775274
[lilypond.git] / Documentation / snippets / score-for-diatonic-accordion.ly
1 %% DO NOT EDIT this file manually; it is automatically
2 %% generated from LSR http://lsr.di.unimi.it
3 %% Make any changes in LSR itself, or in Documentation/snippets/new/ ,
4 %% and then run scripts/auxiliar/makelsr.py
5 %%
6 %% This file is in the public domain.
7 \version "2.19.22"
8
9 \header {
10   lsrtags = "real-music, specific-notation, template"
11
12   texidoc = "
13 A template to write a score for a diatonic accordion.
14
15 - There is a horizontal staff indicating if the accordion must be
16 pushed (thick line) or pulled (thin line)
17
18 - There is a small rhythmic staff with lyrics that describes the bass
19 buttons to press. The bar lines are made from gridlines
20
21 - The tabulator staff for diatonic accordions shows the geographic
22 position of the buttons and not (as for every other instrument) the
23 pitch of the notes; the keys on the melody-side of the accordion are
24 placed in three columns and about 12 rows
25
26
27 In the tabulator staff notation the outermost column is described with
28 notes between lines, the innermost column is described with notes
29 between lines and a cross as accidental, and the middle column is
30 described with notes on a line, whereby the row in the middle is
31 represented on the middle line in the staff.
32
33
34 Some words to transpose piano notes to the diatonic accordion:
35
36
37 1. Every diatonic accordion is built for some keys only (for example,
38 for the keys of C major and F major), so it is important to transpose a
39 piano melody to match one of these keys. Transpose the source code, not
40 only the output because this code is required later on to translate it
41 once more to the tabulator staff. This can be done with the command
42 @code{displayLilyMusic}.
43
44
45 2. You have to alternate the push- and pull-direction of the accordion
46 regularly. If the player has a too long part to pull the accordion gets
47 broken. On the other hand, some harmonies are only available in one
48 direction. Considering this, decide which parts of the melody are the
49 push-parts and which the pull-parts.
50
51
52 3. For each pull- or push-part translate the piano notes to the
53 according tabulature representation.
54
55 "
56   doctitle = "Score for diatonic accordion"
57 } % begin verbatim
58
59 verse = \lyricmode { Wie gross bist du! Wie gross bist du! }
60
61 harmonies = \new ChordNames \chordmode {
62   \germanChords
63   \set chordChanges = ##t
64   bes8 bes8 bes8
65   es2 f
66   bes1
67 }
68
69 NoStem = { \hide Stem }
70 NoNoteHead = \hide NoteHead
71 ZeroBeam = \override Beam.positions = #'(0 . 0)
72
73 staffTabLine = \new Staff \with {
74   \remove "Time_signature_engraver"
75   \remove "Clef_engraver"
76 } {
77   \override Staff.StaffSymbol.line-positions = #'(0)
78   % Shows one horizontal line. The vertical line
79   %  (simulating a bar-line) is simulated with a gridline
80   \set Staff.midiInstrument = #"choir aahs"
81   \key c \major
82   \relative c''
83   {
84     % disable the following line to see the the noteheads while writing the song
85     \NoNoteHead
86     \override NoteHead.no-ledgers = ##t
87
88     % The beam between 8th-notes is used to draw the push-line
89     %How to fast write the push-lines:
90     %  1. write repeatedly 'c c c c c c c c |' for the whole length of the song
91     %  2. uncomment the line \NoNoteHead
92     %  3. compile
93     %  4. Mark the positions on which push/pull changes.
94     %     In the score-picture click on the position
95     %        the push- or pull-part starts
96     %           (on the noteHead, the cursor will change to a hand-icon).
97     %     The cursor in the source code will jump just at this position.
98     %   a) If a push-part starts there, replace the 'c' by an 'e['
99     %   b) If a pull-part starts there, replace the 'c' by an 's'
100     %  5. Switch into 'overwrite-mode' by pressing the 'ins' key.
101     %  6. For the pull-parts overwrite the 'c' with 's'
102     %  7. For every push-part replace the last 'c' with 'e]'
103     %        8. Switch into 'insert-mode' again
104     %  9. At last it should look like e.g.
105     %        (s s e[ c | c c c c c c c c | c c c c c c e] s s)
106     % 10. re-enable the line \NoNoteHead
107     \autoBeamOff
108     \ZeroBeam
109     s8 s s e[ c c c c c c e] | s s s s s
110   }
111 }
112
113 % Accordion melody in tabulator score
114 % 1. Place a copy of the piano melody below
115 % 2. Separate piano melody into pull- and push-parts
116 %      according to the staffTabLine you've already made
117 % 3. For each line: Double the line. Remark the 1st one
118 %      (Keeps unchanged as reference) and then change the second
119 %      line using the transformation paper
120 %    or the macros 'conv2diaton push.bsh' and 'conv2diaton pull.bsh'
121 % Tips:
122 % - In jEdit Search & Replace mark the Option 'Keep Dialog'
123
124 AccordionTabTwoCBesDur = {
125   % pull 1
126   %<f' bes'>8 <f' a'>8 <d' bes'>8 |
127   <g'' a''>8 <g'' b''>8 <e'' a''>8 |
128   % push 2
129   %<g' c''>4 <f' d''> <g' ees''> <f' a'> |
130   <g'' a''>4 <d'' eisis''> <g'' bisis''> <d'' f''> |
131   % pull 3
132   % <f' bes'>2 r8 }
133   <g'' a''>2 r8 }
134
135 AccordionTab= { \dynamicUp
136   % 1. Place a copy of the piano melody above
137   % 2. Separate piano melody into pull- and push-parts
138   %      according to the staffTabLine you've already made
139   % 3. For each line: Double the line. Remark the 1st one
140   %      (Keeps unchanged as reference) and then
141   %      change the second line using the transformation paper
142   % Tips:
143   % - In jEdit Search & Replace mark the Option 'Keep Dialog'
144   % -
145   \AccordionTabTwoCBesDur
146 }
147
148
149
150 \layout {
151   \context {
152     \Score
153     % The vertical line (simulating a bar-line) in
154     % the staffBassRhytm is a gridline
155     \consists "Grid_line_span_engraver"
156   }
157   \context {
158     \Staff
159     \consists "Grid_point_engraver"
160     gridInterval = #(ly:make-moment 4/4) % 4/4 - tact. How many beats per bar
161     % The following line has to be adjusted O-F-T-E-N.
162     \override GridPoint.Y-extent = #'(-2 . -21)
163   }
164   \context {
165     \ChoirStaff
166     \remove "System_start_delimiter_engraver"
167   }
168 }
169
170 staffVoice = \new Staff = astaffvoice  {
171   \time 4/4
172   \set Staff.instrumentName = "Voice"
173   \set Staff.midiInstrument = "voice oohs"
174   \key bes \major
175   \partial 8*3
176   \clef treble
177   {
178     \context Voice = "melodyVoi"
179     {
180       <f' bes'>8 <f' a'>8 <d' bes'>8 |
181       <g' c''>4 <f' d''> <g' es''> <f' a'> |
182       <f' bes'>2 r8
183     }
184     \bar "|."
185   }
186 }
187
188 staffAccordionMel =
189 \new Staff  \with { \remove "Clef_engraver" } {
190   \accidentalStyle forget %Set the accidentals (Vorzeichen) for each note,
191   %do not remember them for the rest of the measure.
192   \time 4/4
193   \set Staff.instrumentName="Accordion"
194   \set Staff.midiInstrument="voice oohs"
195   \key c \major
196   \clef treble
197   { \AccordionTab \bar "|." }
198 }
199
200 AltOn =
201 #(define-music-function (mag) (number?)
202   #{ \override Stem.length = #(* 7.0 mag)
203       \override NoteHead.font-size =
204 #(inexact->exact (* (/ 6.0 (log 2.0)) (log mag))) #})
205
206 AltOff = {
207   \revert Stem.length
208   \revert NoteHead.font-size
209 }
210
211 BassRhytm = {s4 s8 | c2 c2 | c2 s8 }
212 LyricBassRhythmI=  \lyricmode { c b | c }
213
214 staffBassRhytm =
215 \new Staff = staffbass \with { \remove "Clef_engraver" } {
216   % This is not a RhythmicStaff  because it must be possible to append lyrics.
217
218   \override Score.GridLine.extra-offset = #'( 13.0 . 0.0 ) % x.y
219   \override Staff.StaffSymbol.line-positions = #'( 0 )
220   % Shows one horizontal line. The vertical line
221   %  (simulating a bar-line) is simulated by a grid
222   % Search for 'grid' in this page to find all related functions
223   \time 4/4
224   {
225     \context Voice = "VoiceBassRhytm"
226     \stemDown \AltOn #0.6
227     \relative c''
228     {
229       \BassRhytm
230     }
231     \AltOff
232     \bar "|."
233   }
234 }
235
236 \score {
237   \new ChoirStaff <<
238     \harmonies
239     \staffVoice
240     \context Lyrics = "lmelodyVoi"
241       \with { alignBelowContext = astaffvoice }
242       \lyricsto melodyVoi \verse
243     \staffAccordionMel
244     \staffTabLine
245     \staffBassRhytm
246     \context Lyrics = "lBassRhytmAboveI"
247       \with { alignAboveContext = staffbass }
248       \lyricsto VoiceBassRhytm \LyricBassRhythmI
249   >>
250 }