]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/snippets/score-for-diatonic-accordion.ly
Docs: run convert-ly for 2.14.0.
[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.dsi.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.14.0"
8
9 \header {
10   lsrtags = "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 This snippet comes with a useful optional macro for the jEdit text
57 editor.
58
59 "
60   doctitle = "Score for diatonic accordion"
61 } % begin verbatim
62
63 verse = \lyricmode { Wie gross bist du! Wie gross bist du! }
64
65 harmonies = \new ChordNames \chordmode {
66   \germanChords
67   \set chordChanges = ##t
68   bes8 bes8 bes8
69   es2 f
70   bes1
71 }
72
73 NoStem = \override Stem #'transparent = ##t
74 NoNoteHead = \override NoteHead #'transparent = ##t
75 ZeroBeam = \override Beam  #'positions = #'(0 . 0)
76
77 staffTabLine = \new Staff \with {
78   \remove "Time_signature_engraver"
79   \remove "Clef_engraver"
80 } {
81   \override Staff.StaffSymbol #'line-positions = #'(0)
82   % Shows one horizontal line. The vertical line (simulating a bar-line) is simulated with a gridline
83   \set Staff.midiInstrument = #"choir aahs"
84   \key c \major
85   \relative c''
86   {
87     % disable the following line to see the the noteheads while writing the song
88     \NoNoteHead
89     \override NoteHead #'no-ledgers = ##t
90
91     % The beam between 8th-notes is used to draw the push-line
92     %How to fast write the push-lines:
93     %  1. write repeatedly 'c c c c c c c c |' for the whole length of the song
94     %  2. uncomment the line \NoNoteHead
95     %  3. compile
96     %  4. Mark the positions on which push/pull changes.
97     %     In the score-picture click on the position the push- or pull-part starts
98     %           (on the noteHead, the cursor will change to a hand-icon).
99     %     The cursor in the source code will jump just at this position.
100     %   a) If a push-part starts there, replace the 'c' by an 'e['
101     %   b) If a pull-part starts there, replace the 'c' by an 's'
102     %  5. Switch into 'overwrite-mode' by pressing the 'ins' key.
103     %  6. For the pull-parts overwrite the 'c' with 's'
104     %  7. For every push-part replace the last 'c' with 'e]'
105     %        8. Switch into 'insert-mode' again
106     %  9. At last it should look lik e.g. (s s e[ c | c c c c c c c c | c c c c c c e] s s)
107     % 10. re-enable the line \NoNoteHead
108     \autoBeamOff
109     \ZeroBeam
110     s8 s s e[ c c c c c c e] | s s s s s
111   }
112 }
113
114 %{
115 %}
116
117 % Accordion melody in tabulator score
118 % 1. Place a copy of the piano melody below
119 % 2. Separate piano melody into pull- and push-parts according to the staffTabLine you've already made
120 % 3. For each line: Double the line. Remark the 1st one (Keeps unchanged as reference) and then change the second line using the transformation paper
121 %    or the macros 'conv2diaton push.bsh' and 'conv2diaton pull.bsh'
122 % Tips:
123 % - In jEdit Search & Replace mark the Option 'Keep Dialog'
124
125 AccordionTabTwoCBesDur = {
126   % pull 1
127   %<f' bes'>8 <f' a'>8 <d' bes'>8 |
128   <g'' a''>8 <g'' b''>8 <e'' a''>8 |
129   % push 2
130   %<g' c''>4 <f' d''> <g' ees''> <f' a'> |
131   <g'' a''>4 <d'' eisis''> <g'' bisis''> <d'' f''> |
132   % pull 3
133   % <f' bes'>2 r8 }
134   <g'' a''>2 r8 }
135
136 AccordionTab= { \dynamicUp
137   % 1. Place a copy of the piano melody above
138   % 2. Separate piano melody into pull- and push-parts according to the staffTabLine you've already made
139   % 3. For each line: Double the line. Remark the 1st one (Keeps unchanged as reference) and then
140   %    change the second line using the transformation paper
141   % Tips:
142   % - In jEdit Search & Replace mark the Option 'Keep Dialog'
143   % -
144   \AccordionTabTwoCBesDur
145 }
146
147
148
149 \layout {
150   \context {
151     \Score
152     % The vertical line (simulating a bar-line) in
153     % the staffBassRhytm is a gridline
154     \consists "Grid_line_span_engraver"
155   }
156   \context {
157     \Staff
158     \consists "Grid_point_engraver"
159     gridInterval = #(ly:make-moment 4 4) % 4/4 - tact. How many beats per bar
160     % The following line has to be adjusted O-F-T-E-N.
161     \override GridPoint #'Y-extent = #'(-2 . -21)
162   }
163   \context {
164     \ChoirStaff
165     \remove "System_start_delimiter_engraver"
166   }
167 }
168
169 staffVoice = \new Staff = astaffvoice  {
170   \time 4/4
171   \set Staff.instrumentName = "Voice"
172   \set Staff.midiInstrument = "voice oohs"
173   \key bes \major
174   \partial 8*3
175   \clef treble
176   {
177     \context Voice = "melodyVoi"
178     { <f' bes'>8 <f' a'>8 <d' bes'>8 | <g' c''>4 <f' d''> <g' es''> <f' a'> | <f' bes'>2 r8 }
179     \bar "|."
180   }
181 }
182
183 staffAccordionMel =
184 \new Staff  \with { \remove "Clef_engraver" } {
185   #(set-accidental-style 'forget) %Set the accidentals (Vorzeichen) for each note,
186   %do not remember them for the rest of the measure.
187   \time 4/4
188   \set Staff.instrumentName="Accordion"
189   \set Staff.midiInstrument="voice oohs"
190   \key c \major
191   \clef treble
192   { \AccordionTab \bar "|." }
193 }
194
195 AltOn =
196 #(define-music-function (parser location mag) (number?)
197   #{ \override Stem #'length = #$(* 7.0 mag)
198       \override NoteHead #'font-size =
199 #$(inexact->exact (* (/ 6.0 (log 2.0)) (log mag))) #})
200
201 AltOff = {
202   \revert Stem #'length
203   \revert NoteHead #'font-size
204 }
205
206 BassRhytm = {s4 s8 | c2 c2 | c2 s8 }
207 LyricBassRhythmI=  \lyricmode { c b | c }
208
209 staffBassRhytm =
210 \new Staff = staffbass \with { \remove "Clef_engraver" } {
211   % This is not a RhythmicStaff  because it must be possible to append lyrics.
212
213   \override Score.GridLine #'extra-offset = #'( 13.0 . 0.0 ) % x.y
214   \override Staff.StaffSymbol #'line-positions = #'( 0 )
215   % Shows one horizontal line. The vertical line (simulating a bar-line) is simulated by a grid
216   % Search for 'grid' in this page to find all related functions
217   \time 4/4
218   {
219     \context Voice = "VoiceBassRhytm"
220     \stemDown \AltOn #0.6
221     \relative c''
222     {
223       \BassRhytm
224     }
225     \AltOff
226     \bar "|."
227   }
228 }
229
230 \score {
231   \new ChoirStaff <<
232     \harmonies
233     \staffVoice
234     \context Lyrics = "lmelodyVoi"
235       \with { alignBelowContext = astaffvoice }
236       \lyricsto melodyVoi \verse
237     \staffAccordionMel
238     \staffTabLine
239     \staffBassRhytm
240     \context Lyrics = "lBassRhytmAboveI"
241       \with { alignAboveContext = staffbass }
242       \lyricsto VoiceBassRhytm \LyricBassRhythmI
243   >>
244 }
245 %}
246