]> git.donarmstrong.com Git - lilypond.git/blob - scm/define-music-types.scm
184b4e54850ad3eb911120d05a40fc71c60ffd5a
[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 an 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 post-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 \n(@code{^} for up or @code{_} for down), or LilyPond's choice\
77 \n(no direction specified), and where @code{y} is an articulation\
78 \n(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         (iterator-ctor . ,ly:rhythmic-music-iterator::constructor)
137         (types . (general-music cluster-note-event melodic-event
138                                 rhythmic-event event))
139         ))
140
141     (CompletizeExtenderEvent
142      . ((description . "Used internally to signal the end of a lyrics block to
143 ensure extenders are completed correctly when a @code{Lyrics} context ends
144 before its associated @code{Voice} context.")
145         (types . (general-music completize-extender-event event))
146         ))
147
148     (ContextChange
149      . ((description . "Change staves in Piano staff.
150
151 Syntax: @code{\\change Staff = @var{new-id}}")
152         (iterator-ctor . ,ly:change-iterator::constructor)
153         (types . (general-music translator-change-instruction))
154         ))
155
156     (ContextSpeccedMusic
157      . ((description . "Interpret the argument music within a
158 specific context.")
159         (iterator-ctor . ,ly:context-specced-music-iterator::constructor)
160         (length-callback . ,ly:music-wrapper::length-callback)
161         (start-callback . ,ly:music-wrapper::start-callback)
162         (types . (context-specification general-music music-wrapper-music))
163         ))
164
165     (CrescendoEvent
166      . ((description . "Begin or end a crescendo.
167
168 Syntax: @var{note}@code{\\<} @dots{} @var{note}@code{\\!}
169
170 An alternative syntax is @var{note}@code{\\cr} @dots{}
171 @var{note}@code{\\endcr}.")
172         (types . (general-music post-event span-event span-dynamic-event crescendo-event
173                                 event))
174         ))
175
176     (DecrescendoEvent
177      . ((description . "Begin or end a decrescendo.
178
179 Syntax: @var{note}@code{\\>} @dots{} @var{note}@code{\\!}
180
181 An alternative syntax is @var{note}@code{\\decr} @dots{}
182 @var{note}@code{\\enddecr}.")
183         (types . (general-music post-event span-event span-dynamic-event decrescendo-event
184                                 event))
185         ))
186
187     (DoublePercentEvent
188      . ((description . "Used internally to signal double percent repeats.")
189         (types . (general-music event double-percent-event rhythmic-event))
190         ))
191
192     (EpisemaEvent
193      . ((description . "Begin or end an episema.")
194         (types . (general-music post-event span-event event episema-event))
195         ))
196
197     (Event
198      . ((description . "Atomic music event.")
199         (types . (general-music event))
200         ))
201
202     (EventChord
203      . ((description . "Explicitly entered chords.
204
205 When iterated, @code{elements} are converted to events at the current
206 timestep, followed by any @code{articulations}.  Per-chord postevents
207 attached by the parser just follow any rhythmic events in
208 @code{elements} instead of utilizing @code{articulations}.
209
210 An unexpanded chord repetition @samp{q} is recognizable by having its
211 duration stored in @code{duration}.")
212         (iterator-ctor . ,ly:event-chord-iterator::constructor)
213         (length-callback . ,ly:music-sequence::event-chord-length-callback)
214         (to-relative-callback .
215                               ,ly:music-sequence::event-chord-relative-callback)
216         (types . (general-music event-chord simultaneous-music))
217         ))
218
219     (ExtenderEvent
220      . ((description . "Extend lyrics.")
221         (types . (general-music post-event extender-event event))
222         ))
223
224     (FingeringEvent
225      . ((description . "Specify what finger to use for this note.")
226         (types . (general-music post-event fingering-event event))
227         ))
228
229     (FootnoteEvent
230      . ((description . "Footnote a grob.")
231         (types . (general-music event footnote-event))
232         ))
233
234     (GlissandoEvent
235      . ((description . "Start a glissando on this note.")
236         (types . (general-music post-event glissando-event event))
237         ))
238
239     (GraceMusic
240      . ((description . "Interpret the argument as grace notes.")
241         (start-callback . ,ly:grace-music::start-callback)
242         (length . ,ZERO-MOMENT)
243         (iterator-ctor . ,ly:grace-iterator::constructor)
244         (types . (grace-music music-wrapper-music general-music))
245         ))
246
247     (HarmonicEvent
248      . ((description . "Mark a note as harmonic.")
249         (types . (general-music post-event event harmonic-event))
250         ))
251
252     (HyphenEvent
253      . ((description . "A hyphen between lyric syllables.")
254         (types . (general-music post-event hyphen-event event))
255         ))
256
257     (KeyChangeEvent
258      . ((description . "Change the key signature.
259
260 Syntax: @code{\\key} @var{name} @var{scale}")
261         (to-relative-callback . ,(lambda (x p) p))
262         (types . (general-music key-change-event event))
263         ))
264
265     (LabelEvent
266      . ((description . "Place a bookmarking label.")
267         (types . (general-music label-event event))
268         ))
269
270     (LaissezVibrerEvent
271      . ((description . "Don't damp this chord.
272
273 Syntax: @var{note}@code{\\laissezVibrer}")
274         (types . (general-music post-event event laissez-vibrer-event))
275         ))
276
277     (LigatureEvent
278      . ((description . "Start or end a ligature.")
279         (types . (general-music span-event ligature-event event))
280         ))
281
282     (LineBreakEvent
283      . ((description . "Allow, forbid or force a line break.")
284         (types . (general-music line-break-event break-event event))
285         ))
286
287     (LyricCombineMusic
288      . ((description . "Align lyrics to the start of notes.
289
290 Syntax: @code{\\lyricsto} @var{voicename} @var{lyrics}")
291         (length . ,ZERO-MOMENT)
292         (types . (general-music lyric-combine-music))
293         (iterator-ctor . ,ly:lyric-combine-music-iterator::constructor)
294         ))
295
296     (LyricEvent
297      . ((description . "A lyric syllable.  Must be entered in lyrics mode,
298 i.e., @code{\\lyrics @{ twinkle4 twinkle4 @} }.")
299         (iterator-ctor . ,ly:rhythmic-music-iterator::constructor)
300         (types . (general-music rhythmic-event lyric-event event))
301         ))
302
303     (MarkEvent
304      . ((description . "Insert a rehearsal mark.
305
306 Syntax: @code{\\mark} @var{marker}
307
308 Example: @code{\\mark \"A\"}")
309         (types . (general-music mark-event event))
310         ))
311
312     (MeasureCounterEvent
313      . ((description . "Used to signal the start and end of a measure count.")
314         (types . (general-music measure-counter-event span-event event))
315         ))
316
317     (MultiMeasureRestEvent
318      . ((description . "Used internally by @code{MultiMeasureRestMusic}
319 to signal rests.")
320         (types . (general-music event rhythmic-event
321                                 multi-measure-rest-event))
322         ))
323
324     (MultiMeasureRestMusic
325      . ((description . "Rests that may be compressed into Multi rests.
326
327 Syntax: @code{R2.*4} for 4 measures in 3/4 time.")
328         (iterator-ctor . ,ly:sequential-iterator::constructor)
329         (elements-callback . ,mm-rest-child-list)
330         (types . (general-music multi-measure-rest))
331         ))
332
333     (MultiMeasureTextEvent
334      . ((description . "Texts on multi measure rests.
335
336 Syntax: @code{R-\\markup @{ \\roman \"bla\" @}}
337
338 Note the explicit font switch.")
339         (types . (general-music post-event event multi-measure-text-event))
340         ))
341
342     (Music
343      . ((description . "Generic type for music expressions.")
344         (types . (general-music))
345         ))
346
347     (NoteEvent
348      . ((description . "A note.
349
350 Outside of chords, any events in @code{articulations} with a listener
351 are broadcast like chord articulations, the others are retained.
352
353 For iteration inside of chords, @xref{EventChord}.")
354         (iterator-ctor . ,ly:rhythmic-music-iterator::constructor)
355         (types . (general-music event note-event rhythmic-event
356                                 melodic-event))
357         ))
358
359     (NoteGroupingEvent
360      . ((description . "Start or stop grouping brackets.")
361         (types . (general-music post-event event note-grouping-event))
362         ))
363
364     (OttavaMusic
365      . ((description . "Start or stop an ottava bracket.")
366         (iterator-ctor . ,ly:sequential-iterator::constructor)
367         (elements-callback . ,make-ottava-set)
368         (types . (general-music ottava-music))
369         ))
370
371     (OverrideProperty
372      . ((description . "Extend the definition of a graphical object.
373
374 Syntax: @code{\\override} [ @var{context} @code{.} ]
375 @var{object} @var{property} @code{=} @var{value}")
376         (types . (general-music layout-instruction-event
377                                 override-property-event))
378         (iterator-ctor . ,ly:push-property-iterator::constructor)
379         (untransposable . #t)
380         ))
381
382     (PageBreakEvent
383      . ((description . "Allow, forbid or force a page break.")
384         (types . (general-music break-event page-break-event event))
385         ))
386
387     (PageTurnEvent
388      . ((description . "Allow, forbid or force a page turn.")
389         (types . (general-music break-event page-turn-event event))
390         ))
391
392     (PartCombineForceEvent
393      . ((description . "Override the part-combiner's strategy.")
394         (types . (general-music part-combine-force-event event))
395         ))
396
397     (PartialSet
398      . ((description . "Create an anacrusis or upbeat (partial measure).")
399         (iterator-ctor . ,ly:partial-iterator::constructor)
400         ;; The length-callback is kind of cheesy since 'elements is
401         ;; empty.  We just use that in order to get a zero length
402         ;; for the overall timing in spite of having a non-zero
403         ;; duration field.
404         (length-callback . ,ly:music-sequence::cumulative-length-callback)
405         (types . (general-music partial-set))
406         ))
407
408     (PartCombineMusic
409      . ((description . "Combine two parts on a staff, either merged or
410 as separate voices.")
411         (length-callback . ,ly:music-sequence::maximum-length-callback)
412         (start-callback . ,ly:music-sequence::minimum-start-callback)
413         (types . (general-music part-combine-music))
414         (iterator-ctor . ,ly:part-combine-iterator::constructor)
415         ))
416
417     (PercentEvent
418      . ((description . "Used internally to signal percent repeats.")
419         (types . (general-music event percent-event rhythmic-event))
420         ))
421
422     (PercentRepeatedMusic
423      . ((description . "Repeats encoded by percents and slashes.")
424         (iterator-ctor . ,ly:percent-repeat-iterator::constructor)
425         (start-callback .  ,ly:repeated-music::first-start)
426         (length-callback . ,ly:repeated-music::unfolded-music-length)
427         (types . (general-music repeated-music percent-repeated-music))
428         ))
429
430     (PesOrFlexaEvent
431      . ((description . "Within a ligature, mark the previous and the
432 following note to form a pes (if melody goes up) or a flexa (if melody
433 goes down).")
434         (types . (general-music pes-or-flexa-event event))
435         ))
436
437     (PhrasingSlurEvent
438      . ((description . "Start or end phrasing slur.
439
440 Syntax: @var{note}@code{\\(} and @var{note}@code{\\)}")
441         (spanner-id . "")
442         (types . (general-music post-event span-event event phrasing-slur-event))
443         ))
444
445     (PostEvents
446      . ((description . "Container for several postevents.
447
448 This can be used to package several events into a single one.  Should not be seen outside of the parser.")
449         (types . (post-event post-event-wrapper))))
450
451     (PropertySet
452      . ((description . "Set a context property.
453
454 Syntax: @code{\\set @var{context}.@var{prop} = @var{scheme-val}}")
455         (types . (layout-instruction-event general-music))
456         (iterator-ctor . ,ly:property-iterator::constructor)
457         (untransposable . #t)
458         ))
459
460     (PropertyUnset
461      . ((description . "Restore the default setting for a context
462 property.  See @ref{PropertySet}.
463
464 Syntax: @code{\\unset @var{context}.@var{prop}}")
465         (types . (layout-instruction-event general-music))
466         (iterator-ctor . ,ly:property-unset-iterator::constructor)
467         ))
468
469     (QuoteMusic
470      . ((description . "Quote preprocessed snippets of music.")
471         (iterator-ctor . ,ly:music-wrapper-iterator::constructor)
472         (length-callback . ,ly:music-wrapper::length-callback)
473         (start-callback . ,ly:music-wrapper::start-callback)
474         (types . (general-music music-wrapper-music))
475         ))
476
477     (RelativeOctaveCheck
478      . ((description . "Check if a pitch is in the correct octave.")
479         (to-relative-callback . ,ly:relative-octave-check::relative-callback)
480         (types . (general-music relative-octave-check))
481         ))
482
483     (RelativeOctaveMusic
484      . ((description . "Music that was entered in relative octave notation.")
485         (to-relative-callback . ,ly:relative-octave-music::relative-callback)
486         (iterator-ctor . ,ly:music-wrapper-iterator::constructor)
487         (length-callback . ,ly:music-wrapper::length-callback)
488         (start-callback . ,ly:music-wrapper::start-callback)
489         (types . (music-wrapper-music general-music relative-octave-music))
490         ))
491
492     (RepeatedMusic
493      . ((description . "Repeat music in different ways.")
494         (types . (general-music repeated-music))
495         ))
496
497     (RepeatSlashEvent
498      . ((description . "Used internally to signal beat repeats.")
499         (types . (general-music event repeat-slash-event rhythmic-event))
500         ))
501
502     (RepeatTieEvent
503      . ((description . "Ties for starting a second volta bracket.")
504         (types . (general-music post-event event repeat-tie-event))
505         ))
506
507     (RestEvent
508      . ((description . "A Rest.
509
510 Syntax: @code{r4} for a quarter rest.")
511         (iterator-ctor . ,ly:rhythmic-music-iterator::constructor)
512         (types . (general-music event rhythmic-event rest-event))
513         ))
514
515     (RevertProperty
516      . ((description . "The opposite of @ref{OverrideProperty}: remove a
517 previously added property from a graphical object definition.")
518         (types . (general-music layout-instruction-event))
519         (iterator-ctor . ,ly:pop-property-iterator::constructor)
520         ))
521
522     (ScriptEvent
523      . ((description . "Add an articulation mark to a note.")
524         (types . (general-music event))
525         ))
526
527     (SequentialMusic
528      . ((description . "Music expressions concatenated.
529
530 Syntax: @code{\\sequential @{ @dots{} @}} or simply @code{@{ @dots{} @}}")
531         (length-callback . ,ly:music-sequence::cumulative-length-callback)
532         (start-callback . ,ly:music-sequence::first-start-callback)
533         (elements-callback . ,(lambda (m) (ly:music-property m 'elements)))
534         (iterator-ctor . ,ly:sequential-iterator::constructor)
535         (types . (general-music sequential-music))
536         ))
537
538     (SimultaneousMusic
539      . ((description . "Music playing together.
540
541 Syntax: @code{\\simultaneous @{ @dots{} @}} or @code{<< @dots{} >>}")
542         (iterator-ctor . ,ly:simultaneous-music-iterator::constructor)
543         (start-callback . ,ly:music-sequence::minimum-start-callback)
544         (length-callback . ,ly:music-sequence::maximum-length-callback)
545         (to-relative-callback .
546                               ,ly:music-sequence::simultaneous-relative-callback)
547         (types . (general-music simultaneous-music))
548         ))
549
550     (SkipEvent
551      . ((description . "Filler that takes up duration, but does not
552 print anything.
553
554 Syntax: @code{s4} for a skip equivalent to a quarter rest.")
555         (iterator-ctor . ,ly:rhythmic-music-iterator::constructor)
556         (types . (general-music event rhythmic-event skip-event))
557         ))
558
559     (SkipMusic
560      . ((description . "Filler that takes up duration, does not
561 print anything, and also does not create staves or voices implicitly.
562
563 Syntax: @code{\\skip} @var{duration}")
564         (length-callback . ,ly:music-duration-length)
565         (iterator-ctor . ,ly:simple-music-iterator::constructor)
566         (types . (general-music event skip-event))
567         ))
568
569     (SlurEvent
570      . ((description . "Start or end slur.
571
572 Syntax: @var{note}@code{(} and @var{note}@code{)}")
573         (spanner-id . "")
574         (types . (general-music post-event span-event event slur-event))
575         ))
576
577     (SoloOneEvent
578      . ((description . "Print @q{Solo@tie{}1}.")
579         (part-combine-status . solo1)
580         (types . (general-music event part-combine-event solo-one-event))
581         ))
582
583     (SoloTwoEvent
584      . ((description . "Print @q{Solo@tie{}2}.")
585         (part-combine-status . solo2)
586         (types . (general-music event part-combine-event solo-two-event))
587         ))
588
589     (SostenutoEvent
590      . ((description . "Depress or release sostenuto pedal.")
591         (types . (general-music post-event event pedal-event sostenuto-event))
592         ))
593
594     (SpacingSectionEvent
595      . ((description . "Start a new spacing section.")
596         (types . (general-music event spacing-section-event))))
597
598     (SpanEvent
599      . ((description . "Event for anything that is started at a
600 different time than stopped.")
601         (types . (general-music event))
602         ))
603
604     (StaffSpanEvent
605      . ((description . "Start or stop a staff symbol.")
606         (types . (general-music event span-event staff-span-event))
607         ))
608
609     (StringNumberEvent
610      . ((description . "Specify on which string to play this note.
611
612 Syntax: @code{\\@var{number}}")
613         (types . (general-music post-event string-number-event event))
614         ))
615
616     (StrokeFingerEvent
617      . ((description . "Specify with which finger to pluck a string.
618
619 Syntax: @code{\\rightHandFinger @var{text}}")
620         (types . (general-music post-event stroke-finger-event event))
621         ))
622
623     (SustainEvent
624      . ((description . "Depress or release sustain pedal.")
625         (types . (general-music post-event event pedal-event sustain-event))
626         ))
627
628     (TempoChangeEvent
629      . ((description . "A metronome mark or tempo indication.")
630         (types . (general-music event tempo-change-event))
631         ))
632
633     (TextScriptEvent
634      . ((description . "Print text.")
635         (types . (general-music post-event script-event text-script-event event))
636         ))
637
638     (TextSpanEvent
639      . ((description . "Start a text spanner, for example, an
640 octavation.")
641         (types . (general-music post-event span-event event text-span-event))
642         ))
643
644     (TieEvent
645      . ((description . "A tie.
646
647 Syntax: @w{@var{note}@code{-~}}")
648         (types . (general-music post-event tie-event event))
649         ))
650
651     (TimeScaledMusic
652      . ((description . "Multiply durations, as in tuplets.
653
654 Syntax: @code{\\times @var{fraction} @var{music}}, e.g.,
655 @code{\\times 2/3 @{ @dots{} @}} for triplets.")
656         (length-callback . ,ly:music-wrapper::length-callback)
657         (start-callback . ,ly:music-wrapper::start-callback)
658         (iterator-ctor . ,ly:tuplet-iterator::constructor)
659         (types . (time-scaled-music music-wrapper-music general-music))
660         ))
661
662     (TimeSignatureMusic
663      . ((description . "Set a new time signature")
664         (iterator-ctor . ,ly:sequential-iterator::constructor)
665         (elements-callback . ,make-time-signature-set)
666         (types . (general-music time-signature-music))
667         ))
668
669     (TransposedMusic
670      . ((description . "Music that has been transposed.")
671         (iterator-ctor . ,ly:music-wrapper-iterator::constructor)
672         (start-callback . ,ly:music-wrapper::start-callback)
673         (length-callback . ,ly:music-wrapper::length-callback)
674         (to-relative-callback .
675                               ,ly:relative-octave-music::no-relative-callback)
676         (types . (music-wrapper-music general-music transposed-music))
677         ))
678
679     (TremoloEvent
680      . ((description . "Unmeasured tremolo.")
681         (types . (general-music post-event event tremolo-event))
682         ))
683
684     (TremoloRepeatedMusic
685      . ((description . "Repeated notes denoted by tremolo beams.")
686         (iterator-ctor . ,ly:chord-tremolo-iterator::constructor)
687         (start-callback .  ,ly:repeated-music::first-start)
688         ;; the length of the repeat is handled by shifting the note logs
689         (length-callback . ,ly:repeated-music::folded-music-length)
690         (types . (general-music repeated-music tremolo-repeated-music))
691         ))
692
693     (TremoloSpanEvent
694      . ((description . "Tremolo over two stems.")
695         (types . (general-music event span-event tremolo-span-event))
696         ))
697
698     (TrillSpanEvent
699      . ((description . "Start a trill spanner.")
700         (types . (general-music post-event span-event event trill-span-event))
701         ))
702
703     (TupletSpanEvent
704      . ((description . "Used internally to signal where tuplet
705 brackets start and stop.")
706         (types . (tuplet-span-event span-event event general-music post-event))
707         ))
708
709     (UnaCordaEvent
710      . ((description . "Depress or release una-corda pedal.")
711         (types . (general-music post-event event pedal-event una-corda-event))
712         ))
713
714     (UnfoldedRepeatedMusic
715      . ((description . "Repeated music which is fully written (and
716 played) out.")
717         (iterator-ctor . ,ly:unfolded-repeat-iterator::constructor)
718         (start-callback .  ,ly:repeated-music::first-start)
719         (types . (general-music repeated-music unfolded-repeated-music))
720         (length-callback . ,ly:repeated-music::unfolded-music-length)
721         ))
722
723     (UnisonoEvent
724      . ((description . "Print @q{a@tie{}2}.")
725         (part-combine-status . unisono)
726         (types . (general-music event part-combine-event unisono-event))))
727
728     (UnrelativableMusic
729      . ((description . "Music that cannot be converted from relative
730 to absolute notation.  For example, transposed music.")
731         (to-relative-callback . ,ly:relative-octave-music::no-relative-callback)
732         (iterator-ctor . ,ly:music-wrapper-iterator::constructor)
733         (length-callback . ,ly:music-wrapper::length-callback)
734         (types . (music-wrapper-music general-music unrelativable-music))
735         ))
736
737     (VoiceSeparator
738      . ((description . "Separate polyphonic voices in simultaneous music.
739
740 Syntax: @code{\\\\}")
741         (types . (separator general-music))
742         ))
743
744     (VoltaRepeatedMusic
745      . ((description . "Repeats with alternatives placed sequentially.")
746         (iterator-ctor . ,ly:volta-repeat-iterator::constructor)
747         (elements-callback . ,make-volta-set)
748         (start-callback .  ,ly:repeated-music::first-start)
749         (length-callback . ,ly:repeated-music::volta-music-length)
750         (types . (general-music repeated-music volta-repeated-music))
751         ))
752     ))
753
754 (set! music-descriptions
755       (sort music-descriptions alist<?))
756
757 (define-public music-name-to-property-table (make-hash-table 59))
758
759 ;; init hash table,
760 ;; transport description to an object property.
761 (set!
762  music-descriptions
763  (map (lambda (x)
764         (set-object-property! (car x)
765                               'music-description
766                               (cdr (assq 'description (cdr x))))
767         (let ((lst (cdr x)))
768           (set! lst (assoc-set! lst 'name (car x)))
769           (set! lst (assq-remove! lst 'description))
770           (hashq-set! music-name-to-property-table (car x) lst)
771           (cons (car x) lst)))
772       music-descriptions))
773
774 (define-safe-public (make-music name . music-properties)
775   "Create a music object of given name, and set its properties
776 according to @code{music-properties}, a list of alternating property symbols
777 and values. E.g:
778 @example
779   (make-music 'OverrideProperty
780               'symbol 'Stem
781               'grob-property 'thickness
782               'grob-value (* 2 1.5))
783 @end example
784 Instead of a successive symbol and value, an entry in the list may
785 also be an alist or a music object in which case its elements,
786 respectively its @emph{mutable} property list (properties not inherent
787 to the type of the music object) will get taken.
788
789 The argument list will be interpreted left-to-right, so later entries
790 override earlier ones."
791   (if (not (symbol? name))
792       (ly:error (_ "symbol expected: ~S") name))
793   (let ((props (hashq-ref music-name-to-property-table name '())))
794     (if (not (pair? props))
795         (ly:error (_ "cannot find music object: ~S") name))
796     (let ((m (ly:make-music props)))
797       (define (alist-set-props lst)
798         (for-each (lambda (e)
799                     (set! (ly:music-property m (car e)) (cdr e)))
800                   (reverse lst)))
801       (define (set-props mus-props)
802         (if (pair? mus-props)
803             (let ((e (car mus-props))
804                   (mus-props (cdr mus-props)))
805               (cond ((symbol? e)
806                      (set! (ly:music-property m e) (car mus-props))
807                      (set-props (cdr mus-props)))
808                     ((ly:music? e)
809                      (alist-set-props (ly:music-mutable-properties e))
810                      (set-props mus-props))
811                     ((cheap-list? e)
812                      (alist-set-props e)
813                      (set-props mus-props))
814                     (else
815                      (ly:error (_ "bad make-music argument: ~S") e))))))
816       (set-props music-properties)
817       m)))
818
819 (define-public (make-repeated-music name)
820   (let* ((repeated-music (assoc-get name '(("volta" . VoltaRepeatedMusic)
821                                            ("unfold" . UnfoldedRepeatedMusic)
822                                            ("percent" . PercentRepeatedMusic)
823                                            ("tremolo" . TremoloRepeatedMusic))))
824          (repeated-music-name (if repeated-music
825                                   repeated-music
826                                   (begin
827                                     (ly:warning (_ "unknown repeat type `~S'") name)
828                                     (ly:warning (_ "See define-music-types.scm for supported repeats"))
829                                     'VoltaRepeatedMusic))))
830     (make-music repeated-music-name)))