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