]> git.donarmstrong.com Git - lilypond.git/blob - scm/define-music-types.scm
Define a post-event music type and let post-event? and ly:event? use it.
[lilypond.git] / scm / define-music-types.scm
1 ;;;; This file is part of LilyPond, the GNU music typesetter.
2 ;;;;
3 ;;;; Copyright (C) 1998--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 ; for define-safe-public when byte-compiling using Guile V2
20 (use-modules (scm safe-utility-defs))
21
22 ;; TODO: should link back into user manual.
23
24 (define-public music-descriptions
25   `(
26     (AbsoluteDynamicEvent
27      . ((description . "Create a dynamic mark.
28
29 Syntax: @var{note}@code{\\x}, where @code{\\x} is a dynamic mark like
30 @code{\\ppp} or @code{\\sfz}.  A complete list is in file
31 @file{ly/@/dynamic-scripts-init.ly}.")
32         (types . (general-music post-event event dynamic-event absolute-dynamic-event))
33         ))
34
35     (AlternativeEvent
36      . ((description . "Create a alternative event.")
37         (types . (general-music event alternative-event))
38         ))
39
40     (AnnotateOutputEvent
41      . ((description . "Print an annotation of an output element.")
42         (types . (general-music event annotate-output-event))
43         ))
44
45     (ApplyContext
46      . ((description . "Call the argument with the current context during
47 interpreting phase.")
48         (types . (general-music apply-context))
49         (iterator-ctor . ,ly:apply-context-iterator::constructor)
50         ))
51
52     (ApplyOutputEvent
53      . ((description . "Call the argument with all current grobs during
54 interpreting phase.
55
56 Syntax: @code{\\applyOutput #'@var{context} @var{func}}
57
58 Arguments to @var{func} are 1.@tie{}the grob, 2.@tie{}the originating
59 context, and 3.@tie{}the context where @var{func} is called.")
60         (types . (general-music event apply-output-event))
61         ))
62
63     (ArpeggioEvent
64      . ((description . "Make an arpeggio on this note.
65
66 Syntax: @w{@var{note}@code{-\\arpeggio}}")
67         (types . (general-music post-event arpeggio-event event))
68         ))
69
70     ;; todo: use articulation-event for slur as well.
71     ;; separate non articulation scripts
72     (ArticulationEvent
73      . ((description . "Add an articulation marking to a note.
74
75 Syntax: @var{note}@code{x}@code{y}, where @code{x} is a direction
76 (@code{^} for up or @code{_} for down), or LilyPond's choice
77 (no direction specified), and where @code{y} is an articulation
78 (such as @w{@code{-.}}, @w{@code{->}}, @code{\\tenuto}, @code{\\downbow}).
79 See the Notation Reference for details.")
80         (types . (general-music post-event event articulation-event script-event))
81         ))
82
83     (AutoChangeMusic
84      . ((description . "Used for making voices that switch between
85 piano staves automatically.")
86         (iterator-ctor . ,ly:auto-change-iterator::constructor)
87         (start-callback . ,ly:music-wrapper::start-callback)
88         (length-callback . ,ly:music-wrapper::length-callback)
89         (types . (general-music music-wrapper-music auto-change-instruction))
90         ))
91
92     (BarCheck
93      . ((description . "Check whether this music coincides with
94 the start of the measure.")
95         (types . (general-music bar-check))
96         (iterator-ctor . ,ly:bar-check-iterator::constructor)
97         ))
98
99     (BassFigureEvent
100      . ((description . "Print a bass-figure text.")
101         (types . (general-music event rhythmic-event bass-figure-event))
102         ))
103
104     (BeamEvent
105      . ((description . "Start or stop a beam.
106
107 Syntax for manual control: @code{c8-[ c c-] c8}")
108         (types . (general-music post-event event beam-event span-event))
109         ))
110
111     (BeamForbidEvent
112      . ((description . "Specify that a note may not auto-beamed.")
113         (types . (general-music post-event event beam-forbid-event))
114         ))
115
116     (BreakDynamicSpanEvent
117      . ((description . "End an alignment spanner for dynamics here.")
118         (types . (general-music post-event break-span-event break-dynamic-span-event event))
119         ))
120
121     (BendAfterEvent
122      . ((description . "A drop/@/fall/@/doit jazz articulation.")
123         (types . (general-music post-event bend-after-event event))))
124
125     (BreathingEvent
126      . ((description . "Create a @q{breath mark} or @q{comma}.
127
128 Syntax: @var{note}@code{\\breathe}")
129
130         (types . (general-music event breathing-event))
131         ))
132
133     (ClusterNoteEvent
134      . ((description . "A note that is part of a cluster.")
135         ;; not a note-event, to ensure that Note_heads_engraver doesn't eat it.
136         (types . (general-music cluster-note-event melodic-event
137                   rhythmic-event event))
138         ))
139
140     (CompletizeExtenderEvent
141      . ((description . "Used internally to signal the end of a lyrics block to
142 ensure extenders are completed correctly when a @code{Lyrics} context ends
143 before its associated @code{Voice} context.")
144         (types . (general-music completize-extender-event event))
145         ))
146
147     (ContextChange
148      . ((description . "Change staves in Piano staff.
149
150 Syntax: @code{\\change Staff = @var{new-id}}")
151         (iterator-ctor . ,ly:change-iterator::constructor)
152         (types . (general-music translator-change-instruction))
153         ))
154
155     (ContextSpeccedMusic
156      . ((description . "Interpret the argument music within a
157 specific context.")
158         (iterator-ctor . ,ly:context-specced-music-iterator::constructor)
159         (length-callback . ,ly:music-wrapper::length-callback)
160         (start-callback . ,ly:music-wrapper::start-callback)
161         (types . (context-specification general-music music-wrapper-music))
162         ))
163
164     (CrescendoEvent
165      . ((description . "Begin or end a crescendo.
166
167 Syntax: @var{note}@code{\\<} @dots{} @var{note}@code{\\!}
168
169 An alternative syntax is @var{note}@code{\\cr} @dots{}
170 @var{note}@code{\\endcr}.")
171         (types . (general-music post-event span-event span-dynamic-event crescendo-event
172                   event))
173         ))
174
175     (DecrescendoEvent
176      . ((description . "Begin or end a decrescendo.
177
178 Syntax: @var{note}@code{\\>} @dots{} @var{note}@code{\\!}
179
180 An alternative syntax is @var{note}@code{\\decr} @dots{}
181 @var{note}@code{\\enddecr}.")
182         (types . (general-music post-event span-event span-dynamic-event decrescendo-event
183                   event))
184         ))
185
186     (DoublePercentEvent
187      . ((description . "Used internally to signal double percent repeats.")
188         (types . (general-music event double-percent-event rhythmic-event))
189         ))
190
191     (EpisemaEvent
192      . ((description . "Begin or end an episema.")
193         (types . (general-music post-event span-event event episema-event))
194         ))
195
196     (Event
197      . ((description . "Atomic music event.")
198         (types . (general-music event))
199         ))
200
201     (EventChord
202      . ((description . "Internally used to group a set of events.")
203         (iterator-ctor . ,ly:event-chord-iterator::constructor)
204         (length-callback . ,ly:music-sequence::maximum-length-callback)
205         (to-relative-callback .
206          ,ly:music-sequence::event-chord-relative-callback)
207         (types . (general-music event-chord simultaneous-music))
208         ))
209
210     (ExtenderEvent
211      . ((description . "Extend lyrics.")
212         (types . (general-music post-event extender-event event))
213         ))
214
215     (FingeringEvent
216      . ((description . "Specify what finger to use for this note.")
217         (types . (general-music post-event fingering-event event))
218         ))
219
220     (FootnoteEvent
221      . ((description . "Footnote a grob.")
222         (types . (general-music event footnote-event))
223         ))
224
225     (GlissandoEvent
226      . ((description . "Start a glissando on this note.")
227         (types . (general-music post-event glissando-event event))
228         ))
229
230     (GraceMusic
231      . ((description . "Interpret the argument as grace notes.")
232         (start-callback . ,ly:grace-music::start-callback)
233         (length . ,ZERO-MOMENT)
234         (iterator-ctor . ,ly:grace-iterator::constructor)
235         (types . (grace-music music-wrapper-music general-music))
236         ))
237
238     (HarmonicEvent
239      . ((description . "Mark a note as harmonic.")
240         (types . (general-music post-event event harmonic-event))
241         ))
242
243     (HyphenEvent
244      . ((description . "A hyphen between lyric syllables.")
245         (types . (general-music post-event hyphen-event event))
246         ))
247
248     (KeyChangeEvent
249      . ((description . "Change the key signature.
250
251 Syntax: @code{\\key} @var{name} @var{scale}")
252         (to-relative-callback . ,(lambda (x p) p))
253         (types . (general-music key-change-event event))
254         ))
255
256     (LabelEvent
257      . ((description . "Place a bookmarking label.")
258         (types . (general-music label-event event))
259         ))
260
261     (LaissezVibrerEvent
262      . ((description . "Don't damp this chord.
263
264 Syntax: @var{note}@code{\\laissezVibrer}")
265         (types . (general-music post-event event laissez-vibrer-event))
266         ))
267
268     (LigatureEvent
269      . ((description . "Start or end a ligature.")
270         (types . (general-music span-event ligature-event event))
271         ))
272
273     (LineBreakEvent
274      . ((description . "Allow, forbid or force a line break.")
275         (types . (general-music line-break-event break-event event))
276         ))
277
278     (LyricCombineMusic
279      . ((description . "Align lyrics to the start of notes.
280
281 Syntax: @code{\\lyricsto} @var{voicename} @var{lyrics}")
282         (length . ,ZERO-MOMENT)
283         (types . (general-music lyric-combine-music))
284         (iterator-ctor . ,ly:lyric-combine-music-iterator::constructor)
285         ))
286
287     (LyricEvent
288      . ((description . "A lyric syllable.  Must be entered in lyrics mode,
289 i.e., @code{\\lyrics @{ twinkle4 twinkle4 @} }.")
290         (types . (general-music rhythmic-event lyric-event event))
291         ))
292
293     (MarkEvent
294      . ((description . "Insert a rehearsal mark.
295
296 Syntax: @code{\\mark} @var{marker}
297
298 Example: @code{\\mark \"A\"}")
299         (types . (general-music mark-event event))
300         ))
301
302     (MultiMeasureRestEvent
303      . ((description . "Used internally by @code{MultiMeasureRestMusic}
304 to signal rests.")
305         (types . (general-music event rhythmic-event
306                   multi-measure-rest-event))
307         ))
308
309     (MultiMeasureRestMusic
310      . ((description . "Rests that may be compressed into Multi rests.
311
312 Syntax: @code{R2.*4} for 4 measures in 3/4 time.")
313         (iterator-ctor . ,ly:sequential-iterator::constructor)
314         (elements-callback . ,mm-rest-child-list)
315         (types . (general-music multi-measure-rest))
316         ))
317
318     (MultiMeasureTextEvent
319      . ((description . "Texts on multi measure rests.
320
321 Syntax: @code{R-\\markup @{ \\roman \"bla\" @}}
322
323 Note the explicit font switch.")
324         (types . (general-music post-event event multi-measure-text-event))
325         ))
326
327     (Music
328      . ((description . "Generic type for music expressions.")
329         (types . (general-music))
330         ))
331
332     (NoteEvent
333      . ((description . "A note.")
334         (types . (general-music event note-event rhythmic-event
335                   melodic-event))
336         ))
337
338     (NoteGroupingEvent
339      . ((description . "Start or stop grouping brackets.")
340         (types . (general-music post-event event note-grouping-event))
341         ))
342
343     (OttavaMusic
344      . ((description . "Start or stop an ottava bracket.")
345         (iterator-ctor . ,ly:sequential-iterator::constructor)
346         (elements-callback . ,make-ottava-set)
347         (types . (general-music ottava-music))
348         ))
349
350     (OverrideProperty
351      . ((description . "Extend the definition of a graphical object.
352
353 Syntax: @code{\\override} [ @var{context} @code{.} ]
354 @var{object} @var{property} @code{=} @var{value}")
355         (types . (general-music layout-instruction-event
356                   override-property-event))
357         (iterator-ctor . ,ly:push-property-iterator::constructor)
358         ))
359
360     (PageBreakEvent
361      . ((description . "Allow, forbid or force a page break.")
362         (types . (general-music break-event page-break-event event))
363         ))
364
365     (PageTurnEvent
366      . ((description . "Allow, forbid or force a page turn.")
367         (types . (general-music break-event page-turn-event event))
368         ))
369
370     (PartCombineForceEvent
371      . ((description . "Override the part-combiner's strategy.")
372         (types . (general-music part-combine-force-event event))
373         ))
374
375     (PartialSet
376      . ((description . "Create an anacrusis or upbeat (partial measure).")
377         (iterator-ctor . ,ly:partial-iterator::constructor)
378         (types . (general-music partial-set))
379         ))
380
381     (PartCombineMusic
382      . ((description . "Combine two parts on a staff, either merged or
383 as separate voices.")
384         (length-callback . ,ly:music-sequence::maximum-length-callback)
385         (start-callback . ,ly:music-sequence::minimum-start-callback)
386         (types . (general-music part-combine-music))
387         (iterator-ctor . ,ly:part-combine-iterator::constructor)
388         ))
389
390     (PercentEvent
391      . ((description . "Used internally to signal percent repeats.")
392         (types . (general-music event percent-event rhythmic-event))
393         ))
394
395     (PercentRepeatedMusic
396      . ((description . "Repeats encoded by percents and slashes.")
397         (iterator-ctor . ,ly:percent-repeat-iterator::constructor)
398         (start-callback .  ,ly:repeated-music::first-start)
399         (length-callback . ,ly:repeated-music::unfolded-music-length)
400         (types . (general-music repeated-music percent-repeated-music))
401         ))
402
403     (PesOrFlexaEvent
404      . ((description . "Within a ligature, mark the previous and the
405 following note to form a pes (if melody goes up) or a flexa (if melody
406 goes down).")
407         (types . (general-music pes-or-flexa-event event))
408         ))
409
410     (PhrasingSlurEvent
411      . ((description . "Start or end phrasing slur.
412
413 Syntax: @var{note}@code{\\(} and @var{note}@code{\\)}")
414         (spanner-id . "")
415         (types . (general-music post-event span-event event phrasing-slur-event))
416         ))
417
418     (PropertySet
419      . ((description . "Set a context property.
420
421 Syntax: @code{\\set @var{context}.@var{prop} = @var{scheme-val}}")
422         (types . (layout-instruction-event general-music))
423         (iterator-ctor . ,ly:property-iterator::constructor)
424         ))
425
426     (PropertyUnset
427      . ((description . "Restore the default setting for a context
428 property.  See @ref{PropertySet}.
429
430 Syntax: @code{\\unset @var{context}.@var{prop}}")
431         (types . (layout-instruction-event general-music))
432         (iterator-ctor . ,ly:property-unset-iterator::constructor)
433         ))
434
435     (QuoteMusic
436      . ((description . "Quote preprocessed snippets of music.")
437         (iterator-ctor . ,ly:music-wrapper-iterator::constructor)
438         (length-callback . ,ly:music-wrapper::length-callback)
439         (start-callback . ,ly:music-wrapper::start-callback)
440         (types . (general-music music-wrapper-music))
441         ))
442
443     (RelativeOctaveCheck
444      . ((description . "Check if a pitch is in the correct octave.")
445         (to-relative-callback . ,ly:relative-octave-check::relative-callback)
446         (types . (general-music relative-octave-check))
447         ))
448
449     (RelativeOctaveMusic
450      . ((description . "Music that was entered in relative octave notation.")
451         (to-relative-callback . ,ly:relative-octave-music::relative-callback)
452         (iterator-ctor . ,ly:music-wrapper-iterator::constructor)
453         (length-callback . ,ly:music-wrapper::length-callback)
454         (start-callback . ,ly:music-wrapper::start-callback)
455         (types . (music-wrapper-music general-music relative-octave-music))
456         ))
457
458     (RepeatedChord
459      . ((description . "A chord repetition")
460         (to-relative-callback . ,ly:music-sequence::repeated-chord-relative-callback)
461         (iterator-ctor . ,ly:music-wrapper-iterator::constructor)
462         (start-callback . ,ly:music-wrapper::start-callback)
463         (length-callback . ,ly:music-wrapper::length-callback)
464         (types . (general-music music-wrapper-music))
465         ))
466
467     (RepeatedMusic
468      . ((description . "Repeat music in different ways.")
469         (types . (general-music repeated-music))
470         ))
471
472     (RepeatSlashEvent
473      . ((description . "Used internally to signal beat repeats.")
474         (types . (general-music event repeat-slash-event rhythmic-event))
475         ))
476
477     (RepeatTieEvent
478      . ((description . "Ties for starting a second volta bracket.")
479         (types . (general-music post-event event repeat-tie-event))
480         ))
481
482     (RestEvent
483      . ((description . "A Rest.
484
485 Syntax: @code{r4} for a quarter rest.")
486         (types . (general-music event rhythmic-event rest-event))
487         ))
488
489     (RevertProperty
490      . ((description . "The opposite of @ref{OverrideProperty}: remove a
491 previously added property from a graphical object definition.")
492         (types . (general-music layout-instruction-event))
493         (iterator-ctor . ,ly:pop-property-iterator::constructor)
494         ))
495
496     (ScriptEvent
497      . ((description . "Add an articulation mark to a note.")
498         (types . (general-music event))
499         ))
500
501     (SequentialMusic
502      . ((description . "Music expressions concatenated.
503
504 Syntax: @code{\\sequential @{ @dots{} @}} or simply @code{@{ @dots{} @}}")
505         (length-callback . ,ly:music-sequence::cumulative-length-callback)
506         (start-callback . ,ly:music-sequence::first-start-callback)
507         (elements-callback . ,(lambda (m) (ly:music-property m 'elements)))
508         (iterator-ctor . ,ly:sequential-iterator::constructor)
509         (types . (general-music sequential-music))
510         ))
511
512     (SimultaneousMusic
513      . ((description . "Music playing together.
514
515 Syntax: @code{\\simultaneous @{ @dots{} @}} or @code{<< @dots{} >>}")
516         (iterator-ctor . ,ly:simultaneous-music-iterator::constructor)
517         (start-callback . ,ly:music-sequence::minimum-start-callback)
518         (length-callback . ,ly:music-sequence::maximum-length-callback)
519         (to-relative-callback .
520          ,ly:music-sequence::simultaneous-relative-callback)
521         (types . (general-music simultaneous-music))
522         ))
523
524     (SkipEvent
525      . ((description . "Filler that takes up duration, but does not
526 print anything.
527
528 Syntax: @code{s4} for a skip equivalent to a quarter rest.")
529         (types . (general-music event rhythmic-event skip-event))
530         ))
531
532     (SkipMusic
533      . ((description . "Filler that takes up duration, does not
534 print anything, and also does not create staves or voices implicitly.
535
536 Syntax: @code{\\skip} @var{duration}")
537         (length-callback . ,ly:music-duration-length)
538         (iterator-ctor . ,ly:simple-music-iterator::constructor)
539         (types . (general-music event rhythmic-event skip-event))
540         ))
541
542     (SlurEvent
543      . ((description . "Start or end slur.
544
545 Syntax: @var{note}@code{(} and @var{note}@code{)}")
546         (spanner-id . "")
547         (types . (general-music post-event span-event event slur-event))
548         ))
549
550     (SoloOneEvent
551      . ((description . "Print @q{Solo@tie{}1}.")
552         (part-combine-status . solo1)
553         (types . (general-music event part-combine-event solo-one-event))
554         ))
555
556     (SoloTwoEvent
557      . ((description . "Print @q{Solo@tie{}2}.")
558         (part-combine-status . solo2)
559         (types . (general-music event part-combine-event solo-two-event))
560         ))
561
562     (SostenutoEvent
563      . ((description . "Depress or release sostenuto pedal.")
564         (types . (general-music post-event event pedal-event sostenuto-event))
565         ))
566
567     (SpacingSectionEvent
568      . ((description . "Start a new spacing section.")
569         (types . (general-music event spacing-section-event))))
570
571     (SpanEvent
572      . ((description . "Event for anything that is started at a
573 different time than stopped.")
574         (types . (general-music event))
575         ))
576
577     (StaffSpanEvent
578      . ((description . "Start or stop a staff symbol.")
579         (types . (general-music event span-event staff-span-event))
580      ))
581
582     (StringNumberEvent
583      . ((description . "Specify on which string to play this note.
584
585 Syntax: @code{\\@var{number}}")
586         (types . (general-music post-event string-number-event event))
587         ))
588
589     (StrokeFingerEvent
590      . ((description . "Specify with which finger to pluck a string.
591
592 Syntax: @code{\\rightHandFinger @var{text}}")
593         (types . (general-music post-event stroke-finger-event event))
594         ))
595
596     (SustainEvent
597      . ((description . "Depress or release sustain pedal.")
598         (types . (general-music post-event event pedal-event sustain-event))
599         ))
600
601     (TempoChangeEvent
602      . ((description . "A metronome mark or tempo indication.")
603         (types . (general-music event tempo-change-event))
604         ))
605
606     (TextScriptEvent
607      . ((description . "Print text.")
608         (types . (general-music post-event script-event text-script-event event))
609         ))
610
611     (TextSpanEvent
612      . ((description . "Start a text spanner, for example, an
613 octavation.")
614         (types . (general-music post-event span-event event text-span-event))
615         ))
616
617     (TieEvent
618      . ((description . "A tie.
619
620 Syntax: @w{@var{note}@code{-~}}")
621         (types . (general-music post-event tie-event event))
622         ))
623
624     (TimeScaledMusic
625      . ((description . "Multiply durations, as in tuplets.
626
627 Syntax: @code{\\times @var{fraction} @var{music}}, e.g.,
628 @code{\\times 2/3 @{ @dots{} @}} for triplets.")
629         (length-callback . ,ly:music-wrapper::length-callback)
630         (start-callback . ,ly:music-wrapper::start-callback)
631         (iterator-ctor . ,ly:tuplet-iterator::constructor)
632         (types . (time-scaled-music music-wrapper-music general-music))
633         ))
634
635     (TimeSignatureMusic
636      . ((description . "Set a new time signature")
637         (iterator-ctor . ,ly:sequential-iterator::constructor)
638         (elements-callback . ,make-time-signature-set)
639         (types . (general-music time-signature-music))
640         ))
641
642     (TransposedMusic
643      . ((description . "Music that has been transposed.")
644         (iterator-ctor . ,ly:music-wrapper-iterator::constructor)
645         (start-callback . ,ly:music-wrapper::start-callback)
646         (length-callback . ,ly:music-wrapper::length-callback)
647         (to-relative-callback .
648          ,ly:relative-octave-music::no-relative-callback)
649         (types . (music-wrapper-music general-music transposed-music))
650         ))
651
652     (TremoloEvent
653      . ((description . "Unmeasured tremolo.")
654         (types . (general-music post-event event tremolo-event))
655         ))
656
657     (TremoloRepeatedMusic
658      . ((description . "Repeated notes denoted by tremolo beams.")
659         (iterator-ctor . ,ly:chord-tremolo-iterator::constructor)
660         (start-callback .  ,ly:repeated-music::first-start)
661         ;; the length of the repeat is handled by shifting the note logs
662         (length-callback . ,ly:repeated-music::folded-music-length)
663         (types . (general-music repeated-music tremolo-repeated-music))
664         ))
665
666     (TremoloSpanEvent
667      . ((description . "Tremolo over two stems.")
668         (types . (general-music event span-event tremolo-span-event))
669         ))
670
671     (TrillSpanEvent
672      . ((description . "Start a trill spanner.")
673         (types . (general-music post-event span-event event trill-span-event))
674         ))
675
676     (TupletSpanEvent
677      . ((description . "Used internally to signal where tuplet
678 brackets start and stop.")
679         (types . (tuplet-span-event span-event event general-music post-event))
680        ))
681
682     (UnaCordaEvent
683      . ((description . "Depress or release una-corda pedal.")
684         (types . (general-music post-event event pedal-event una-corda-event))
685         ))
686
687     (UnfoldedRepeatedMusic
688      . ((description . "Repeated music which is fully written
689 (and played) out.")
690         (iterator-ctor . ,ly:unfolded-repeat-iterator::constructor)
691         (start-callback .  ,ly:repeated-music::first-start)
692         (types . (general-music repeated-music unfolded-repeated-music))
693         (length-callback . ,ly:repeated-music::unfolded-music-length)
694         ))
695
696     (UnisonoEvent
697      . ((description . "Print @q{a@tie{}2}.")
698         (part-combine-status . unisono)
699         (types . (general-music event part-combine-event unisono-event))))
700
701     (UnrelativableMusic
702      . ((description . "Music that cannot be converted from relative
703 to absolute notation.  For example, transposed music.")
704         (to-relative-callback . ,ly:relative-octave-music::no-relative-callback)
705         (iterator-ctor . ,ly:music-wrapper-iterator::constructor)
706         (length-callback . ,ly:music-wrapper::length-callback)
707         (types . (music-wrapper-music general-music unrelativable-music))
708         ))
709
710     (VoiceSeparator
711      . ((description . "Separate polyphonic voices in simultaneous music.
712
713 Syntax: @code{\\\\}")
714         (types . (separator general-music))
715         ))
716
717     (VoltaRepeatedMusic
718      . ((description . "Repeats with alternatives placed sequentially.")
719         (iterator-ctor . ,ly:volta-repeat-iterator::constructor)
720         (elements-callback . ,make-volta-set)
721         (start-callback .  ,ly:repeated-music::first-start)
722         (length-callback . ,ly:repeated-music::volta-music-length)
723         (types . (general-music repeated-music volta-repeated-music))
724         ))
725     ))
726
727 (set! music-descriptions
728       (sort music-descriptions alist<?))
729
730 (define-public music-name-to-property-table (make-hash-table 59))
731
732 ;; init hash table,
733 ;; transport description to an object property.
734 (set!
735  music-descriptions
736  (map (lambda (x)
737         (set-object-property! (car x)
738                               'music-description
739                               (cdr (assq 'description (cdr x))))
740         (let ((lst (cdr x)))
741           (set! lst (assoc-set! lst 'name (car x)))
742           (set! lst (assq-remove! lst 'description))
743           (hashq-set! music-name-to-property-table (car x) lst)
744           (cons (car x) lst)))
745       music-descriptions))
746
747 (define-safe-public (make-music name . music-properties)
748   "Create a music object of given name, and set its properties
749 according to @code{music-properties}, a list of alternating property symbols
750 and values. E.g:
751   (make-music 'OverrideProperty
752               'symbol 'Stem
753               'grob-property 'thickness
754               'grob-value (* 2 1.5))"
755   (if (not (symbol? name))
756       (ly:error (_ "symbol expected: ~S") name))
757   (let ((props (hashq-ref music-name-to-property-table name '())))
758     (if (not (pair? props))
759         (ly:error (_ "cannot find music object: ~S") name))
760     (let ((m (ly:make-music props)))
761       (define (set-props mus-props)
762         (if (and (not (null? mus-props))
763                  (not (null? (cdr mus-props))))
764             (begin
765               (set! (ly:music-property m (car mus-props)) (cadr mus-props))
766               (set-props (cddr mus-props)))))
767       (set-props music-properties)
768       m)))
769
770 (define-public (make-repeated-music name)
771   (let* ((repeated-music (assoc-get name '(("volta" . VoltaRepeatedMusic)
772                                            ("unfold" . UnfoldedRepeatedMusic)
773                                            ("percent" . PercentRepeatedMusic)
774                                            ("tremolo" . TremoloRepeatedMusic))))
775          (repeated-music-name (if repeated-music
776                                   repeated-music
777                                   (begin
778                                     (ly:warning (_ "unknown repeat type `~S'") name)
779                                     (ly:warning (_ "See define-music-types.scm for supported repeats"))
780                                     'VoltaRepeatedMusic))))
781     (make-music repeated-music-name)))