]> git.donarmstrong.com Git - lilypond.git/blob - scm/music-types.scm
c96ea36fddc739defcf80abf5b4149dc766600de
[lilypond.git] / scm / music-types.scm
1
2 (define-public music-descriptions
3   `(
4     (ArpeggioEvent 
5      . (
6         (internal-class-name .  "Arpeggio_req")
7         (types . (general-music event))
8         ))
9     (ArticulationEvent
10      . (
11         (internal-class-name . "Articulation_req")
12         (types . (general-music event articulation-event script-event))
13         )) 
14     (BassFigureEvent
15      . (
16         (internal-class-name . "Bass_figure_req")
17         (types . (general-music event rhythmic-event bass-figure-event))
18         ))  
19     (BreakEvent
20      . (
21         (internal-class-name . "Break_req")
22
23         (types . (general-music event))
24         )) 
25     (BreathingSignEvent
26      . (
27         (internal-class-name . "Breathing_sign_req")
28
29         (types . (general-music event breathing-event))
30         )) 
31     (BusyPlayingEvent
32      . (
33         (internal-class-name . "Busy_playing_req")
34
35         (types . (general-music event busy-playing-event))
36         )) 
37     (ExtenderEvent
38      . (
39         (internal-class-name . "Extender_req")
40         (types . (general-music event))
41         ))   
42     (GlissandoEvent
43      . (
44         (internal-class-name . "Glissando_req")
45         (types . (general-music event))
46         )) 
47    (GraceMusic
48      . (
49         (internal-class-name . "Grace_music")
50         (iterator-ctor . ,Grace_iterator::constructor)
51         (types . (grace-music music-wrapper-music general-music))
52         ))
53    (HyphenEvent
54      . (
55         (internal-class-name . "Hyphen_req")
56         (types . (general-music event))
57         ))   
58     (KeyChangeEvent
59      . (
60         (internal-class-name . "Key_change_req")
61         (types . (general-music event))
62         )) 
63     (LyricEvent
64      . (
65         (internal-class-name . "Lyric_req")
66         (types . (general-music rhythmic-event event))
67         )) 
68     (MarkEvent
69      . (
70         (internal-class-name . "Mark_req")
71         (types . (general-music event))
72         ))  
73     (MelismaEvent
74      . (
75         (internal-class-name . "Melisma_playing_req")
76         (types . (general-music span-event event))
77         )) 
78     (Melisma_playingEvent
79      . (
80         (internal-class-name . "Melisma_req")
81         (types . (general-music event))
82         ))
83     (Music
84      . (
85         (internal-class-name . "Music")
86         (types . (general-music)) 
87         ))
88     (NoteEvent
89      . (
90         (internal-class-name . "Note_req")
91         (types . (general-music event rhythmic-event melodic-event))
92         ))
93     (PorrectusEvent
94      . (
95         (internal-class-name . "Porrectus_req")
96         (types . (general-music event))
97         ))
98     (RepeatedMusic
99      . (
100         (internal-class-name . "Repeated_music")
101         (type .  repeated-music)
102         (types . (general-music repeat-music))
103         ))
104     (Request
105      . (
106         (internal-class-name . "Request")
107         (types . (general-music event))
108         )) 
109     (RestEvent
110      . (
111         (internal-class-name . "Rest_req")
112         (types . (general-music event rhythmic-event ))
113         )) 
114     (RhythmicEvent
115      . (
116         (internal-class-name . "Rhythmic_req")
117         (types . (general-music rhythmic-event  event))
118         )) 
119     (SequentialMusic
120      . (
121         (internal-class-name . "Sequential_music")
122         (iterator-ctor . ,Sequential_music_iterator::constructor)
123         (types . (general-music sequential-music))
124         ))
125     (SimultaneousMusic
126      . (
127         (internal-class-name . "Simultaneous_music")
128         (iterator-ctor . ,Simultaneous_music_iterator::constructor)
129         
130         (types . (general-music simultaneous-music))
131         ))
132     (PropertySet
133      . (
134         (internal-class-name . "Music")
135         (types . (layout-instruction general-music))
136         (iterator-ctor . ,Property_iterator::constructor)
137         )
138      )
139      (PropertyUnset
140      . (
141         (internal-class-name . "Music")
142         (types . (layout-instruction general-music))
143         (iterator-ctor . ,Property_unset_iterator::constructor)
144         )
145      )
146      (VoiceSeparator
147       . (
148          (internal-class-name . "Music")
149          (types . (separator general-music))
150          ))
151      (BarCheck
152       . (
153          (internal-class-name . "Music")
154          (types . (general-music bar-check))
155          (iterator-ctor . ,Bar_check_iterator::constructor)
156          ))
157      (OverrideProperty
158       . (
159          (internal-class-name . "Music")
160          (types . (general-music layout-instruction))
161          (iterator-ctor . ,     Push_property_iterator::constructor)
162          ))
163
164      (RevertProperty
165       . (
166          (internal-class-name . "Music")
167          (types . (general-music layout-instruction))
168          (iterator-ctor . ,     Pop_property_iterator::constructor)
169          ))
170      
171     (OutputPropertySetMusic
172      . (
173         (internal-class-name . "Music")
174         (iterator-ctor . ,Output_property_music_iterator::constructor)
175         (types . (general-music layout-instruction))
176         ))
177     (ContextSpeccedMusic
178      . (
179         (internal-class-name . "Context_specced_music")
180         (types . (context-specification general-music music-wrapper-music))
181         ))
182     (AutoChangeMusic
183      . (
184         (internal-class-name . "Music_wrapper")
185         (iterator-ctor . ,Auto_change_iterator::constructor)
186         (types . (general-music music-wrapper-music auto-change-instruction))
187         ))
188     (TranslatorChange
189      . (
190         (internal-class-name . "Music")
191         (iterator-ctor . , Change_iterator::constructor)
192         (types . (general-music translator-change-instruction))
193         ))
194  
195
196     (TimeScaledMusic
197      . (
198         (internal-class-name . "Time_scaled_music")
199         (iterator-ctor . ,Time_scaled_music_iterator::constructor)
200         (types . (time-scaled-music music-wrapper-music general-music))
201         ))
202     (TransposedMusic
203      . (
204         (internal-class-name . "Transposed_music")
205         (types . (music-wrapper-music general-music transposed-music))
206         ))
207
208     (UntransposableMusic
209      . (
210         (internal-class-name . "Untransposable_music")
211         (types . (music-wrapper-music general-music untransposable-music)) 
212         ))
213
214     (UnrelativableMusic
215      . (
216         (internal-class-name . "Un_relativable_music")
217         (types . (music-wrapper-music general-music unrelativable-music))
218         ))
219
220     (RelativeOctaveMusic
221      . (
222         (internal-class-name . "Relative_octave_music")
223         (types . (music-wrapper-music general-music relative-octave-music))
224         ))
225
226     (LyricCombineMusic
227      . (
228         (internal-class-name . "Lyric_combine_music")
229         (types . (general-music lyric-combine-music))
230         (iterator-ctor . ,Lyric_combine_music_iterator::constructor)
231         ))
232
233     (PartCombineMusic
234      . (
235         (internal-class-name . "Part_combine_music")
236         (types . (general-music part-combine-music))
237         (iterator-ctor . ,Part_combine_music_iterator::constructor)
238      ))
239     (RequestChord
240      . (
241         (internal-class-name . "Request_chord")
242         (iterator-ctor . ,Request_chord_iterator::constructor)
243         (types . (general-music simultaneous-music))
244         )
245      )
246      
247     (ScriptEvent
248      . (
249         (internal-class-name . "Script_req")
250
251         (types . (general-music event))
252         )) 
253     (SkipEvent
254      . (
255         (internal-class-name . "Skip_req")
256
257         (types . (general-music event rhythmic-event ))
258         )) 
259     (SpanEvent
260      . (
261         (internal-class-name . "Span_req")
262         (types . (general-music event))
263         )) 
264     (StringNumberEvent
265      . (
266         (internal-class-name . "String_number_req")
267
268         (types . (general-music event))
269         )) 
270     (TempoEvent
271      . (
272         (internal-class-name . "Tempo_req")
273
274         (types . (general-music event))
275         )) 
276     (TextScriptEvent
277      . (
278         (internal-class-name . "Text_script_req")
279         (types . (general-music script-event text-script-event event))
280         )) 
281     (TieEvent
282      . (
283         (internal-class-name . "Tie_req")
284         (types . (general-music tie-event event))
285         ))
286     ))
287
288
289
290 (define music-name-to-property-table (make-vector 59))
291 (map (lambda (x)
292        (hashq-set! music-name-to-property-table (car x) (cdr x))
293        )
294      music-descriptions)
295
296 (define-public (make-music-by-name x)
297   (if (not (symbol? x))
298       (misc-error "Not a symbol: ~s" x))
299   (let*
300       (
301        (props (hashq-ref music-name-to-property-table x '()))
302        (name (if (pair? props) (cdr (assoc 'internal-class-name props)) "Music"))
303        )
304 ,
305     (if (eq? props '())
306         (ly-warn (format "Could not find music type `~a'" x)))  
307     (ly-make-bare-music name props)
308   ))