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