]> git.donarmstrong.com Git - lilypond.git/blob - scm/define-music-types.scm
*** empty log message ***
[lilypond.git] / scm / define-music-types.scm
1 ;;;; define-music-types.scm --
2 ;;;;
3 ;;;;  source file of the GNU LilyPond music typesetter
4 ;;;; 
5 ;;;; (c) 1998--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
6 ;;;;                 Jan Nieuwenhuizen <janneke@gnu.org>
7
8 ;; TODO: should link back into user manual.
9
10 (define-public music-descriptions
11   `(
12     (AbsoluteDynamicEvent
13      . (
14         (description . "Creates a dynamic mark.
15
16 Syntax: @var{note}@code{\\x},
17 where x is one of \\ppp, \\pp, \\p, \\mp, \\mf, \\f, \\ff, \\fff.")
18         (internal-class-name . "Event")
19         (types . (general-music event dynamic-event absolute-dynamic-event))
20         ))
21     (ApplyContext
22      . (
23         (description . "Call the argument with the current context during interpreting phase")
24         (internal-class-name . "Music")
25         (types . (general-music apply-context))
26         (iterator-ctor . ,Apply_context_iterator::constructor)
27         ))
28     (ApplyOutputEvent
29      . (
30         (description . "
31 Call the argument with all current grobs during interpreting phase.
32
33 Syntax
34
35 \\applyoutput FUNC
36
37 arguments to func are 1. the grob, 2. the originating context,
38 3. context where FUNC is called.
39
40 ")
41         (internal-class-name . "Event")
42         (iterator-ctor . ,Output_property_music_iterator::constructor)
43         (types . (general-music layout-instruction))
44         ))
45     (ArpeggioEvent 
46      . (
47         (description .  "Make an arpeggio on this note.
48
49 Syntax:
50 @var{note}-@code{\\arpeggio}")
51         (internal-class-name .  "Event")
52         (types . (general-music arpeggio-event event))
53         ))
54
55     ;; todo: use articulation-event for slur as well.
56     ;; separate non articulation scripts  
57     (ArticulationEvent
58      . (
59         (description .  "Adds an articulation marking to a note.  
60
61 Syntax:
62 @var{note}@code{X}@code{Y}, where X is a direction (up @code{^}, down
63 @code{_}, or LilyPond's choice (no direction specified)), and where Y
64 is an articulation (such as @code{-.}, @code{->}, @code{\\tenuto},
65 @code{\\downbow}).  See the user manual for details.")
66
67         (internal-class-name . "Event")
68         (types . (general-music event articulation-event script-event))
69         )) 
70     (AutoChangeMusic
71      . (
72         (description .  "Used for making voices that switch between piano staves automatically.")
73
74         (internal-class-name . "Music_wrapper")
75         (iterator-ctor . ,Auto_change_iterator::constructor)
76         (types . (general-music music-wrapper-music auto-change-instruction))
77         ))
78     (BarCheck
79      . (
80         (description .
81                      "Check whether this music coincides with the start of the measure.")
82         (internal-class-name . "Music")
83         (types . (general-music bar-check))
84         (iterator-ctor . ,Bar_check_iterator::constructor)
85         ))
86     (BassFigureEvent
87      . (
88         (description .  "Print a bass-figure text")
89
90         (internal-class-name . "Event")
91         (types . (general-music event rhythmic-event bass-figure-event))
92         ))
93     (BeamEvent
94      . (
95         (description .  "Starts or stops a beam.  
96
97 Syntax for manual control:
98 c8-[ c c-] c8")
99         (internal-class-name . "Event")
100         (types . (general-music event beam-event span-event))
101         ))
102     (BreakEvent
103      . (
104         (description .  "Create a line break, Syntax: \\break or page break, Syntax: \\pagebreak.")
105
106         (internal-class-name . "Event")
107         (types . (general-music break-event event))
108         ))
109     (BreathingSignEvent
110      . (
111         (description .  "Creates a `breath mark' or `comma'.  
112
113 Syntax:
114 @var{note}\\breathe.")
115
116         (internal-class-name . "Event")
117         (types . (general-music event breathing-event))
118         )) 
119     (BusyPlayingEvent
120      . (
121         (description .  "Used internally to signal beginning and ending of notes.")
122
123         (internal-class-name . "Event")
124         (types . (general-music event busy-playing-event))
125         ))
126     (ContextChange
127      . (
128         (description .  "Change staffs in Piano staff. 
129
130 Syntax @code{\\translator Staff = @var{new-id}}.")
131         (internal-class-name . "Music")
132         (iterator-ctor . , Change_iterator::constructor)
133         (types . (general-music translator-change-instruction))
134         ))
135
136     (ClusterNoteEvent
137      . (
138         (description .  "A note that is part of a cluster.")
139         (internal-class-name . "Event")
140
141                                         ; not a note-event, to ensure that Note_engraver doesn't eat it. 
142         (types . (general-music cluster-note-event melodic-event rhythmic-event event))
143         ))
144     
145     (ContextSpeccedMusic
146      . (
147         (description .  "Interpret the argument music within a specific context.")
148         (iterator-ctor . ,Context_specced_music_iterator::constructor)
149         (internal-class-name . "Music_wrapper")
150         (types . (context-specification general-music music-wrapper-music))
151         ))
152     
153     (CrescendoEvent
154      . (
155         (description .  "Begins or ends a crescendo.  
156
157 Syntax: @var{note}\\cr
158 ... @var{note}\\rc (you can also use \\<, \\!, \\cresc, and
159 \\endcresc.  See the user manual for details.).")
160
161         (internal-class-name . "Event")
162         (types . (general-music dynamic-event crescendo-event event))
163         )) 
164     (DecrescendoEvent
165      . (
166         (description .  "See @ref{CrescendoEvent}.")
167
168         (internal-class-name . "Event")
169         (types . (general-music dynamic-event decrescendo-event event))
170         ))
171     
172     (ExtenderEvent
173      . (
174         (description .  "Extend lyrics.")
175
176         (internal-class-name . "Event")
177         (types . (general-music extender-event event))
178         ))
179     (FingerEvent
180      . (
181         (description . "Specify what finger to use for this note.")
182         (internal-class-name . "Event")
183         (types . (general-music fingering-event event))
184         ))
185     (BeamForbidEvent
186      . (
187         (description . "Specify that a note may not auto-beamed ")
188         (internal-class-name . "Event")
189         (types . (general-music event beam-forbid-event))
190         ))
191     (GlissandoEvent
192      . (
193         (description .  "Start  a glissando on this note.")
194         (internal-class-name . "Event")
195         (types . (general-music glissando-event event))
196         ))
197     
198     (GraceMusic
199      . (
200         (description .  "Interpret the argument as grace notes. ")
201         (internal-class-name . "Music_wrapper")
202         (start-callback . ,Grace_music::start_callback)
203         (length . ,(ly:make-moment 0 1))
204         (iterator-ctor . ,Grace_iterator::constructor)
205         (types . (grace-music music-wrapper-music general-music))
206         ))
207     (NoteGroupingEvent
208      . (
209         (description . "Start or stop grouping brackets.")
210         (internal-class-name . "Event")
211         (types . (general-music event note-grouping-event))
212         ))
213     (HarmonicEvent
214      . (
215         (description . "Mark a note as harmonic")
216         (internal-class-name . "Event")
217         (types . (general-music event harmonic-event))
218         ))
219     (HyphenEvent
220      . (
221         (description .  "A hyphen between lyric syllables.")
222
223         (internal-class-name . "Event")
224         (types . (general-music hyphen-event event))
225         ))
226     
227     (KeyChangeEvent
228      . (
229         (description .  "Change the key signature. 
230
231 Syntax: @code{\\key } @var{name} @var{scale}.")
232
233         (internal-class-name . "Event")
234         (types . (general-music key-change-event event))
235         ))
236     
237     (LigatureEvent
238      . (
239         (description .  "(docme).")
240
241         (internal-class-name . "Event")
242         (span-type . ligature)
243         (types . (general-music span-event ligature-event event))
244         ))
245     
246     (LyricCombineMusic
247      . (
248         (description .  "Align lyrics to the start of notes.
249
250 Syntax @var{\\oldaddlyrics }@var{music} @var{lyrics}.")
251
252         (internal-class-name . "Music")
253         (types . (general-music lyric-combine-music))
254         (length-callback . ,Lyric_combine_music::length_callback)
255         (start-callback . ,Music_sequence::first_start_callback)
256         (iterator-ctor . ,Lyric_combine_music_iterator::constructor)
257         ))
258     
259     (NewLyricCombineMusic
260      . (
261         (description .  "Align lyrics to the start of notes.
262
263 Syntax @var{\\lyricsto }@var{voicename} @var{lyrics}.")
264         (internal-class-name . "Music")
265         (length . ,(ly:make-moment 0 1))
266         (types . (general-music lyric-combine-music))
267         (iterator-ctor . ,New_lyric_combine_music_iterator::constructor)
268         ))
269
270     (LyricEvent
271      . (
272         (description .  "A lyric syllable. Must be entered in lyrics mode, i.e.
273 @code{\\lyrics @{ twinkle4 twinkle4 @} } .")
274
275         (internal-class-name . "Event")
276         (types . (general-music rhythmic-event lyric-event event))
277         ))
278     (MarkEvent
279      . (
280         (description .  "Insert a rehearsal mark. 
281
282 Syntax: @code{\\mark} @var{marker},
283 e.g. @code{\\mark \"A\"}.")
284
285         (internal-class-name . "Event")
286         (types . (general-music mark-event event))
287         ))
288     (MelismaPlayingEvent
289      . (
290         (description .  "Used internally to signal melismas.")
291         (internal-class-name . "Event")
292         (types . (general-music melisma-playing-event event))
293         ))
294     (ManualMelismaEvent
295      . (
296         (description .  "Start or stop a melisma.
297
298 Syntax: @code{c4\\melisma d\\melismaEnd}.")
299         (internal-class-name . "Event")
300         (types . (general-music melisma-span-event event))
301         ))
302     
303     (MultiMeasureRestEvent
304      . (
305         (description . "Rests that may be compressed into Multi rests. 
306
307 Syntax
308 @code{R2.*4} for 4 measures in 3/4 time. Note the capital R.")
309         (internal-class-name . "Event")
310         (types . (general-music event rhythmic-event multi-measure-rest-event))
311         ))
312     
313     (MultiMeasureTextEvent
314      . (
315         (description . "Texts on mm rests. 
316
317 Syntax
318 @code{R-\\markup @{ \\roman \"bla\" @}}. Note the explicit font switch.")
319         (internal-class-name . "Event")
320         (types . (general-music event multi-measure-text-event))
321         ))
322
323     (Music
324      . (
325         (description .  "Generic type for music expressions.")
326
327         (internal-class-name . "Music")
328         (types . (general-music)) 
329         ))
330     (NoteEvent
331      . (
332         (description .  "A note.")
333
334         (internal-class-name . "Event")
335         (types . (general-music event note-event rhythmic-event melodic-event))
336         ))
337     
338     (OverrideProperty
339      . (
340         (description .  "Extend the definition of a graphical object.
341
342 SYNTAX
343
344 @code{\\propery Foo.Bar \\override} @var{SYMBOL} = @var{VALUE}
345
346 ")
347         (internal-class-name . "Music")
348         (types . (general-music layout-instruction))
349         (iterator-ctor . ,      Push_property_iterator::constructor)
350         ))
351     (PartCombineMusic
352      . (
353         (description .  "Combine two parts on a staff, either merged or
354 as separate voices.")
355         (internal-class-name . "Music")
356         (length-callback . ,Music_sequence::maximum_length_callback)
357         (start-callback . ,Music_sequence::minimum_start_callback)
358         (types . (general-music part-combine-music))
359         (iterator-ctor . ,Part_combine_iterator::constructor)
360         ))
361     (PhrasingSlurEvent
362      . (
363         (description . "Start or end phrasing slur. 
364
365 Syntax NOTE \\(  and \\) NOTE")
366         (internal-class-name . "Event")
367         (types . (general-music span-event phrasing-slur-event))
368         ))
369     
370     (PropertySet
371      . (
372         (description .  "Set a context property.
373
374 Syntax: @code{\\property @var{context}.@var{prop} = @var{scheme-val}}.")
375         (internal-class-name . "Music")
376         (types . (layout-instruction general-music))
377         (iterator-ctor . ,Property_iterator::constructor)
378         ))
379
380     (PropertyUnset
381      . (
382         (description .  "Remove the definition of a context @code{\\property}.")
383
384         (internal-class-name . "Music")
385         (types . (layout-instruction general-music))
386         (iterator-ctor . ,Property_unset_iterator::constructor)
387         ))
388     
389     (PesOrFlexaEvent
390      . (
391         (description .  "Within a ligature, mark the previous and the
392 following note to form a pes (if melody goes up) or a flexa (if melody
393 goes down).")
394
395         (internal-class-name . "Event")
396         (types . (general-music pes-or-flexa-event event))
397         ))
398
399     (QuoteMusic
400      . (
401         (description . "Quote preprocessed snippets of music. ")
402         (internal-class-name . "Music_wrapper")
403         (iterator-ctor . ,Quote_iterator::constructor)
404         (types . (general-music))
405         ))
406     
407     (RelativeOctaveCheck
408      . ((description . "Check if a pitch is in the correct octave.")
409         (internal-class-name . "Music")
410         (to-relative-callback . ,Relative_octave_check::relative_callback)
411         (types . (general-music relative-octave-check))
412         ))
413     
414     (RepeatedMusic
415      . (
416         (description .  "Repeat music in different ways")
417         (type .  repeated-music)
418         (types . (general-music repeated-music))
419         ))
420     
421     (Event
422      . (
423         (description .  "Atomic music event.")
424
425         (internal-class-name . "Event")
426         (types . (general-music event))
427         ))
428     
429     (RestEvent
430      . (
431         (description .  "A Rest. 
432
433 Syntax @code{r4} for a quarter rest. ")
434
435         (internal-class-name . "Event")
436         (types . (general-music event rhythmic-event rest-event))
437         )) 
438     (RevertProperty
439      . (
440         (description .  "The opposite of @ref{OverrideProperty}: remove a
441 previously added property from a graphical object definition
442  ")
443
444         (internal-class-name . "Music")
445         (types . (general-music layout-instruction))
446         (iterator-ctor . ,      Pop_property_iterator::constructor)
447         ))
448
449     (SequentialMusic
450      . (
451         (description .  "Music expressions concatenated. 
452
453 Syntax \\sequential @{..@} or simply @{..@} .")
454
455         (internal-class-name . "Music")
456         (length-callback . ,Music_sequence::cumulative_length_callback)
457         (start-callback . ,Music_sequence::first_start_callback)
458         (iterator-ctor . ,Sequential_music_iterator::constructor)
459         (types . (general-music sequential-music))
460         ))
461     
462     (MultiMeasureRestMusicGroup
463      . (
464         (description .  "Like sequential-music, but specifically intended
465 to group start-mmrest, skip, stop-mmrest sequence. 
466
467 Syntax @code{R2.*5} for 5 measures in 3/4 time.")
468         (internal-class-name . "Music")
469         (length-callback . ,Music_sequence::cumulative_length_callback)
470         (start-callback . ,Music_sequence::first_start_callback)
471         (iterator-ctor . ,Sequential_music_iterator::constructor)
472         (types . (general-music sequential-music))
473         ))
474
475     (SoloOneEvent
476      . (
477         (description . "Print Solo.1")
478         (internal-class-name . "Event")
479         (part-combine-status . solo1)
480         (types . (general-music event part-combine-event))
481         ))
482     (SoloTwoEvent
483      . (
484         (description . "Print Solo.2")
485         (internal-class-name . "Event")
486         (part-combine-status . solo2)
487         (types . (general-music event part-combine-event))
488         ))
489     (UnisonoEvent
490      . ((description . "Print a2")
491         (internal-class-name .  "Event")
492         (part-combine-status . unisono)
493         (types . (general-music event part-combine-event))))
494     
495     (SimultaneousMusic
496      . (
497         (description .  "Music playing together.
498
499 SYNTAX
500
501 @code{ \\simultaneous @{ .. @}} or < .. >.")
502
503         (internal-class-name . "Music")
504         (iterator-ctor . ,Simultaneous_music_iterator::constructor)
505         (start-callback . ,Music_sequence::minimum_start_callback)
506         (length-callback . ,Music_sequence::maximum_length_callback)
507         (to-relative-callback . ,Music_sequence::simultaneous_relative_callback)
508         
509         (types . (general-music simultaneous-music))
510         ))
511     
512     (SlurEvent
513      . (
514         (description . "Start or end slur. 
515
516 Syntax NOTE(     and )NOTE")
517         (internal-class-name . "Event")
518         (types . (general-music span-event slur-event))
519         ))
520
521     (StartPlayingEvent
522      . (
523         (description .  "Used internally to signal beginning of notes.")
524
525         (internal-class-name . "Event")
526         (types . (general-music event start-playing-event))
527         ))
528     
529     (OutputPropertySetMusic
530      . (
531         (description .  "Set grob properties in objects
532 individually. 
533
534 Syntax @code{\\outputproperty @var{predicate} @var{prop}
535 = @var{val}}.")
536
537         (internal-class-name . "Music")
538         (iterator-ctor . ,Output_property_music_iterator::constructor)
539         (types . (general-music layout-instruction))
540         ))
541     
542     (TextSpanEvent
543      . (
544         (description . "Start a text spanner like 8va.....|")
545         (internal-class-name . "Event")
546         (types . (general-music span-event text-span-event))
547         ))
548     
549     (TrillSpanEvent
550      . (
551         (description . "Start a trill spanner tr~~~")
552         (internal-class-name . "Event")
553         (types . (general-music span-event trill-span-event))
554         ))
555     
556     (TimeScaledMusic
557      . (
558         (description .  "Multiply durations, as in tuplets. 
559
560 Syntax @code{\\times @var{fraction} @var{music}}, e.g.
561 @code{\\times 2/3 @{ ... @}} for triplets.
562  ")
563         (internal-class-name . "Music_wrapper")
564         (iterator-ctor . ,Time_scaled_music_iterator::constructor)
565         (types . (time-scaled-music music-wrapper-music general-music))
566         ))
567     
568     (TransposedMusic
569      . (
570         (description .  "Music that has been transposed.")
571         (internal-class-name . "Music_wrapper")
572         (to-relative-callback . ,Relative_octave_music::no_relative_callback)
573         (types . (music-wrapper-music general-music transposed-music))
574         ))
575
576     (UntransposableMusic
577      . (
578         (description .  "Music that can not be transposed.")
579         (to-relative-callback . ,Relative_octave_music::no_relative_callback)
580         (untransposable . #t)
581         (internal-class-name . "Music_wrapper")
582         (types . (music-wrapper-music general-music untransposable-music)) 
583         ))
584
585     (UnrelativableMusic
586      . (
587         (description .  "Music that can not be converted from relative to absolute notation.
588 For example, transposed music.")
589         (to-relative-callback . ,Relative_octave_music::no_relative_callback)
590         (internal-class-name . "Music_wrapper")
591         (types . (music-wrapper-music general-music unrelativable-music))
592         ))
593
594     (RelativeOctaveMusic
595      . (
596         (description .  "Music that was entered in relative octave notation.")
597         (to-relative-callback . ,Relative_octave_music::relative_callback)
598         (internal-class-name . "Music_wrapper")
599         (types . (music-wrapper-music general-music relative-octave-music))
600         ))
601     
602     (EventChord
603      . (
604         (description .  "Internally used to group a set of events.")
605         (internal-class-name . "Music")
606         (iterator-ctor . ,Event_chord_iterator::constructor)
607         (length-callback . ,Music_sequence::maximum_length_callback)
608         (to-relative-callback . ,Music_sequence::event_chord_relative_callback)
609         (types . (general-music event-chord simultaneous-music))
610         ))
611     
612     (ScriptEvent
613      . (
614         (description .  "Add an articulation mark to a note. ")
615
616         (internal-class-name . "Event")
617         (types . (general-music event))
618         ))
619
620     (SkipMusic
621      . (
622         (description .  "Filler that takes up duration, does not print anything, and also
623 does not create staffs or voices implicitly.
624
625
626
627 Syntax: @code{\\skip }@var{duration}.")
628         (internal-class-name . "Music")
629         (length-callback . ,ly:music-duration-length)
630         (iterator-ctor . ,Simple_music_iterator::constructor)
631         (types . (general-music event rhythmic-event skip-event))
632         ))
633     
634     (SkipEvent
635      . (
636         (description .  "Filler that takes up duration, but does not print anything.
637
638
639
640 Syntax: @code{s}@var{duration}")
641
642         (internal-class-name . "Event")
643         (types . (general-music event rhythmic-event skip-event))
644         ))
645     (SpanEvent
646      . (
647         (description .  "Event for anything that is started at a different time than stopped.")
648
649         (internal-class-name . "Event")
650         (types . (general-music event))
651         ))
652     
653     (SustainEvent
654      . (
655         (description . "Depress or release sustain pedal. ")
656         (internal-class-name . "Event")
657         (types . (general-music pedal-event sustain-pedal-event))
658         ))
659     
660     (SostenutoEvent
661      . (
662         (description . "Depress or release sostenuto pedal. ")
663         (internal-class-name . "Event")
664         (types . (general-music pedal-event sostenuto-pedal-event))
665         ))
666     
667     (UnaCordaEvent
668      . (
669         (description . "Depress or release una-corda pedal.")
670         (internal-class-name . "Event")
671         (types . (general-music pedal-event una-corda-pedal-event))
672         ))
673     
674     (StringNumberEvent
675      . (
676         (description .  "Specify on which string to play this note. 
677
678 Syntax: @code{\\@var{number}}.")
679
680         (internal-class-name . "Event")
681         (types . (general-music string-number-event event))
682         )) 
683
684     (MetronomeChangeEvent
685      . (
686         (description .  "Change tempo setting (in beats per minute).")
687         (internal-class-name . "Event")
688         (types . (general-music metronome-change-event tempo-event event))
689         ))
690     
691     (TextScriptEvent
692      . (
693         (description .  "")
694         (internal-class-name . "Event")
695         (types . (general-music script-event text-script-event event))
696         )) 
697     (TieEvent
698      . (
699         (description .  "A tie.  Entered as @var{note}-~.")
700         (internal-class-name . "Event")
701         (types . (general-music tie-event event))
702         ))
703     (TremoloEvent
704      . (
705         (description . "Un measured tremolo.")
706         (internal-class-name . "Event")
707         (types . (general-music event tremolo-event))
708         ))
709     
710     (VoiceSeparator
711      . (
712         (description .  "Separate polyphonic voices in simultaneous music. 
713
714 Syntax: @code{\\\\}")
715
716         (internal-class-name . "Music")
717         (types . (separator general-music))
718         ))
719
720     (VoltaRepeatedMusic
721      . (
722         (iterator-ctor . ,Volta_repeat_iterator::constructor)
723         (internal-class-name . "Music")
724         (description . "")
725         (start-callback .  ,Repeated_music::first_start)
726         (length-callback . ,Repeated_music::volta_music_length)
727         (types . (general-music repeated-music volta-repeated-music))
728         ))
729     
730     (UnfoldedRepeatedMusic
731      . (
732         (iterator-ctor . ,Unfolded_repeat_iterator::constructor)
733         (description .  "")
734         (start-callback .  ,Repeated_music::first_start)
735         (internal-class-name . "Music")
736         (types . (general-music repeated-music unfolded-repeated-music))
737         (length-callback . ,Repeated_music::unfolded_music_length)
738         ))
739     (PercentRepeatedMusic
740      . (
741         (internal-class-name . "Music")
742         (description .  "Repeats encoded by percents.")
743         (iterator-ctor . ,Percent_repeat_iterator::constructor)
744         (start-callback .  ,Repeated_music::first_start)
745         (length-callback . ,Repeated_music::unfolded_music_length)
746         (types . (general-music repeated-music percent-repeated-music))
747         ))
748     
749     (TremoloRepeatedMusic
750      . (
751         (iterator-ctor . ,Chord_tremolo_iterator::constructor)
752         (description .  "Repeated notes denoted by tremolo beams.")
753         (internal-class-name . "Music")
754         (start-callback .  ,Repeated_music::first_start)
755
756         ;; the length of the repeat is handled by shifting the note logs
757         (length-callback . ,Repeated_music::folded_music_length)
758         (types . (general-music repeated-music tremolo-repeated-music))
759         
760         ))
761     
762     (FoldedRepeatedMusic
763      . (
764         (internal-class-name . "Music")
765         (description .  "Repeats with alternatives placed in parallel. ")
766         (iterator-ctor  . ,Folded_repeat_iterator::constructor)
767         (start-callback .  ,Repeated_music::minimum_start)
768         (length-callback . ,Repeated_music::folded_music_length)
769         (types . (general-music repeated-music folded-repeated-music))
770         ))
771     ))
772
773 (set! music-descriptions
774       (sort music-descriptions alist<?))
775
776 (define music-name-to-property-table (make-vector 59 '()))
777
778 ;; init hash table,
779 ;; transport description to an object property.
780 (set!
781  music-descriptions
782  (map (lambda (x)
783         (set-object-property! (car x)
784                               'music-description
785                               (cdr (assq 'description (cdr x))))
786         (let ((lst (cdr x)))
787           (set! lst (assoc-set! lst 'name (car x)))
788           (set! lst (assq-remove! lst 'description))
789           (hashq-set! music-name-to-property-table (car x) lst)
790           (cons (car x) lst)))
791       music-descriptions))
792
793 (define-safe-public (make-music name . music-properties)
794   "Create a music object of given name, and set its properties
795 according to `music-properties', a list of alterning property symbols
796 and values. E.g:
797   (make-music 'OverrideProperty 
798               'symbol 'Stem
799               'grob-property 'thickness
800               'grob-value (* 2 1.5))"
801   (if (not (symbol? name))
802       (ly:error (_ "symbol expected: ~S") name))
803   (let ((props (hashq-ref music-name-to-property-table name '())))
804     (if (not (pair? props))
805         (ly:error (_ "can't find music object: ~S") name))
806     (let ((m (ly:make-bare-music (cdr (assoc 'internal-class-name props)) props)))
807       (define (set-props mus-props)
808         (if (and (not (null? mus-props))
809                  (not (null? (cdr mus-props))))
810             (begin
811               (set! (ly:music-property m (car mus-props)) (cadr mus-props))
812               (set-props (cddr mus-props)))))
813       (set-props music-properties)
814       m)))
815
816 (define-public (make-repeated-music name)
817   (let* ((handle (assoc name '(("volta" . VoltaRepeatedMusic)
818                                ("unfold" . UnfoldedRepeatedMusic)
819                                ("percent" . PercentRepeatedMusic)
820                                ("tremolo" . TremoloRepeatedMusic)
821                                ("fold" . FoldedRepeatedMusic))))
822          (music-name (if (pair? handle)
823                          (cdr handle)
824                          (begin
825                            (ly:warning (_ "unknown repeat type `~S'") name)
826                            (ly:warning (_ "See music-types.scm for supported repeats"))
827                            'VoltaRepeatedMusic))))
828     (make-music music-name)))
829