]> 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         (types . (general-music span-event ligature-event event))
255         ))
256
257     (LineBreakEvent
258      . ((description . "Allow, forbid or force a line break.")
259         (types . (general-music line-break-event break-event event))
260         ))
261
262     (LyricCombineMusic
263      . ((description . "Align lyrics to the start of notes.
264
265 Syntax: @code{\\lyricsto} @var{voicename} @var{lyrics}")
266         (length . ,ZERO-MOMENT)
267         (types . (general-music lyric-combine-music))
268         (iterator-ctor . ,ly:lyric-combine-music-iterator::constructor)
269         ))
270
271     (LyricEvent
272      . ((description . "A lyric syllable.  Must be entered in lyrics mode,
273 i.e., @code{\\lyrics @{ twinkle4 twinkle4 @} }.")
274         (types . (general-music rhythmic-event lyric-event event))
275         ))
276
277     (MarkEvent
278      . ((description . "Insert a rehearsal mark.
279
280 Syntax: @code{\\mark} @var{marker}
281
282 Example: @code{\\mark \"A\"}")
283         (types . (general-music mark-event event))
284         ))
285
286     (MultiMeasureRestEvent
287      . ((description . "Used internally by @code{MultiMeasureRestMusic}
288 to signal rests.")
289         (types . (general-music event rhythmic-event
290                   multi-measure-rest-event))
291         ))
292
293     (MultiMeasureRestMusic
294      . ((description . "Rests that may be compressed into Multi rests.
295
296 Syntax: @code{R2.*4} for 4 measures in 3/4 time.")
297         (iterator-ctor . ,ly:sequential-iterator::constructor)
298         (elements-callback . ,mm-rest-child-list)
299         (types . (general-music multi-measure-rest))
300         ))
301
302     (MultiMeasureTextEvent
303      . ((description . "Texts on multi measure rests.
304
305 Syntax: @code{R-\\markup @{ \\roman \"bla\" @}}
306
307 Note the explicit font switch.")
308         (types . (general-music event multi-measure-text-event))
309         ))
310
311     (Music
312      . ((description . "Generic type for music expressions.")
313         (types . (general-music))
314         ))
315
316     (NoteEvent
317      . ((description . "A note.")
318         (types . (general-music event note-event rhythmic-event
319                   melodic-event))
320         ))
321
322     (NoteGroupingEvent
323      . ((description . "Start or stop grouping brackets.")
324         (types . (general-music event note-grouping-event))
325         ))
326
327     (OverrideProperty
328      . ((description . "Extend the definition of a graphical object.
329
330 Syntax: @code{\\override} [ @var{context} @code{.} ]
331 @var{object} @var{property} @code{=} @var{value}")
332         (types . (general-music layout-instruction-event
333                   override-property-event))
334         (iterator-ctor . ,ly:push-property-iterator::constructor)
335         ))
336
337     (PageBreakEvent
338      . ((description . "Allow, forbid or force a page break.")
339         (types . (general-music break-event page-break-event event))
340         ))
341
342     (PageTurnEvent
343      . ((description . "Allow, forbid or force a page turn.")
344         (types . (general-music break-event page-turn-event event))
345         ))
346
347     (PartCombineMusic
348      . ((description . "Combine two parts on a staff, either merged or
349 as separate voices.")
350         (length-callback . ,ly:music-sequence::maximum-length-callback)
351         (start-callback . ,ly:music-sequence::minimum-start-callback)
352         (types . (general-music part-combine-music))
353         (iterator-ctor . ,ly:part-combine-iterator::constructor)
354         ))
355
356     (PercentEvent
357      . ((description . "Used internally to signal percent repeats.")
358         (types . (general-music event percent-event rhythmic-event))
359         ))
360
361     (PercentRepeatedMusic
362      . ((description . "Repeats encoded by percents.")
363         (iterator-ctor . ,ly:percent-repeat-iterator::constructor)
364         (start-callback .  ,ly:repeated-music::first-start)
365         (length-callback . ,ly:repeated-music::unfolded-music-length)
366         (types . (general-music repeated-music percent-repeated-music))
367         ))
368
369     (PesOrFlexaEvent
370      . ((description . "Within a ligature, mark the previous and the
371 following note to form a pes (if melody goes up) or a flexa (if melody
372 goes down).")
373         (types . (general-music pes-or-flexa-event event))
374         ))
375
376     (PhrasingSlurEvent
377      . ((description . "Start or end phrasing slur.
378
379 Syntax: @var{note}@code{\\(} and @var{note}@code{\\)}")
380         (types . (general-music span-event event phrasing-slur-event))
381         ))
382
383     (PropertySet
384      . ((description . "Set a context property.
385
386 Syntax: @code{\\set @var{context}.@var{prop} = @var{scheme-val}}")
387         (types . (layout-instruction-event general-music))
388         (iterator-ctor . ,ly:property-iterator::constructor)
389         ))
390
391     (PropertyUnset
392      . ((description . "Restore the default setting for a context
393 property.  See @ref{PropertySet}.
394
395 Syntax: @code{\\unset @var{context}.@var{prop}}")
396         (types . (layout-instruction-event general-music))
397         (iterator-ctor . ,ly:property-unset-iterator::constructor)
398         ))
399
400     (QuoteMusic
401      . ((description . "Quote preprocessed snippets of music.")
402         (iterator-ctor . ,ly:music-wrapper-iterator::constructor)
403         (length-callback . ,ly:music-wrapper::length-callback)
404         (start-callback . ,ly:music-wrapper::start-callback)
405         (types . (general-music music-wrapper-music))
406         ))
407
408     (RelativeOctaveCheck
409      . ((description . "Check if a pitch is in the correct octave.")
410         (to-relative-callback . ,ly:relative-octave-check::relative-callback)
411         (types . (general-music relative-octave-check))
412         ))
413
414     (RelativeOctaveMusic
415      . ((description . "Music that was entered in relative octave notation.")
416         (to-relative-callback . ,ly:relative-octave-music::relative-callback)
417         (iterator-ctor . ,ly:music-wrapper-iterator::constructor)
418         (length-callback . ,ly:music-wrapper::length-callback)
419         (start-callback . ,ly:music-wrapper::start-callback)
420         (types . (music-wrapper-music general-music relative-octave-music))
421         ))
422
423     (RepeatedChord
424      . ((description . "A chord repetition")
425         (to-relative-callback . ,ly:music-sequence::repeated-chord-relative-callback)
426         (iterator-ctor . ,ly:music-wrapper-iterator::constructor)
427         (start-callback . ,ly:music-wrapper::start-callback)
428         (length-callback . ,ly:music-wrapper::length-callback)
429         (types . (general-music music-wrapper-music))
430         ))
431
432     (RepeatedMusic
433      . ((description . "Repeat music in different ways.")
434         (types . (general-music repeated-music))
435         ))
436
437     (RepeatTieEvent
438      . ((description . "Ties for starting a second volta bracket.")
439         (types . (general-music event repeat-tie-event))
440         ))
441
442     (RestEvent
443      . ((description . "A Rest.
444
445 Syntax: @code{r4} for a quarter rest.")
446         (types . (general-music event rhythmic-event rest-event))
447         ))
448
449     (RevertProperty
450      . ((description . "The opposite of @ref{OverrideProperty}: remove a
451 previously added property from a graphical object definition.")
452         (types . (general-music layout-instruction-event))
453         (iterator-ctor . ,ly:pop-property-iterator::constructor)
454         ))
455
456     (ScriptEvent
457      . ((description . "Add an articulation mark to a note.")
458         (types . (general-music event))
459         ))
460
461     (SequentialMusic
462      . ((description . "Music expressions concatenated.
463
464 Syntax: @code{\\sequential @{ @dots{} @}} or simply @code{@{ @dots{} @}}")
465         (length-callback . ,ly:music-sequence::cumulative-length-callback)
466         (start-callback . ,ly:music-sequence::first-start-callback)
467         (elements-callback . ,(lambda (m) (ly:music-property m 'elements)))
468         (iterator-ctor . ,ly:sequential-iterator::constructor)
469         (types . (general-music sequential-music))
470         ))
471
472     (SimultaneousMusic
473      . ((description . "Music playing together.
474
475 Syntax: @code{\\simultaneous @{ @dots{} @}} or @code{<< @dots{} >>}")
476         (iterator-ctor . ,ly:simultaneous-music-iterator::constructor)
477         (start-callback . ,ly:music-sequence::minimum-start-callback)
478         (length-callback . ,ly:music-sequence::maximum-length-callback)
479         (to-relative-callback .
480          ,ly:music-sequence::simultaneous-relative-callback)
481         (types . (general-music simultaneous-music))
482         ))
483
484     (SkipEvent
485      . ((description . "Filler that takes up duration, but does not
486 print anything.
487
488 Syntax: @code{s4} for a skip equivalent to a quarter rest.")
489         (types . (general-music event rhythmic-event skip-event))
490         ))
491
492     (SkipMusic
493      . ((description . "Filler that takes up duration, does not
494 print anything, and also does not create staves or voices implicitly.
495
496 Syntax: @code{\\skip} @var{duration}")
497         (length-callback . ,ly:music-duration-length)
498         (iterator-ctor . ,ly:simple-music-iterator::constructor)
499         (types . (general-music event rhythmic-event skip-event))
500         ))
501
502     (SlurEvent
503      . ((description . "Start or end slur.
504
505 Syntax: @var{note}@code{(} and @var{note}@code{)}")
506         (types . (general-music span-event event slur-event))
507         ))
508
509     (SoloOneEvent
510      . ((description . "Print @q{Solo@tie{}1}.")
511         (part-combine-status . solo1)
512         (types . (general-music event part-combine-event solo-one-event))
513         ))
514
515     (SoloTwoEvent
516      . ((description . "Print @q{Solo@tie{}2}.")
517         (part-combine-status . solo2)
518         (types . (general-music event part-combine-event solo-two-event))
519         ))
520
521     (SostenutoEvent
522      . ((description . "Depress or release sostenuto pedal.")
523         (types . (general-music event pedal-event sostenuto-event))
524         ))
525
526     (SpacingSectionEvent
527      . ((description . "Start a new spacing section.")
528         (types . (general-music event spacing-section-event))))
529
530     (SpanEvent
531      . ((description . "Event for anything that is started at a
532 different time than stopped.")
533         (types . (general-music event))
534         ))
535
536     (StaffSpanEvent
537      . ((description . "Start or stop a staff symbol.")
538         (types . (general-music event span-event staff-span-event))
539      ))
540
541     (StringNumberEvent
542      . ((description . "Specify on which string to play this note.
543
544 Syntax: @code{\\@var{number}}")
545         (types . (general-music string-number-event event))
546         ))
547
548     (StrokeFingerEvent
549      . ((description . "Specify with which finger to pluck a string.
550
551 Syntax: @code{\\rightHandFinger @var{text}}")
552         (types . (general-music stroke-finger-event event))
553         ))
554
555     (SustainEvent
556      . ((description . "Depress or release sustain pedal.")
557         (types . (general-music event pedal-event sustain-event))
558         ))
559
560     (TextScriptEvent
561      . ((description . "Print text.")
562         (types . (general-music script-event text-script-event event))
563         ))
564
565     (TextSpanEvent
566      . ((description . "Start a text spanner, for example, an
567 octavation.")
568         (types . (general-music span-event event text-span-event))
569         ))
570
571     (TieEvent
572      . ((description . "A tie.
573
574 Syntax: @var{note}@code{-~}")
575         (types . (general-music tie-event event))
576         ))
577
578     (TimeScaledMusic
579      . ((description . "Multiply durations, as in tuplets.
580
581 Syntax: @code{\\times @var{fraction} @var{music}}, e.g.,
582 @code{\\times 2/3 @{ @dots{} @}} for triplets.")
583         (length-callback . ,ly:music-wrapper::length-callback)
584         (start-callback . ,ly:music-wrapper::start-callback)
585         (iterator-ctor . ,ly:tuplet-iterator::constructor)
586         (types . (time-scaled-music music-wrapper-music general-music))
587         ))
588
589     (TransposedMusic
590      . ((description . "Music that has been transposed.")
591         (iterator-ctor . ,ly:music-wrapper-iterator::constructor)
592         (start-callback . ,ly:music-wrapper::start-callback)
593         (length-callback . ,ly:music-wrapper::length-callback)
594         (to-relative-callback .
595          ,ly:relative-octave-music::no-relative-callback)
596         (types . (music-wrapper-music general-music transposed-music))
597         ))
598
599     (TremoloEvent
600      . ((description . "Unmeasured tremolo.")
601         (types . (general-music event tremolo-event))
602         ))
603
604     (TremoloRepeatedMusic
605      . ((description . "Repeated notes denoted by tremolo beams.")
606         (iterator-ctor . ,ly:chord-tremolo-iterator::constructor)
607         (start-callback .  ,ly:repeated-music::first-start)
608         ;; the length of the repeat is handled by shifting the note logs
609         (length-callback . ,ly:repeated-music::folded-music-length)
610         (types . (general-music repeated-music tremolo-repeated-music))
611         ))
612
613     (TremoloSpanEvent
614      . ((description . "Tremolo over two stems.")
615         (types . (general-music event span-event tremolo-span-event))
616         ))
617
618     (TrillSpanEvent
619      . ((description . "Start a trill spanner.")
620         (types . (general-music span-event event trill-span-event))
621         ))
622
623     (TupletSpanEvent
624      . ((description . "Used internally to signal where tuplet
625 brackets start and stop.")
626         (types . (tuplet-span-event span-event event general-music))
627        ))
628
629     (UnaCordaEvent
630      . ((description . "Depress or release una-corda pedal.")
631         (types . (general-music event pedal-event una-corda-event))
632         ))
633
634     (UnfoldedRepeatedMusic
635      . ((description . "Repeated music which is fully written
636 (and played) out.")
637         (iterator-ctor . ,ly:unfolded-repeat-iterator::constructor)
638         (start-callback .  ,ly:repeated-music::first-start)
639         (types . (general-music repeated-music unfolded-repeated-music))
640         (length-callback . ,ly:repeated-music::unfolded-music-length)
641         ))
642
643     (UnisonoEvent
644      . ((description . "Print @q{a@tie{}2}.")
645         (part-combine-status . unisono)
646         (types . (general-music event part-combine-event unisono-event))))
647
648     (UnrelativableMusic
649      . ((description . "Music that cannot be converted from relative
650 to absolute notation.  For example, transposed music.")
651         (to-relative-callback . ,ly:relative-octave-music::no-relative-callback)
652         (iterator-ctor . ,ly:music-wrapper-iterator::constructor)
653         (length-callback . ,ly:music-wrapper::length-callback)
654         (types . (music-wrapper-music general-music unrelativable-music))
655         ))
656
657     (VoiceSeparator
658      . ((description . "Separate polyphonic voices in simultaneous music.
659
660 Syntax: @code{\\\\}")
661         (types . (separator general-music))
662         ))
663
664     (VoltaRepeatedMusic
665      . ((description . "Repeats with alternatives placed sequentially.")
666         (iterator-ctor . ,ly:volta-repeat-iterator::constructor)
667         (start-callback .  ,ly:repeated-music::first-start)
668         (length-callback . ,ly:repeated-music::volta-music-length)
669         (types . (general-music repeated-music volta-repeated-music))
670         ))
671     ))
672
673 (set! music-descriptions
674       (sort music-descriptions alist<?))
675
676 (define-public music-name-to-property-table (make-vector 59 '()))
677
678 ;; init hash table,
679 ;; transport description to an object property.
680 (set!
681  music-descriptions
682  (map (lambda (x)
683         (set-object-property! (car x)
684                               'music-description
685                               (cdr (assq 'description (cdr x))))
686         (let ((lst (cdr x)))
687           (set! lst (assoc-set! lst 'name (car x)))
688           (set! lst (assq-remove! lst 'description))
689           (hashq-set! music-name-to-property-table (car x) lst)
690           (cons (car x) lst)))
691       music-descriptions))
692
693 (define-safe-public (make-music name . music-properties)
694   "Create a music object of given name, and set its properties
695 according to @code{music-properties}, a list of alternating property symbols
696 and values. E.g:
697   (make-music 'OverrideProperty
698               'symbol 'Stem
699               'grob-property 'thickness
700               'grob-value (* 2 1.5))"
701   (if (not (symbol? name))
702       (ly:error (_ "symbol expected: ~S") name))
703   (let ((props (hashq-ref music-name-to-property-table name '())))
704     (if (not (pair? props))
705         (ly:error (_ "cannot find music object: ~S") name))
706     (let ((m (ly:make-music props)))
707       (define (set-props mus-props)
708         (if (and (not (null? mus-props))
709                  (not (null? (cdr mus-props))))
710             (begin
711               (set! (ly:music-property m (car mus-props)) (cadr mus-props))
712               (set-props (cddr mus-props)))))
713       (set-props music-properties)
714       m)))
715
716 (define-public (make-repeated-music name)
717   (let* ((repeated-music (assoc-get name '(("volta" . VoltaRepeatedMusic)
718                                            ("unfold" . UnfoldedRepeatedMusic)
719                                            ("percent" . PercentRepeatedMusic)
720                                            ("tremolo" . TremoloRepeatedMusic))))
721          (repeated-music-name (if repeated-music
722                                   repeated-music
723                                   (begin
724                                     (ly:warning (_ "unknown repeat type `~S'") name)
725                                     (ly:warning (_ "See define-music-types.scm for supported repeats"))
726                                     'VoltaRepeatedMusic))))
727     (make-music repeated-music-name)))