]> git.donarmstrong.com Git - lilypond.git/blob - ly/engraver-init.ly
vert. spacing: Convert engraver-init.ly, clean up.
[lilypond.git] / ly / engraver-init.ly
1 %%%% This file is part of LilyPond, the GNU music typesetter.
2 %%%%
3 %%%% Copyright (C) 1996--2010 Han-Wen Nienhuys <hanwen@xs4all.nl>
4 %%%%                          Jan Nieuwenhuizen <janneke@gnu.org>
5 %%%%
6 %%%% LilyPond is free software: you can redistribute it and/or modify
7 %%%% it under the terms of the GNU General Public License as published by
8 %%%% the Free Software Foundation, either version 3 of the License, or
9 %%%% (at your option) any later version.
10 %%%%
11 %%%% LilyPond is distributed in the hope that it will be useful,
12 %%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
13 %%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 %%%% GNU General Public License for more details.
15 %%%%
16 %%%% You should have received a copy of the GNU General Public License
17 %%%% along with LilyPond.  If not, see <http://www.gnu.org/licenses/>.
18
19 \version "2.13.39"
20
21 \context {
22   \name "Global"
23
24   \accepts "Score"
25
26   \defaultchild "Score"
27   \description "Hard coded entry point for LilyPond.  Cannot be tuned."
28   \grobdescriptions #all-grob-descriptions
29 }
30
31 \context {
32   \type "Engraver_group"
33   \name "FretBoards"
34   \description "A context for displaying fret diagrams."
35
36   \consists "Fretboard_engraver"
37   \consists "Output_property_engraver"
38   \consists "Hara_kiri_engraver"
39   \consists "Separating_line_group_engraver"
40   \consists "Font_size_engraver"
41   \consists "Instrument_name_engraver"
42
43   predefinedDiagramTable = #default-fret-table
44 }
45
46 \context {
47   \type "Engraver_group"
48   \name "Staff"
49
50   \consists "Output_property_engraver"
51   \consists "Bar_engraver"
52   %% Bar_engraver must be first so default bars aren't overwritten
53   %% with empty ones.
54
55   \consists "Font_size_engraver"
56   \consists "Separating_line_group_engraver"
57   \consists "Dot_column_engraver"
58   \consists "Staff_collecting_engraver"
59
60  %% perhaps move to Voice context?
61   \consists "Ottava_spanner_engraver"
62   \consists "Clef_engraver"
63   \consists "Key_engraver"
64   \consists "Time_signature_engraver"
65   \consists "Ledger_line_engraver"
66   \consists "Staff_symbol_engraver"
67   \consists "Collision_engraver"
68   \consists "Grob_pq_engraver"
69   \consists "Rest_collision_engraver"
70   \consists "Accidental_engraver"
71   \consists "Piano_pedal_engraver"
72   \consists "Piano_pedal_align_engraver"
73   \consists "Instrument_name_engraver"
74   \consists "Axis_group_engraver"
75   \consists "Figured_bass_engraver"
76   \consists "Figured_bass_position_engraver"
77   \consists "Script_row_engraver"
78
79   localKeySignature = #'()
80   createSpacing = ##t
81   ignoreFiguredBassRest = ##f
82
83   %% explicitly set instrument, so we don't get
84   %% weird effects when doing instrument names for
85   %% piano staves
86
87   instrumentName = #'()
88   shortInstrumentName = #'()
89
90   \defaultchild "Voice"
91   \accepts "Voice"
92   \accepts "CueVoice"
93
94   \description "Handles clefs, bar lines, keys, accidentals.  It can contain
95 @code{Voice} contexts."
96
97 }
98
99 \context {
100   \Staff
101   \type "Engraver_group"
102   \name "DrumStaff"
103   \alias "Staff"
104
105   \remove "Accidental_engraver"
106   \remove "Ottava_spanner_engraver"
107   \remove "Key_engraver"
108   \remove "Piano_pedal_engraver"
109
110   \description "Handles typesetting for percussion."
111
112   \denies "Voice"
113   \accepts "DrumVoice"
114   \defaultchild "DrumVoice"
115
116   clefGlyph = #"clefs.percussion"
117   clefPosition = #0
118   \override Script #'staff-padding = #0.75
119 }
120
121
122 \context {
123   \type "Engraver_group"
124   \name "ChoirStaff"
125   \consists "Vertical_align_engraver"
126   topLevelAlignment = ##f
127
128   \consists "System_start_delimiter_engraver"
129   systemStartDelimiter = #'SystemStartBracket
130   vocalName = #'()
131   shortVocalName = #'()
132
133   \accepts "Staff"
134   \accepts "DrumStaff"
135   \accepts "RhythmicStaff"
136   \accepts "GrandStaff"
137   \accepts "PianoStaff"
138   \accepts "Lyrics"
139   \accepts "ChordNames"
140   \accepts "FiguredBass"
141   \accepts "ChoirStaff"
142   \accepts "StaffGroup"
143   \defaultchild "Staff"
144   \description "Identical to @code{StaffGroup} except that the
145 contained staves are not connected vertically."
146 }
147
148 \context{
149   \type "Engraver_group"
150
151   localKeySignature = #'()
152   createSpacing = ##t
153
154   squashedPosition = #0
155   \name RhythmicStaff
156   \alias "Staff"
157
158   \override BarLine #'bar-size = #4
159   \override VoltaBracket #'staff-padding = #3
160   \override StaffSymbol #'line-count = #1
161
162   \override Stem  #'neutral-direction = #UP
163   \override Beam  #'neutral-direction = #UP
164
165   \consists "Output_property_engraver"
166   \consists "Font_size_engraver"
167   \consists "Separating_line_group_engraver"
168   \consists "Dot_column_engraver"
169   \consists "Bar_engraver"
170   \consists "Staff_symbol_engraver"
171   \consists "Pitch_squash_engraver"
172   \consists "Time_signature_engraver"
173   \consists "Instrument_name_engraver"
174   \consists "Axis_group_engraver"
175   \consists "Ledger_line_engraver"
176
177   \accepts "Voice"
178   \accepts "CueVoice"
179   \defaultchild "Voice"
180
181   \description "A context like @code{Staff} but for printing rhythms.
182 Pitches are ignored; the notes are printed on one line."
183 }
184
185
186 \context {
187   \type "Engraver_group"
188   \name "Voice"
189
190   \description "Corresponds to a voice on a staff.  This context
191 handles the conversion of dynamic signs, stems, beams, super- and
192 subscripts, slurs, ties, and rests.
193
194 You have to instantiate this explicitly if you want to have
195 multiple voices on the same staff."
196
197   localKeySignature = #'()
198   \consists "Font_size_engraver"
199
200   \consists "Pitched_trill_engraver"
201   \consists "Output_property_engraver"
202   \consists "Arpeggio_engraver"
203   \consists "Multi_measure_rest_engraver"
204   \consists "Text_spanner_engraver"
205   \consists "Trill_spanner_engraver"
206   \consists "Grob_pq_engraver"
207   \consists "Forbid_line_break_engraver"
208   \consists "Laissez_vibrer_engraver"
209   \consists "Repeat_tie_engraver"
210   \consists "Note_head_line_engraver"
211   \consists "Glissando_engraver"
212   \consists "Ligature_bracket_engraver"
213   \consists "Breathing_sign_engraver"
214   \consists "Note_heads_engraver"
215   \consists "Dots_engraver"
216   \consists "Rest_engraver"
217   \consists "Tweak_engraver"
218
219   %% switch on to make stem directions interpolate for the
220   %% center line.
221   %  \consists "Melody_engraver"
222
223   \consists "Stem_engraver"
224   \consists "Beam_engraver"
225   \consists "Grace_beam_engraver"
226   \consists "Auto_beam_engraver"
227
228   %% must come before Script_column_engraver.
229   \consists "New_fingering_engraver"
230
231   \consists "Chord_tremolo_engraver"
232   \consists "Percent_repeat_engraver"
233   \consists "Slash_repeat_engraver"
234   \consists "Part_combine_engraver"
235
236   \consists "Text_engraver"
237   \consists "New_dynamic_engraver"
238   \consists "Dynamic_align_engraver"
239 %  \consists "Dynamic_engraver"
240   \consists "Fingering_engraver"
241   \consists "Bend_engraver"
242
243   \consists "Script_engraver"
244   \consists "Script_column_engraver"
245   \consists "Rhythmic_column_engraver"
246   \consists "Note_spacing_engraver"
247   \consists "Spanner_break_forbid_engraver"
248   \consists "Phrasing_slur_engraver"
249   \consists "Cluster_spanner_engraver"
250   \consists "Slur_engraver"
251   \consists "Tie_engraver"
252   \consists "Tuplet_engraver"
253   \consists "Grace_engraver"
254   \consists "Instrument_switch_engraver"
255 }
256
257 \context{
258   \Voice
259
260   \name CueVoice
261   \alias Voice
262   fontSize = #-4
263   \override Stem #'length-fraction = #(magstep -4)
264   \override Beam #'length-fraction = #(magstep -4)
265   \override Beam #'beam-thickness = #0.35
266 }
267
268 \context {
269   \Voice
270   \name DrumVoice
271   \alias Voice
272
273   \description "A voice on a percussion staff."
274   \remove "Arpeggio_engraver"
275   \consists "Grob_pq_engraver"
276
277   \remove "Note_head_line_engraver"
278   \remove "Glissando_engraver"
279   \remove "Ligature_bracket_engraver"
280   \remove "Note_heads_engraver"
281   \consists "Drum_notes_engraver"
282   \remove "New_fingering_engraver"
283
284   \remove "Fingering_engraver"
285
286   \remove "Cluster_spanner_engraver"
287 }
288
289 \context{
290   \type "Engraver_group"
291   \name GrandStaff
292   localKeySignature = #'()
293
294   \description "A group of staves, with a brace on the left
295 side, grouping the staves together.  The bar lines of the
296 contained staves are connected vertically."
297
298   \consists "Span_bar_engraver"
299   \consists "Span_arpeggio_engraver"
300   \consists "System_start_delimiter_engraver"
301   systemStartDelimiter = #'SystemStartBrace
302
303   \defaultchild "Staff"
304   \accepts "Staff"
305   \accepts "FiguredBass"
306   \accepts "Dynamics"
307 }
308
309 \context{
310   \GrandStaff
311   \name "PianoStaff"
312   \alias "GrandStaff"
313
314   \description "Just like @code{GrandStaff} but with support for
315 instrument names at the start of each system."
316
317   \consists "Instrument_name_engraver"
318   \consists "Vertical_align_engraver"
319   \consists "Keep_alive_together_engraver"
320   topLevelAlignment = ##f
321
322   \override StaffGrouper #'staff-staff-spacing #'stretchability = #5
323
324   instrumentName = #'()
325   shortInstrumentName = #'()
326 }
327
328 \context {
329   \type "Engraver_group"
330   \name "StaffGroup"
331
332   \consists "Vertical_align_engraver"
333   topLevelAlignment = ##f
334
335   \consists "Span_bar_engraver"
336   \consists "Span_arpeggio_engraver"
337   \consists "Output_property_engraver"
338   systemStartDelimiter = #'SystemStartBracket
339
340   \consists "System_start_delimiter_engraver"
341
342   \defaultchild "Staff"
343   \accepts "Staff"
344   \accepts "RhythmicStaff"
345   \accepts "DrumStaff"
346   \accepts "GrandStaff"
347   \accepts "PianoStaff"
348   \accepts "TabStaff"
349   \accepts "Lyrics"
350   \accepts "ChordNames"
351   \accepts "FiguredBass"
352   \accepts "ChoirStaff"
353   \accepts "StaffGroup"
354
355   \description "Groups staves while adding a bracket on the left
356 side, grouping the staves together.  The bar lines of the contained
357 staves are connected vertically.  @code{StaffGroup} only consists of
358 a collection of staves, with a bracket in front and spanning bar lines."
359 }
360
361 \context {
362   \type "Engraver_group"
363   \name Dynamics
364   \alias Voice
365   \consists "Output_property_engraver"
366   \consists "Bar_engraver"
367   \consists "Piano_pedal_engraver"
368   \consists "Script_engraver"
369   \consists "New_dynamic_engraver"
370   \consists "Dynamic_align_engraver"
371   \consists "Text_engraver"
372   \consists "Text_spanner_engraver"
373   \consists "Axis_group_engraver"
374
375   pedalSustainStrings = #'("Ped." "*Ped." "*")
376   pedalUnaCordaStrings = #'("una corda" "" "tre corde")
377   \override VerticalAxisGroup #'staff-affinity = #CENTER
378   \override VerticalAxisGroup #'nonstaff-relatedstaff-spacing =
379     #'((space . 5)
380        (padding . 0.5))
381   \override TextScript #'font-shape = #'italic
382   \override DynamicLineSpanner #'Y-offset = #0
383
384   \description "Holds a single line of dynamics, which will be
385 centered between the staves surrounding this context."
386 }
387
388
389 \context{
390   \type "Engraver_group"
391
392   \description "Corresponds to a voice with lyrics.  Handles the
393 printing of a single line of lyrics."
394
395   \name "Lyrics"
396   instrumentName = #'()
397   shortInstrumentName = #'()
398
399   \consists "Lyric_engraver"
400   \consists "Extender_engraver"
401   \consists "Hyphen_engraver"
402   \consists "Stanza_number_engraver"
403   \consists "Instrument_name_engraver"
404   \consists "Font_size_engraver"
405   \consists "Hara_kiri_engraver"
406
407   \override VerticalAxisGroup #'remove-first = ##t
408   \override VerticalAxisGroup #'remove-empty = ##t
409   \override VerticalAxisGroup #'staff-affinity = #UP
410   \override VerticalAxisGroup #'nonstaff-relatedstaff-spacing =
411     #'((space . 5.5)
412        (stretchability . 1)
413        (padding . 0.5))
414   \override VerticalAxisGroup #'nonstaff-nonstaff-spacing =
415      #'((space . 0)
416         (stretchability . 0)
417         (padding . 0.2)
418         (minimum-distance . 2.8))
419   \override VerticalAxisGroup #'nonstaff-unrelatedstaff-spacing #'padding = #1.0
420   \override InstrumentName #'self-alignment-Y = ##f
421
422   %% sync with define-grobs.scm ;
423   \override InstrumentName #'font-size = #1.0
424
425   %% make sure that barlines aren't collapsed, when
426   %% Bar_engraver is there.
427   \override BarLine #'bar-size = #0.1
428
429 }
430
431 \context {
432   \type "Engraver_group"
433   \name NoteNames
434   \description "A context for printing the names of notes."
435   \consists "Axis_group_engraver"
436
437   % FIXME: not sure what the default should be here.
438   \override VerticalAxisGroup #'staff-affinity = #DOWN
439
440   \consists "Tie_engraver"
441   \consists "Note_name_engraver"
442   \consists "Separating_line_group_engraver"
443 }
444
445 \context {
446   \type "Engraver_group"
447   \name ChordNames
448   \description "Typesets chord names."
449
450   \consists "Output_property_engraver"
451   \consists "Separating_line_group_engraver"
452   \consists "Chord_name_engraver"
453   \consists "Hara_kiri_engraver"
454 %  \consists "Note_spacing_engraver"
455   \override VerticalAxisGroup #'remove-first = ##t
456   \override VerticalAxisGroup #'remove-empty = ##t
457   \override VerticalAxisGroup #'staff-affinity = #DOWN
458   \override VerticalAxisGroup #'nonstaff-relatedstaff-spacing #'padding = #0.5
459   \override VerticalAxisGroup #'nonstaff-nonstaff-spacing #'padding = #0.5
460 }
461
462
463 RemoveEmptyStaves = \with {
464   \remove "Axis_group_engraver"
465   \remove "Hara_kiri_engraver"
466   \consists "Hara_kiri_engraver"
467   \override Beam #'auto-knee-gap = #'()
468   \override VerticalAxisGroup #'remove-empty = ##t
469 }
470
471
472 \context {
473   \type "Score_engraver"
474   \name "Score"
475
476   \description "This is the top level notation context.  No
477 other context can contain a @code{Score} context.  This context
478 handles the administration of time signatures.  It also makes sure
479 that items such as clefs, time signatures, and key-signatures are
480 aligned across staves.
481
482 You cannot explicitly instantiate a @code{Score} context (since it
483 is not contained in any other context).  It is instantiated
484 automatically when an output definition (a @code{\score} or
485 @code{\layout} block) is processed."
486
487   \consists "Paper_column_engraver"
488   \consists "Repeat_acknowledge_engraver"
489   \consists "Staff_collecting_engraver"
490
491   %% move the alias along with the engraver.
492
493   \consists "Timing_translator"
494   \consists "Default_bar_line_engraver"
495   \consists "Output_property_engraver"
496   \consists "System_start_delimiter_engraver"
497   \consists "Mark_engraver"
498   \consists "Volta_engraver"
499   \consists "Metronome_mark_engraver"
500   \consists "Break_align_engraver"
501   \consists "Spacing_engraver"
502   \consists "Grace_spacing_engraver"
503   \consists "Vertical_align_engraver"
504   \consists "Stanza_number_align_engraver"
505   \consists "Bar_number_engraver"
506   \consists "Parenthesis_engraver"
507
508   \defaultchild "Staff"
509
510   \accepts "FretBoards"
511   \accepts "Staff"
512   \accepts "RhythmicStaff"
513   \accepts "TabStaff"
514   \accepts "VaticanaStaff"
515   \accepts "GregorianTranscriptionStaff"
516   \accepts "MensuralStaff"
517   \accepts "StaffGroup"
518   \accepts "DrumStaff"
519   \accepts "Lyrics"
520   \accepts "ChordNames"
521   \accepts "GrandStaff"
522   \accepts "ChoirStaff"
523   \accepts "PianoStaff"
524   \accepts "Devnull"
525   \accepts "NoteNames"
526   \accepts "FiguredBass"
527
528
529   noteToFretFunction = #determine-frets
530   predefinedDiagramTable = ##f
531   soloText = #"Solo"
532   soloIIText = #"Solo II"
533   aDueText = #"a2"
534   printPartCombineTexts = ##t
535   systemStartDelimiter =#'SystemStartBar
536
537   drumStyleTable = #drums-style
538
539   melismaBusyProperties = #default-melisma-properties
540   tieWaitForNote = ##f
541   clefGlyph = #"clefs.G"
542   clefPosition = #-2
543   middleCClefPosition = #-6
544   middleCPosition = #-6
545   firstClef = ##t
546
547   crescendoSpanner = #'hairpin
548   decrescendoSpanner = #'hairpin
549
550   defaultBarType = #"|"
551   doubleRepeatType = #":|:"
552   barNumberVisibility = #first-bar-number-invisible
553   automaticBars = ##t
554
555   explicitClefVisibility = #all-visible
556   explicitKeySignatureVisibility = #all-visible
557   implicitTimeSignatureVisibility = #end-of-line-invisible
558
559   repeatCountVisibility = #all-repeat-counts-visible
560
561   timeSignatureSettings = #default-time-signature-settings
562   timeSignatureFraction = #'(4 . 4)
563
564 %% These defaults should be the same as the rules established in
565 %%   scm/time-signature-settings.scm for 4/4 time
566   measureLength = #(ly:make-moment 4 4)
567   baseMoment = #(ly:make-moment 1  4)
568   beatStructure = #'(1 1 1 1)
569   beamExceptions = #'((end . (((1 . 8) . (4 4))
570                               ((1 . 12) . (3 3 3 3)))))
571   autoBeaming = ##t
572   autoBeamCheck = #default-auto-beam-check
573
574   scriptDefinitions = #default-script-alist
575
576   pedalSustainStrings = #'("Ped." "*Ped." "*")
577   pedalSustainStyle = #'text
578   pedalUnaCordaStrings = #'("una corda" "" "tre corde")
579   pedalUnaCordaStyle = #'text
580
581 %% These are in ordinary italic font, including the *,
582 %% but they are unlikely to be used,
583 %% as the default pedal-style for SostenutoPedal is 'mixed':
584 %% i.e.  Sost. Ped_____________________
585   pedalSostenutoStrings = #'("Sost. Ped." "*Sost. Ped." "*")
586   pedalSostenutoStyle = #'mixed
587
588   harmonicAccidentals = ##t
589   fingeringOrientations = #'(up down)
590   stringNumberOrientations = #'(up down)
591   strokeFingerOrientations = #'(right)
592
593   lyricMelismaAlignment = #LEFT
594   markFormatter = #format-mark-letters
595   rehearsalMark = #1
596   subdivideBeams = ##f
597   extraNatural = ##t
598   autoAccidentals = #`(Staff ,(make-accidental-rule 'same-octave 0))
599   autoCautionaries = #'()
600
601   printKeyCancellation = ##t
602   keyAlterationOrder = #`(
603     (6 . ,FLAT) (2  . ,FLAT) (5 . ,FLAT ) (1  . ,FLAT) (4  . ,FLAT) (0  . ,FLAT) (3  . ,FLAT)
604     (3 . ,SHARP) (0 . ,SHARP) (4 . ,SHARP) (1 . ,SHARP) (5 . ,SHARP) (2 . ,SHARP) (6 . ,SHARP)
605     (6 . ,DOUBLE-FLAT) (2 . ,DOUBLE-FLAT) (5 . ,DOUBLE-FLAT ) (1 . ,DOUBLE-FLAT) (4 . ,DOUBLE-FLAT) (0 . ,DOUBLE-FLAT) (3 . ,DOUBLE-FLAT)
606     (3  . ,DOUBLE-SHARP) (0 . ,DOUBLE-SHARP) (4 . ,DOUBLE-SHARP) (2 . ,DOUBLE-SHARP) (5 . ,DOUBLE-SHARP) (2 . ,DOUBLE-SHARP) (6 . ,DOUBLE-SHARP)
607   )
608
609   barCheckSynchronize = ##f
610
611 %% chord names:
612   chordNameFunction = #ignatzek-chord-names
613   majorSevenSymbol = #whiteTriangleMarkup
614   chordNameLowercaseMinor = ##f
615   chordNameSeparator = #(make-simple-markup  "/")
616   chordNameExceptions = #ignatzekExceptions
617   chordNoteNamer = #'()
618   chordRootNamer = #note-name->markup
619   chordPrefixSpacer = #0
620   chordNameExceptionsFull = #fullJazzExceptions
621   chordNameExceptionsPartial = #partialJazzExceptions
622   noChordSymbol = #(make-simple-markup "N.C.")
623
624   bassStaffProperties = #'((assign clefGlyph "clefs.F")
625   (assign clefPosition 2)
626   (assign middleCPosition 6)
627   (assign middleCClefPosition 6))
628 %% tablature:
629   stringOneTopmost = ##t
630   highStringOne = ##t
631
632 %% One may change the string tunings as follows :
633 %% The length of the list must be equal to the number of strings
634   stringTunings = #guitar-tuning
635   tablatureFormat = #fret-number-tablature-format
636   tabStaffLineLayoutFunction = #tablature-position-on-lines
637
638 %%
639   figuredBassFormatter = #format-bass-figure
640   metronomeMarkFormatter = #format-metronome-markup
641
642
643   %% See also make-voice-props-set
644   graceSettings = #`(
645     (Voice Stem direction ,UP)
646     (Voice Stem font-size -3)
647     (Voice NoteHead font-size -3)
648     (Voice TabNoteHead font-size -4)
649     (Voice Dots font-size -3)
650     (Voice Stem length-fraction 0.8)
651     (Voice Stem no-stem-extend #t)
652     (Voice Beam beam-thickness 0.384)
653     (Voice Beam length-fraction 0.8)
654     (Voice Accidental font-size -4)
655     (Voice AccidentalCautionary font-size -4)
656     (Voice Slur direction ,DOWN)
657     (Voice Script font-size -3)
658     (Voice Fingering font-size -8)
659     (Voice StringNumber font-size -8)
660   )
661
662   keepAliveInterfaces = #'(
663     bass-figure-interface
664     chord-name-interface
665     cluster-beacon-interface
666     fret-diagram-interface
667     lyric-syllable-interface
668     note-head-interface
669     tab-note-head-interface
670     lyric-interface
671     percent-repeat-item-interface
672     percent-repeat-interface
673
674     ;; need this, as stanza numbers are items, and appear only once.
675     stanza-number-interface
676   )
677   % \quoteDuring is supposed to quote everything, cueDuring only the essentials
678   quotedEventTypes = #'(StreamEvent)
679   quotedCueEventTypes = #'(
680     note-event
681     rest-event
682     tie-event
683     beam-event
684     tuplet-span-event)
685   instrumentTransposition = #(ly:make-pitch 0 0 0)
686
687   topLevelAlignment = ##t
688
689   timing = ##t
690 }
691
692
693
694
695 \context {
696   \type "Engraver_group"
697   \name "FiguredBass"
698   \description "A context for printing a figured bass line."
699
700   \consists "Figured_bass_engraver"
701   \consists "Separating_line_group_engraver"
702   \consists "Hara_kiri_engraver"
703
704   \override VerticalAxisGroup #'remove-empty = ##t
705   \override VerticalAxisGroup #'remove-first = ##t
706   \override VerticalAxisGroup #'staff-affinity = #UP
707   \override VerticalAxisGroup #'nonstaff-relatedstaff-spacing #'padding = #0.5
708   \override VerticalAxisGroup #'nonstaff-nonstaff-spacing #'padding = #0.5
709 }
710
711 \context {
712   \name "Devnull"
713   \type "Engraver_group"
714
715 %% don't want to route anything out of here:
716   \alias "Staff"
717   \alias "Voice"
718   \description "Silently discards all musical information given to this
719 context."
720 }
721
722 \context {
723   \Voice
724   \name "TabVoice"
725   \alias "Voice"
726   \consists "Tab_note_heads_engraver"
727   \consists "Tab_harmonic_engraver"
728
729   \remove "Note_heads_engraver"
730   \remove "Fingering_engraver"
731   \remove "New_fingering_engraver"
732
733   \description "Context for drawing notes in a Tab staff."
734
735   %% TabStaff increase the staff-space, which in turn
736   %% increases beam thickness and spacing; beams are
737   %% too big. We have to adjust the beam settings:
738   \override Beam #'beam-thickness = #0.32
739   \override Beam #'length-fraction = #0.62
740   %% the same goes for tremolo beams
741   \override StemTremolo #'beam-thickness = #0.32
742   %% NOTE: in lily/stem-tremolo.cc, we have length-fraction = 1,
743   %% and the tablature staff space is scaled (1.5 by default),
744   %% so we use the inversion of the scale factor:
745   \override StemTremolo #'length-fraction = #(lambda (grob)
746                                                (/ 1 (ly:staff-symbol-staff-space grob)))
747   \override StemTremolo #'beam-width = #stem-tremolo::calc-tab-width
748
749   %% No accidental in tablature !
750   \remove "Accidental_engraver"
751   %% make the Stems as short as possible to minimize their influence
752   %% on the slur::calc-control-points routine
753   \override Stem #'length = #0
754   \override Stem #'no-stem-extend = ##t
755   \override Stem #'flag-style = #'no-flag
756   \override Stem #'details = #'((lengths 0 0 0 0 0 0)
757                                 (beamed-lengths 0 0 0)
758                                 (beamed-minimum-free-lengths 0 0 0)
759                                 (beamed-extreme-minimum-free-lengths 0 0)
760                                 (stem-shorten 0 0))
761   %% after all, the stubs of the stems may still be visible, so ...
762   \override Stem #'transparent = ##t
763   %% automatic beams should be suppressed for similar reasons ...
764   autoBeaming = ##f
765   %% remove beams, dots and rests ...
766   \override Beam #'stencil = ##f
767   \override StemTremolo #'stencil = ##f
768   \override Dots #'stencil = ##f
769   \override Rest #'stencil = ##f
770   \override MultiMeasureRest #'stencil = ##f
771   \override MultiMeasureRestNumber #'transparent = ##t
772   \override MultiMeasureRestText #'transparent = ##t
773   %% ... all kinds of ties/slurs
774   \override Tie  #'stencil = ##f
775   \override RepeatTie #'stencil = ##f
776   \override LaissezVibrerTie #'stencil = ##f
777   \override Slur #'stencil = #slur::draw-tab-slur
778   \override PhrasingSlur #'stencil = ##f
779   %% 'tied to' fret numbers become invisible or parenthesized, respectively)
780   \override Tie #'after-line-breaking = #tie::handle-tab-note-head
781   \override RepeatTie #'after-line-breaking = #repeat-tie::handle-tab-note-head
782   %% ... and all kinds of markups, spanners etc.
783   \override TupletBracket #'stencil = ##f
784   \override TupletNumber #'stencil = ##f
785   \override DynamicText #'transparent = ##t
786   \override DynamicTextSpanner #'stencil = ##f
787   \override TextSpanner #'stencil = ##f
788   \override Hairpin #'transparent = ##t
789   \override Script #'stencil = ##f
790   \override TextScript #'stencil = ##f
791   %% the direction for glissando lines will be automatically corrected
792   \override Glissando #'extra-dy = #glissando::calc-tab-extra-dy
793   \override Glissando #'bound-details #'right = #`((attach-dir . ,LEFT)
794                                                    (padding . 0.3))
795   \override Glissando #'bound-details #'left = #`((attach-dir . ,RIGHT)
796                                                    (padding . 0.3))
797   %% dead notes
798   \override TabNoteHead #'glyph-name = #tab-note-head::calc-glyph-name
799   \override TabNoteHead #'stencil = #tab-note-head::whiteout-if-style-set
800 }
801
802 \context {
803   \Staff
804   \alias "Staff"
805   \name "TabStaff"
806   \denies "Voice"
807   \consists "Tab_staff_symbol_engraver"
808
809   \description "Context for generating tablature. It accepts only @code{TabVoice}
810 contexts and handles the line spacing, the tablature clef etc. properly."
811
812   \accepts "TabVoice"
813   \defaultchild "TabVoice"
814
815   %% 6 strings, bigger spacing
816   \override StaffSymbol #'staff-space = #1.5
817
818   %% Don't draw stems over the tablature figures !
819   \override Stem #'avoid-note-head = ##t
820
821   %% No accidental in tablature !
822   \remove "Accidental_engraver"
823   \remove "Key_engraver"
824
825   \remove "Ottava_spanner_engraver"
826   %% the clef handler
827   \override Clef #'stencil = #clef::print-modern-tab-if-set
828   %% no time signature
829   \override TimeSignature #'stencil = ##f
830   %% better parentheses in a TabStaff
831   \override ParenthesesItem #'stencils = #parentheses-item::calc-tabstaff-parenthesis-stencils
832   %% no arpeggios
833   \override Arpeggio #'stencil = ##f
834   %% we ignore collision warnings that may occur due to
835   %% stem overlapping, because we have no stems ;-)
836   \override NoteColumn #'ignore-collision = ##t
837   %% Special "TAB" clef
838   clefGlyph = #"clefs.tab"
839   clefPosition = #0
840 }
841
842 \context {
843   \Voice
844   \name "VaticanaVoice"
845   \alias "Voice"
846   \description "Same as @code{Voice} context, except that it is
847 accommodated for typesetting Gregorian Chant in the notational style
848 of Editio Vaticana."
849
850   \remove "Slur_engraver"
851   \remove "Stem_engraver"
852   \remove "Ligature_bracket_engraver"
853   \consists "Vaticana_ligature_engraver"
854   \remove "Text_spanner_engraver"
855   \consists "Episema_engraver"
856
857   %% Set default head for notes outside of \[ \].
858   \override NoteHead #'style = #'vaticana.punctum
859
860   %% Put some space before and after divisiones.
861   %% FIXME: This does not seem to show any effect.
862   \override Script #'padding = #0.5
863
864   %% There are no beams in Gregorian Chant notation.
865   autoBeaming = ##f
866 }
867
868 \context {
869   \Staff
870   \name "VaticanaStaff"
871   \alias "Staff"
872   \denies "Voice"
873   \accepts "VaticanaVoice"
874   \defaultchild "VaticanaVoice"
875
876   \description "Same as @code{Staff} context, except that it is
877 accommodated for typesetting Gregorian Chant in the notational style
878 of Editio Vaticana."
879
880   \remove "Time_signature_engraver"
881   \consists "Custos_engraver"
882
883   %% We can not remove Bar_engraver; otherwise clefs and custodes will
884   %% not show up any more among other line breaking issues.
885   %% Instead, we make the grob transparent.
886   \override BarLine #'transparent = ##t
887
888   \override StaffSymbol #'line-count = #4
889   \override StaffSymbol #'thickness = #0.6
890
891   %% FIXME: unit on StaffSymbol's width should be \linewidth.
892   %% \override StaffSymbol #'width = #60.0
893
894   %% Choose vaticana do clef on 3rd line as default.
895   clefGlyph = #"clefs.vaticana.do"
896   middleCPosition = #1
897   middleCClefPosition = #1
898   clefPosition = #1
899   clefOctavation = #0
900
901   %% Select vaticana style font.
902   \override KeySignature #'glyph-name-alist = #alteration-vaticana-glyph-name-alist
903   \override Accidental #'glyph-name-alist = #alteration-vaticana-glyph-name-alist
904   \override Custos #'style = #'vaticana
905   \override Custos #'neutral-position = #3
906   \override Custos #'neutral-direction = #DOWN
907   \override Dots #'style = #'vaticana
908 }
909
910 \context {
911   \Voice
912   \name "GregorianTranscriptionVoice"
913   \alias "Voice"
914   \consists "Episema_engraver"
915
916   %% Removing ligature bracket engraver without replacing it by some
917   %% other ligature engraver would cause a "Junking event: `LigatureEvent'"
918   %% warning for every "\[" and "\]".  Therefore, we make the grob
919   %% transparent instead.
920   \override LigatureBracket #'transparent = ##t
921
922   %% Put some space before and after divisiones.
923   %% FIXME: This does not seem to show any effect.
924   \override Script #'padding = #0.5
925
926   %% There are no beams in Gregorian Chant notation.
927   autoBeaming = ##f
928
929 }
930
931 \context {
932   \Staff
933   \name "GregorianTranscriptionStaff"
934   \alias "Staff"
935   \denies "Voice"
936   \accepts "GregorianTranscriptionVoice"
937   \defaultchild "GregorianTranscriptionVoice"
938
939   %% We can not remove Bar_engraver; otherwise clefs and custodes will
940   %% not show up any more among other line breaking issues.
941   %% Instead, we make the grob transparent.
942   \override BarLine #'transparent = ##t
943 }
944
945 \context {
946   \Voice
947   \name "MensuralVoice"
948   \alias "Voice"
949   \description "Same as @code{Voice} context, except that it is
950 accommodated for typesetting a piece in mensural style."
951
952   \remove "Slur_engraver"
953   \remove "Ligature_bracket_engraver"
954   \consists "Mensural_ligature_engraver"
955
956   %% Set default head for notes outside of \[ \].
957   \override NoteHead #'style = #'mensural
958   \override Rest #'style = #'mensural
959
960   %% There are no beams in mensural notation.
961   autoBeaming = ##f
962 }
963
964 \context {
965   \Staff
966   \name "MensuralStaff"
967   \alias "Staff"
968   \denies "Voice"
969   \defaultchild "MensuralVoice"
970   \accepts "MensuralVoice"
971   \description "Same as @code{Staff} context, except that it is
972 accommodated for typesetting a piece in mensural style."
973
974   \consists "Custos_engraver"
975
976   %% We can not remove Bar_engraver; otherwise clefs and custodes will
977   %% not show up any more among other line breaking issues.
978   %% Instead, we make the grob transparent.
979   \override BarLine #'transparent = ##t
980
981   \override StaffSymbol #'thickness = #0.6
982
983   %% FIXME: unit on StaffSymbol's width should be \linewidth.
984   %% \override StaffSymbol #'width = #60.0
985
986   %% Choose mensural g clef on 2nd line as default.
987   clefGlyph = #"clefs.mensural.g"
988   middleCClefPosition = #-6
989   middleCPosition = #-6
990   clefPosition = #-2
991   clefOctavation = #0
992
993   %% Select mensural style font.
994   \override TimeSignature #'style = #'mensural
995   \override KeySignature #'glyph-name-alist = #alteration-mensural-glyph-name-alist
996   \override Accidental #'glyph-name-alist = #alteration-mensural-glyph-name-alist
997   \override Custos #'style = #'mensural
998   \override Custos #'neutral-position = #3
999   \override Custos #'neutral-direction = #DOWN
1000
1001   %% Accidentals are valid only once (same as
1002   %% #(set-accidental-style 'forget))
1003   extraNatural = ##f
1004   autoAccidentals = #`(Staff ,(make-accidental-rule 'same-octave -1))
1005   autoCautionaries = #'()
1006   printKeyCancellation = ##f
1007 }
1008
1009
1010 %% Keep the old definitions in here for compatibility (they erase previous
1011 %% settings to the corresponding context!).
1012 %% For new scores, one should simply insert the \RemoveEmptyStaves settings
1013 %% into the desired context. That's just as easy, requires only one line more
1014 %% (the \*Staff), but preserves previous context mods.
1015 %% TODO: DEPRECATED_2.13.17, remove at some point in the future
1016 RemoveEmptyStaffContext = \context {
1017   \Staff
1018   \RemoveEmptyStaves
1019 }
1020
1021 AncientRemoveEmptyStaffContext = \context {
1022   \VaticanaStaff
1023   \RemoveEmptyStaves
1024 }
1025
1026 RemoveEmptyDrumStaffContext = \context {
1027   \DrumStaff
1028   \RemoveEmptyStaves
1029 }
1030
1031 RemoveEmptyRhythmicStaffContext = \context {
1032   \RhythmicStaff
1033   \RemoveEmptyStaves
1034 }
1035
1036 RemoveEmptyTabStaffContext = \context {
1037   \TabStaff
1038   \RemoveEmptyStaves
1039 }
1040