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
6 %% This file is in the public domain.
10 lsrtags = "midi, percussion, pitches, specific-notation"
13 If you want to use customized drum-pitch-names for an own drum-style
14 with proper output for layout and midi, follow the steps as
15 demonstrated in the code below. In short:
17 * define the names * define the appearence * tell LilyPond to use it
18 for layout * assign pitches to the names * tell LilyPond to use them
22 doctitle = "Customize drumPitchNames drumStyleTable and drumPitchTable in layout and midi"
25 %% This snippet tries to amend
26 %% NR 2.5.1 Common notation for percussion - Custom percussion staves
27 %% http://lilypond.org/doc/v2.18/Documentation/notation/common-notation-for-percussion#custom-percussion-staves
29 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
31 %% To use custom drum-pitch-names for your score and midi you need to follow
38 %% (1) Define a name and put it in `drumPitchNames'
39 %% This can be done at toplevel with
40 %% drumPitchNames #'my-name = #'my-name
42 %% drumPitchNames.my-name = #'my-name
43 %% It's possible to add an alias as well.
44 %% (2) Define how it should be printed
45 %% Therefore put them into a toplevel-list, where each entry should look:
47 %% note-head-style-or-default
48 %% articulation-string-or-#f
53 %% (my-name default "tenuto" -1)
56 %% (3) Tell LilyPond to use this custom-definitions, with
57 %% drumStyleTable = #(alist->hash-table my-style)
58 %% in a \layout or \with
60 %% Now we're done for layout, here a short, but complete example:
62 %% \with { drumStyleTable = #(alist->hash-table my-style) }
63 %% \drummode { my-name }
69 %% (1) Again at toplvel, assign a pitch to your custom-note-name
70 %% midiDrumPitches #'my-name = #(ly:make-pitch -1 4 FLAT)
72 %% midiDrumPitches.my-name = ges
73 %% Note that you have to use the name, which is in drumPitchNames, no alias
74 %% (2) Tell LilyPond to use this pitch(es), with
75 %% drumPitchTable = #(alist->hash-table midiDrumPitches)
81 %% drumStyleTable = #(alist->hash-table my-style)
82 %% drumPitchTable = #(alist->hash-table midiDrumPitches)
84 %% \drummode { my-name4 }
93 %% To test whether all is fine, run the following sequence in terminal:
94 %% lilypond my-file.ly
95 %% midi2ly my-file.midi
96 %% gedit my-file-midi.ly
99 %% 1. create pdf and midi
100 %% 2. transform the midi back to a .ly-file
101 %% (note: midi2ly is not always good in correctly identifying enharmonic pitches)
102 %% 3. open this file in gedit (or use another editor)
103 %% Now watch what you've got.
105 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
107 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
109 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
111 drumPitchNames.dbass = #'dbass
112 drumPitchNames.dba = #'dbass % 'db is in use already
113 drumPitchNames.dbassmute = #'dbassmute
114 drumPitchNames.dbm = #'dbassmute
115 drumPitchNames.do = #'dopen
116 drumPitchNames.dopenmute = #'dopenmute
117 drumPitchNames.dom = #'dopenmute
118 drumPitchNames.dslap = #'dslap
119 drumPitchNames.ds = #'dslap
120 drumPitchNames.dslapmute = #'dslapmute
121 drumPitchNames.dsm = #'dslapmute
124 '((dbass default #f -2)
125 (dbassmute default "stopped" -2)
127 (dopenmute default "stopped" 0)
129 (dslapmute default "stopped" 2)))
131 midiDrumPitches.dbass = g
132 midiDrumPitches.dbassmute = fis
133 midiDrumPitches.dopen = a
134 midiDrumPitches.dopenmute = gis
135 midiDrumPitches.dslap = b
136 midiDrumPitches.dslapmute = ais
138 one = \drummode { r4 dba4 do ds r dbm dom dsm }
143 \override StaffSymbol.line-count = #3
144 instrumentName = #"Djembe "
145 drumStyleTable = #(alist->hash-table djembe)
146 drumPitchTable = #(alist->hash-table midiDrumPitches)