]> git.donarmstrong.com Git - lilypond.git/blob - ly/declarations-init.ly
f3f5eef6689e383abf610af6aad1af062c055afc
[lilypond.git] / ly / declarations-init.ly
1 %%%% This file is part of LilyPond, the GNU music typesetter.
2 %%%%
3 %%%% Copyright (C) 1996--2012 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.17.25"
20
21 %% named durations
22 breve = #(ly:make-duration -1 0)
23 longa = #(ly:make-duration -2 0)
24 maxima = #(ly:make-duration -3 0)
25
26 \include "music-functions-init.ly"
27 \include "toc-init.ly"
28
29 %% default note names are dutch
30 #(set! default-language "nederlands")
31 #(note-names-language parser default-language)
32
33 \include "drumpitch-init.ly"
34 \include "chord-modifiers-init.ly"
35 \include "script-init.ly"
36
37 \include "chord-repetition-init.ly"
38
39 #(define default-fret-table (make-hash-table 101))
40 #(define chord-shape-table (make-hash-table 29))
41 #(call-after-session
42   (lambda ()
43    (hash-clear! default-fret-table)
44    (hash-clear! chord-shape-table)))
45
46 % declarations for standard directions
47 left = #-1
48 right = #1
49 up = #1
50 down = #-1
51 start = #-1
52 stop = #1
53 smaller = #-1
54 bigger = #1
55 center = #0
56
57 %% FIXME
58 %% should also set \override Beam.breakable, but how to do it "portably"? (ie. also
59 %% working with lyric sections)
60 %%
61 %% try \once \override Score.Beam.breakable = ##t
62
63 %% rather name \newline, \pageBreak ?
64 break = #(make-music 'LineBreakEvent 'break-permission 'force)
65 noBreak = #(make-music 'LineBreakEvent 'break-permission '())
66 %% \pageBreak, \noPageBreak, \pageTurn, \noPageTurn, \allowPageTurn are defined
67 %% as music functions
68
69 stopStaff = #(make-span-event 'StaffSpanEvent STOP)
70 startStaff = #(make-span-event 'StaffSpanEvent START)
71
72
73 %
74 % Code articulation definitions
75 %
76 noBeam = #(make-music 'BeamForbidEvent)
77 "|" = #(make-music 'BarCheck)
78 "[" = #(make-span-event 'BeamEvent START)
79 "]" = #(make-span-event 'BeamEvent STOP)
80 "~" = #(make-music 'TieEvent)
81 "(" =  #(make-span-event 'SlurEvent START)
82 ")" = #(make-span-event 'SlurEvent STOP)
83 "\\!" = #(make-span-event 'CrescendoEvent STOP)
84 "\\(" = #(make-span-event 'PhrasingSlurEvent START)
85 "\\)" = #(make-span-event 'PhrasingSlurEvent STOP)
86 "\\>" = #(make-span-event 'DecrescendoEvent START)
87 "\\<" = #(make-span-event 'CrescendoEvent START)
88 "\\[" = #(make-span-event 'LigatureEvent START)
89 "\\]" = #(make-span-event 'LigatureEvent STOP)
90 "\\~" = #(make-music 'PesOrFlexaEvent)
91 "\\\\" = #(make-music 'VoiceSeparator)
92
93
94 \include "scale-definitions-init.ly"
95
96 melisma = #(context-spec-music (make-property-set 'melismaBusy #t) 'Bottom)
97 melismaEnd = #(context-spec-music (make-property-unset 'melismaBusy) 'Bottom)
98
99 laissezVibrer = #(make-music 'LaissezVibrerEvent)
100 repeatTie = #(make-music 'RepeatTieEvent)
101
102 \include "dynamic-scripts-init.ly"
103 \include "spanners-init.ly"
104
105 %% MAKE-HASH-TABLE in GUILE 1.6 takes mandatory size parameter.
106 #(define musicQuotes (make-hash-table 29))
107 #(call-after-session
108   (lambda ()
109    (hash-clear! musicQuotes)))
110
111 #(define toplevel-book-handler print-book-with-defaults)
112 #(define toplevel-bookpart-handler collect-bookpart-for-book)
113 #(define toplevel-music-handler collect-music-for-book)
114 #(define toplevel-score-handler collect-scores-for-book)
115 #(define toplevel-text-handler collect-scores-for-book)
116
117 #(define book-bookpart-handler ly:book-add-bookpart!)
118 #(define book-music-handler collect-book-music-for-book)
119 #(define book-score-handler ly:book-add-score!)
120 #(define book-text-handler ly:book-add-score!)
121
122 #(define bookpart-score-handler ly:book-add-score!)
123 #(define bookpart-text-handler ly:book-add-score!)
124 #(define bookpart-music-handler collect-book-music-for-book)
125 #(define output-def-music-handler context-defs-from-music)
126 #(define context-mod-music-handler context-mod-from-music)
127
128 \include "predefined-fretboards-init.ly"
129 \include "string-tunings-init.ly"
130 \include "property-init.ly"
131
132 \include "grace-init.ly"
133 \include "midi-init.ly"
134 \include "paper-defaults-init.ly"
135 \include "context-mods-init.ly"
136
137 \layout {
138   mm = #(ly:output-def-lookup $defaultpaper 'mm)
139   unit = #(ly:output-def-lookup $defaultpaper 'unit)
140
141   in = #(* 25.4 mm)
142   pt = #(/ in 72.27)
143   cm = #(* 10 mm)
144
145   \include "engraver-init.ly"
146
147   #(set-paper-dimension-variables (current-module))
148 }
149
150 #(set-default-paper-size (ly:get-option 'paper-size))
151 partCombineListener = \layout {
152   \context {
153     \Score
154     skipTypesetting = ##t
155     ignoreBarChecks = ##t
156     \alias "Timing"
157   }
158 }
159
160 setDefaultDurationToQuarter = { c4 }