]> git.donarmstrong.com Git - lilypond.git/blob - scm/define-music-properties.scm
Merge branch 'lilypond/translation' of ssh://git.sv.gnu.org/srv/git/lilypond into...
[lilypond.git] / scm / define-music-properties.scm
1 ;;;; This file is part of LilyPond, the GNU music typesetter.
2 ;;;;
3 ;;;; Copyright (C) 1998--2011  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 (define (music-property-description symbol type? description)
20   (if (not (equal? #f (object-property symbol 'music-doc)))
21       (ly:error (_ "symbol ~S redefined") symbol))
22   (set-object-property! symbol 'music-type? type?)
23   (set-object-property! symbol 'music-doc description)
24   symbol)
25
26 (define-public all-music-properties
27   (map
28    (lambda (x) (apply music-property-description x))
29    `(
30      (absolute-octave ,integer?
31                       "The absolute octave for a octave check note.")
32      (alteration ,number? "Alteration for figured bass.")
33      (articulation-type ,string? "Key for script definitions alist.
34
35 TODO: Consider making type into symbol.")
36      (articulations ,ly:music-list?
37                     "Articulation events specifically for this note.")
38      (associated-context ,string? "Name of the Voice context associated with
39 this @code{\\lyricsto} section.")
40      (augmented ,boolean? "This figure is for an augmented figured bass
41 (with @code{+} sign).")
42      (augmented-slash ,boolean? "This figure is for an augmented figured bass
43 (back-slashed number).")
44      (automatically-numbered ,boolean? "Should a footnote be automatically
45 numbered?")
46      (autosplit-end ,boolean? "Duration of event was truncated by automatic
47 splitting in @code{Completion_heads_engraver}.")
48
49      (bass ,boolean? "Set if this note is a bass note in a chord.")
50      (beat-structure ,list? "A beatStructure to be used in autobeaming.")
51      (bracket-start ,boolean? "Start a bracket here.
52
53 TODO: Use SpanEvents?")
54      (bracket-stop ,boolean? "Stop a bracket here.")
55      (break-penalty ,number? "Penalty for line break hint.")
56      (break-permission ,symbol?
57                        "Whether to allow, forbid or force a line break.")
58
59      (cautionary ,boolean? "If set, this alteration needs a
60 cautionary accidental.")
61      (change-to-id ,string? "Name of the context to change to.")
62      (change-to-type ,symbol? "Type of the context to change to.")
63      (compress-procedure ,procedure? "Compress this music expression.
64 Arg@tie{}1: the music, arg@tie{}2: factor.")
65      (context-id ,string? "Name of context.")
66      (context-type ,symbol?  "Type of context.")
67      (create-new ,boolean? "Create a fresh context.")
68
69      (delta-step ,number? "How much should a fall change pitch?")
70      (denominator ,integer? "Denominator in a time signature.")
71      (descend-only ,boolean? "If set, this @code{\\context} only descends
72 in the context tree.")
73      (digit ,integer? "Digit for fingering.")
74      (diminished ,boolean? "This bass figure should be slashed.")
75      (direction ,ly:dir? "Print this up or down?")
76      (drum-type ,symbol? "Which percussion instrument to play this note on.")
77      (duration ,ly:duration? "Duration of this note or lyric.")
78
79      (element ,ly:music? "The single child of a Music_wrapper music object,
80 or the body of a repeat.")
81      (elements ,ly:music-list? "A list of elements for sequential of
82 simultaneous music, or the alternatives of repeated music.")
83      (elements-callback ,procedure? "Return a list of children, for use by
84 a sequential iterator.  Takes a single music parameter.")
85      (error-found ,boolean?
86                   "If true, a parsing error was found in this expression.")
87
88      (figure ,integer? "A bass figure.")
89      (footnote-text ,markup? "Text to appear in a footnote.")
90      (force-accidental ,boolean? "If set, a cautionary accidental should
91 always be printed on this note.")
92      (forced-type ,symbol? "Override for the part-combiner.")
93
94      (grob-property ,symbol? "The symbol of the grob property to set.")
95      (grob-property-path ,list? "A list of symbols, locating a nested grob
96 property, e.g., @code{(beamed-lengths details)}.")
97      (grob-value ,scheme? "The value of the grob property to set.")
98
99      (input-tag ,scheme? "Arbitrary marker to relate input and output.")
100      (inversion ,boolean? "If set, this chord note is inverted.")
101      (iterator-ctor ,procedure? "Function to construct a
102 @code{music-event-iterator} object for this music.")
103
104      (label ,markup? "Label of a mark.")
105      (last-pitch ,ly:pitch? "The last pitch after relativization.")
106      (length ,ly:moment? "The duration of this music.")
107      (length-callback ,procedure? "How to compute the duration of this music.
108 This property can only be defined as initializer in
109 @file{scm/@/define-music-types.scm}.")
110      (line-break-permission ,symbol? "When the music is at top-level,
111 whether to allow, forbid or force a line break.")
112
113      (metronome-count ,number-or-pair? "How many beats in a minute?")
114
115      (name ,symbol? "Name of this music object.")
116      (no-continuation ,boolean? "If set, disallow continuation lines.")
117      (numerator ,integer? "Numerator of a time signature.")
118
119      (octavation ,integer? "This pitch was octavated by how many octaves?
120 For chord inversions, this is negative.")
121      (once ,boolean? "Apply this operation only during one time step?")
122      (origin ,ly:input-location? "Where was this piece of music defined?")
123      (original-chord ,ly:music? "Original chord of a repeated chord.
124 Used by repeated chords in \\relative mode, to determine the first note octave")
125      (ottava-number ,integer? "The octavation for @code{\\ottava}.")
126
127      (page-break-permission ,symbol? "When the music is at top-level,
128 whether to allow, forbid or force a page break.")
129      (page-label ,symbol? "The label of a page marker.")
130      (page-marker ,boolean? "If true, and the music expression is found at
131 top-level, a page marker object is instanciated instead of a score.")
132      (page-turn-permission ,symbol? "When the music is at top-level,
133 whether to allow, forbid or force a page turn.")
134      (parenthesize ,boolean? "Enclose resulting objects in parentheses?")
135      (partial-duration ,ly:duration? "The length of a partial measure as a
136 duration.")
137      (part-combine-status ,symbol? "Change to what kind of state?
138 Options are @code{solo1}, @code{solo2} and @code{unisono}.")
139      (pitch ,ly:pitch? "The pitch of this note.")
140      (pitch-alist ,list? "A list of pitches jointly forming the scale
141 of a key signature.")
142      (pop-first ,boolean? "Do a revert before we try to do a override
143 on some grob property.")
144      (prob-property ,symbol? "The symbol of the prob property to set.")
145      (procedure ,procedure? "The function to run with @code{\\applycontext}.
146 It must take a single argument, being the context.")
147      (property-operations ,list? "Do these operations for instantiating
148 the context.")
149
150      (quoted-context-id ,string? "The ID of the context to direct quotes to,
151 e.g., @code{cue}.")
152      (quoted-context-type ,symbol? "The name of the context to
153 direct quotes to, e.g., @code{Voice}.")
154      (quoted-events ,vector? "A vector of with @code{moment} and
155 @code{event-list} entries.")
156      (quoted-music-clef ,string? "The clef of the voice to quote.")
157      (quoted-music-name ,string? "The name of the voice to quote.")
158      (quoted-transposition ,ly:pitch? "The pitch used for the quote,
159 overriding @code{\\transposition}.")
160      (quoted-voice-direction ,ly:dir? "Should the quoted voice be up-stem
161 or down-stem?")
162
163      (repeat-count ,integer? "Do a @code{\\repeat} how often?")
164
165      (slash-count ,integer? "The number of slashes in a single-beat repeat.
166 If zero, signals a beat containing varying durations.")
167      (span-direction ,ly:dir? "Does this start or stop a spanner?")
168      (span-type ,symbol? "What kind of dynamic spanner should be created?
169 Options are @code{'text} and @code{'hairpin}.")
170      (span-text ,markup? "The displayed text for dynamic text spanners
171 (e.g., cresc.)")
172      (spanner-id ,string? "Identifier to distinguish concurrent spanners.")
173      (split-list ,list? "Splitting moments for part combiner.")
174      (start-callback ,procedure? "Function to compute the negative length
175 of starting grace notes.  This property can only be defined as initializer
176 in @file{scm/@/define-music-types.scm}.")
177      (string-number ,integer? "The number of the string in
178 a @code{StringNumberEvent}.")
179      (symbol ,symbol? "Grob name to perform an override or revert on.")
180
181      (tags ,list? "List of symbols that for denoting extra details, e.g.,
182 @code{\\tag #'part @dots{}} could tag a piece of music as only being active
183 in a part.")
184      (tempo-unit ,ly:duration? "The unit for the metronome count.")
185      (text ,markup? "Markup expression to be printed.")
186      (to-relative-callback ,procedure? "How to transform a piece of music
187 to relative pitches.")
188      (tonic ,ly:pitch? "Base of the scale.")
189      (tremolo-type ,integer? "Speed of tremolo, e.g., 16 for @code{c4:16}.")
190      (trill-pitch ,ly:pitch? "Pitch of other note of the trill.")
191      (tweaks ,list? "An alist of properties to override in the backend
192 for the grob made of this event.")
193      (type ,symbol? "The type of this music object.
194 Determines iteration in some cases.")
195      (types ,list? "The types of this music object; determines by what
196 engraver this music expression is processed.")
197
198      (untransposable ,boolean? "If set, this music is not transposed.")
199
200      (value ,scheme? "Assignment value for a translation property.")
201      (void ,boolean? "If this property is @code{#t}, then the
202 music expression is to be discarded by the toplevel music handler.")
203
204      (what ,symbol? "What to change for auto-change.
205
206 FIXME: Naming.")
207
208      (X-offset ,number?
209                "Offset of resulting grob; only used for balloon texts.")
210
211      (Y-offset ,number?
212                "Offset of resulting grob; only used for balloon texts.")
213     )))