]> git.donarmstrong.com Git - lilypond.git/blob - scm/define-music-types.scm
* ly/music-functions-init.ly (oldaddlyrics): idem.
[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
180     
181     (EventChord
182      . (
183         (description .  "Internally used to group a set of events.")
184         (internal-class-name . "Music")
185         (iterator-ctor . ,Event_chord_iterator::constructor)
186         (length-callback . ,Music_sequence::maximum_length_callback)
187         (to-relative-callback . ,Music_sequence::event_chord_relative_callback)
188         (types . (general-music event-chord simultaneous-music))
189         ))
190
191     (FingerEvent
192      . (
193         (description . "Specify what finger to use for this note.")
194         (internal-class-name . "Event")
195         (types . (general-music fingering-event event))
196         ))
197     (BeamForbidEvent
198      . (
199         (description . "Specify that a note may not auto-beamed ")
200         (internal-class-name . "Event")
201         (types . (general-music event beam-forbid-event))
202         ))
203     (GlissandoEvent
204      . (
205         (description .  "Start  a glissando on this note.")
206         (internal-class-name . "Event")
207         (types . (general-music glissando-event event))
208         ))
209     
210     (GraceMusic
211      . (
212         (description .  "Interpret the argument as grace notes. ")
213         (internal-class-name . "Music_wrapper")
214         (start-callback . ,Grace_music::start_callback)
215         (length . ,(ly:make-moment 0 1))
216         (iterator-ctor . ,Grace_iterator::constructor)
217         (types . (grace-music music-wrapper-music general-music))
218         ))
219     (NoteGroupingEvent
220      . (
221         (description . "Start or stop grouping brackets.")
222         (internal-class-name . "Event")
223         (types . (general-music event note-grouping-event))
224         ))
225     (HarmonicEvent
226      . (
227         (description . "Mark a note as harmonic")
228         (internal-class-name . "Event")
229         (types . (general-music event harmonic-event))
230         ))
231     (HyphenEvent
232      . (
233         (description .  "A hyphen between lyric syllables.")
234
235         (internal-class-name . "Event")
236         (types . (general-music hyphen-event event))
237         ))
238     
239     (KeyChangeEvent
240      . (
241         (description .  "Change the key signature. 
242
243 Syntax: @code{\\key } @var{name} @var{scale}.")
244
245         (internal-class-name . "Event")
246         (types . (general-music key-change-event event))
247         ))
248     
249     (LigatureEvent
250      . (
251         (description .  "(docme).")
252
253         (internal-class-name . "Event")
254         (span-type . ligature)
255         (types . (general-music span-event ligature-event event))
256         ))
257     
258     (OldLyricCombineMusic
259      . (
260         (description .  "Align lyrics to the start of notes.
261
262 Syntax @var{\\oldaddlyrics }@var{music} @var{lyrics}.")
263
264         (internal-class-name . "Music")
265         (types . (general-music lyric-combine-music))
266         (length-callback . ,Lyric_combine_music::length_callback)
267         (start-callback . ,Music_sequence::first_start_callback)
268         (iterator-ctor . ,Lyric_combine_music_iterator::constructor)
269         ))
270     
271     (LyricCombineMusic
272      . (
273         (description .  "Align lyrics to the start of notes.
274
275 Syntax @var{\\lyricsto }@var{voicename} @var{lyrics}.")
276         (internal-class-name . "Music")
277         (length . ,(ly:make-moment 0 1))
278         (types . (general-music lyric-combine-music))
279         (iterator-ctor . ,New_lyric_combine_music_iterator::constructor)
280         ))
281
282     (LyricEvent
283      . (
284         (description .  "A lyric syllable. Must be entered in lyrics mode, i.e.
285 @code{\\lyrics @{ twinkle4 twinkle4 @} } .")
286
287         (internal-class-name . "Event")
288         (types . (general-music rhythmic-event lyric-event event))
289         ))
290     (MarkEvent
291      . (
292         (description .  "Insert a rehearsal mark. 
293
294 Syntax: @code{\\mark} @var{marker},
295 e.g. @code{\\mark \"A\"}.")
296
297         (internal-class-name . "Event")
298         (types . (general-music mark-event event))
299         ))
300     (MelismaPlayingEvent
301      . (
302         (description .  "Used internally to signal melismas.")
303         (internal-class-name . "Event")
304         (types . (general-music melisma-playing-event event))
305         ))
306     (ManualMelismaEvent
307      . (
308         (description .  "Start or stop a melisma.
309
310 Syntax: @code{c4\\melisma d\\melismaEnd}.")
311         (internal-class-name . "Event")
312         (types . (general-music melisma-span-event event))
313         ))
314     
315     (MultiMeasureRestEvent
316      . (
317         (description . "Rests that may be compressed into Multi rests. 
318
319 Syntax
320 @code{R2.*4} for 4 measures in 3/4 time. Note the capital R.")
321         (internal-class-name . "Event")
322         (types . (general-music event rhythmic-event multi-measure-rest-event))
323         ))
324     
325     (MultiMeasureRestMusicGroup
326      . (
327         (description .  "Like sequential-music, but specifically intended
328 to group start-mmrest, skip, stop-mmrest sequence. 
329
330 Syntax @code{R2.*5} for 5 measures in 3/4 time.")
331         (internal-class-name . "Music")
332         (length-callback . ,Music_sequence::cumulative_length_callback)
333         (start-callback . ,Music_sequence::first_start_callback)
334         (iterator-ctor . ,Sequential_music_iterator::constructor)
335         (types . (general-music sequential-music))
336         ))
337     
338     (MultiMeasureTextEvent
339      . (
340         (description . "Texts on mm rests. 
341
342 Syntax
343 @code{R-\\markup @{ \\roman \"bla\" @}}. Note the explicit font switch.")
344         (internal-class-name . "Event")
345         (types . (general-music event multi-measure-text-event))
346         ))
347
348     (Music
349      . (
350         (description .  "Generic type for music expressions.")
351
352         (internal-class-name . "Music")
353         (types . (general-music)) 
354         ))
355     (NoteEvent
356      . (
357         (description .  "A note.")
358
359         (internal-class-name . "Event")
360         (types . (general-music event note-event rhythmic-event melodic-event))
361         ))
362     
363     (OutputPropertySetMusic
364      . (
365         (description .  "Set grob properties in objects
366 individually. 
367
368 Syntax @code{\\outputproperty @var{predicate} @var{prop}
369 = @var{val}}.")
370
371         (internal-class-name . "Music")
372         (iterator-ctor . ,Output_property_music_iterator::constructor)
373         (types . (general-music layout-instruction))
374         ))
375     
376     (OverrideProperty
377      . (
378         (description .  "Extend the definition of a graphical object.
379
380 SYNTAX
381
382 @code{\\propery Foo.Bar \\override} @var{SYMBOL} = @var{VALUE}
383
384 ")
385         (internal-class-name . "Music")
386         (types . (general-music layout-instruction))
387         (iterator-ctor . ,      Push_property_iterator::constructor)
388         ))
389     (PartCombineMusic
390      . (
391         (description .  "Combine two parts on a staff, either merged or
392 as separate voices.")
393         (internal-class-name . "Music")
394         (length-callback . ,Music_sequence::maximum_length_callback)
395         (start-callback . ,Music_sequence::minimum_start_callback)
396         (types . (general-music part-combine-music))
397         (iterator-ctor . ,Part_combine_iterator::constructor)
398         ))
399     (PhrasingSlurEvent
400      . (
401         (description . "Start or end phrasing slur. 
402
403 Syntax NOTE \\(  and \\) NOTE")
404         (internal-class-name . "Event")
405         (types . (general-music span-event phrasing-slur-event))
406         ))
407     
408     (PropertySet
409      . (
410         (description .  "Set a context property.
411
412 Syntax: @code{\\property @var{context}.@var{prop} = @var{scheme-val}}.")
413         (internal-class-name . "Music")
414         (types . (layout-instruction general-music))
415         (iterator-ctor . ,Property_iterator::constructor)
416         ))
417
418     (PropertyUnset
419      . (
420         (description .  "Remove the definition of a context @code{\\property}.")
421
422         (internal-class-name . "Music")
423         (types . (layout-instruction general-music))
424         (iterator-ctor . ,Property_unset_iterator::constructor)
425         ))
426     
427     (PesOrFlexaEvent
428      . (
429         (description .  "Within a ligature, mark the previous and the
430 following note to form a pes (if melody goes up) or a flexa (if melody
431 goes down).")
432
433         (internal-class-name . "Event")
434         (types . (general-music pes-or-flexa-event event))
435         ))
436
437     (QuoteMusic
438      . (
439         (description . "Quote preprocessed snippets of music. ")
440         (internal-class-name . "Music_wrapper")
441         (iterator-ctor . ,Quote_iterator::constructor)
442         (types . (general-music))
443         ))
444     
445     (RelativeOctaveCheck
446      . ((description . "Check if a pitch is in the correct octave.")
447         (internal-class-name . "Music")
448         (to-relative-callback . ,Relative_octave_check::relative_callback)
449         (types . (general-music relative-octave-check))
450         ))
451     
452     (RepeatedMusic
453      . (
454         (description .  "Repeat music in different ways")
455         (type .  repeated-music)
456         (types . (general-music repeated-music))
457         ))
458     
459     (Event
460      . (
461         (description .  "Atomic music event.")
462
463         (internal-class-name . "Event")
464         (types . (general-music event))
465         ))
466     
467     (RestEvent
468      . (
469         (description .  "A Rest. 
470
471 Syntax @code{r4} for a quarter rest. ")
472
473         (internal-class-name . "Event")
474         (types . (general-music event rhythmic-event rest-event))
475         )) 
476     (RevertProperty
477      . (
478         (description .  "The opposite of @ref{OverrideProperty}: remove a
479 previously added property from a graphical object definition
480  ")
481
482         (internal-class-name . "Music")
483         (types . (general-music layout-instruction))
484         (iterator-ctor . ,      Pop_property_iterator::constructor)
485         ))
486
487     (SequentialMusic
488      . (
489         (description .  "Music expressions concatenated. 
490
491 Syntax \\sequential @{..@} or simply @{..@} .")
492
493         (internal-class-name . "Music")
494         (length-callback . ,Music_sequence::cumulative_length_callback)
495         (start-callback . ,Music_sequence::first_start_callback)
496         (iterator-ctor . ,Sequential_music_iterator::constructor)
497         (types . (general-music sequential-music))
498         ))
499
500     (SoloOneEvent
501      . (
502         (description . "Print Solo.1")
503         (internal-class-name . "Event")
504         (part-combine-status . solo1)
505         (types . (general-music event part-combine-event))
506         ))
507     (SoloTwoEvent
508      . (
509         (description . "Print Solo.2")
510         (internal-class-name . "Event")
511         (part-combine-status . solo2)
512         (types . (general-music event part-combine-event))
513         ))
514     (UnisonoEvent
515      . ((description . "Print a2")
516         (internal-class-name .  "Event")
517         (part-combine-status . unisono)
518         (types . (general-music event part-combine-event))))
519     
520     (SimultaneousMusic
521      . (
522         (description .  "Music playing together.
523
524 SYNTAX
525
526 @code{ \\simultaneous @{ .. @}} or < .. >.")
527
528         (internal-class-name . "Music")
529         (iterator-ctor . ,Simultaneous_music_iterator::constructor)
530         (start-callback . ,Music_sequence::minimum_start_callback)
531         (length-callback . ,Music_sequence::maximum_length_callback)
532         (to-relative-callback . ,Music_sequence::simultaneous_relative_callback)
533         
534         (types . (general-music simultaneous-music))
535         ))
536     
537     (SlurEvent
538      . (
539         (description . "Start or end slur. 
540
541 Syntax NOTE(     and )NOTE")
542         (internal-class-name . "Event")
543         (types . (general-music span-event slur-event))
544         ))
545     
546     (StaffSpanEvent
547      . ((description . "Start or  stop a staff symbol.")
548         (internal-class-name . "Event")
549         (types . (general-music event span-event staff-span-event))
550      ))
551     
552     (StartPlayingEvent
553      . (
554         (description .  "Used internally to signal beginning of notes.")
555
556         (internal-class-name . "Event")
557         (types . (general-music event start-playing-event))
558         ))
559     
560     (TextSpanEvent
561      . (
562         (description . "Start a text spanner like 8va.....|")
563         (internal-class-name . "Event")
564         (types . (general-music span-event text-span-event))
565         ))
566     
567     (TrillSpanEvent
568      . (
569         (description . "Start a trill spanner tr~~~")
570         (internal-class-name . "Event")
571         (types . (general-music span-event trill-span-event))
572         ))
573     
574     (TimeScaledMusic
575      . (
576         (description .  "Multiply durations, as in tuplets. 
577
578 Syntax @code{\\times @var{fraction} @var{music}}, e.g.
579 @code{\\times 2/3 @{ ... @}} for triplets.
580  ")
581         (internal-class-name . "Music_wrapper")
582         (iterator-ctor . ,Time_scaled_music_iterator::constructor)
583         (types . (time-scaled-music music-wrapper-music general-music))
584         ))
585     
586     (TransposedMusic
587      . (
588         (description .  "Music that has been transposed.")
589         (internal-class-name . "Music_wrapper")
590         (to-relative-callback . ,Relative_octave_music::no_relative_callback)
591         (types . (music-wrapper-music general-music transposed-music))
592         ))
593
594     (UnrelativableMusic
595      . (
596         (description .  "Music that can not be converted from relative to absolute notation.
597 For example, transposed music.")
598         (to-relative-callback . ,Relative_octave_music::no_relative_callback)
599         (internal-class-name . "Music_wrapper")
600         (types . (music-wrapper-music general-music unrelativable-music))
601         ))
602
603     (RelativeOctaveMusic
604      . (
605         (description .  "Music that was entered in relative octave notation.")
606         (to-relative-callback . ,Relative_octave_music::relative_callback)
607         (internal-class-name . "Music_wrapper")
608         (types . (music-wrapper-music general-music relative-octave-music))
609         ))
610     (ScriptEvent
611      . (
612         (description .  "Add an articulation mark to a note. ")
613
614         (internal-class-name . "Event")
615         (types . (general-music event))
616         ))
617
618     (SkipMusic
619      . (
620         (description .  "Filler that takes up duration, does not print anything, and also
621 does not create staffs or voices implicitly.
622
623
624
625 Syntax: @code{\\skip }@var{duration}.")
626         (internal-class-name . "Music")
627         (length-callback . ,ly:music-duration-length)
628         (iterator-ctor . ,Simple_music_iterator::constructor)
629         (types . (general-music event rhythmic-event skip-event))
630         ))
631     
632     (SkipEvent
633      . (
634         (description .  "Filler that takes up duration, but does not print anything.
635
636
637
638 Syntax: @code{s}@var{duration}")
639
640         (internal-class-name . "Event")
641         (types . (general-music event rhythmic-event skip-event))
642         ))
643     (SpanEvent
644      . (
645         (description .  "Event for anything that is started at a different time than stopped.")
646
647         (internal-class-name . "Event")
648         (types . (general-music event))
649         ))
650     
651     (SustainEvent
652      . (
653         (description . "Depress or release sustain pedal. ")
654         (internal-class-name . "Event")
655         (types . (general-music pedal-event sustain-pedal-event))
656         ))
657     
658     (SostenutoEvent
659      . (
660         (description . "Depress or release sostenuto pedal. ")
661         (internal-class-name . "Event")
662         (types . (general-music pedal-event sostenuto-pedal-event))
663         ))
664     
665     (UnaCordaEvent
666      . (
667         (description . "Depress or release una-corda pedal.")
668         (internal-class-name . "Event")
669         (types . (general-music pedal-event una-corda-pedal-event))
670         ))
671     
672     (StringNumberEvent
673      . (
674         (description .  "Specify on which string to play this note. 
675
676 Syntax: @code{\\@var{number}}.")
677
678         (internal-class-name . "Event")
679         (types . (general-music string-number-event event))
680         )) 
681
682     (MetronomeChangeEvent
683      . (
684         (description .  "Change tempo setting (in beats per minute).")
685         (internal-class-name . "Event")
686         (types . (general-music metronome-change-event tempo-event event))
687         ))
688     
689     (TextScriptEvent
690      . (
691         (description .  "")
692         (internal-class-name . "Event")
693         (types . (general-music script-event text-script-event event))
694         )) 
695     (TieEvent
696      . (
697         (description .  "A tie.  Entered as @var{note}-~.")
698         (internal-class-name . "Event")
699         (types . (general-music tie-event event))
700         ))
701     (TremoloEvent
702      . (
703         (description . "Un measured tremolo.")
704         (internal-class-name . "Event")
705         (types . (general-music event tremolo-event))
706         ))
707     
708     (VoiceSeparator
709      . (
710         (description .  "Separate polyphonic voices in simultaneous music. 
711
712 Syntax: @code{\\\\}")
713
714         (internal-class-name . "Music")
715         (types . (separator general-music))
716         ))
717
718     (VoltaRepeatedMusic
719      . (
720         (iterator-ctor . ,Volta_repeat_iterator::constructor)
721         (internal-class-name . "Music")
722         (description . "")
723         (start-callback .  ,Repeated_music::first_start)
724         (length-callback . ,Repeated_music::volta_music_length)
725         (types . (general-music repeated-music volta-repeated-music))
726         ))
727     
728     (UnfoldedRepeatedMusic
729      . (
730         (iterator-ctor . ,Unfolded_repeat_iterator::constructor)
731         (description .  "")
732         (start-callback .  ,Repeated_music::first_start)
733         (internal-class-name . "Music")
734         (types . (general-music repeated-music unfolded-repeated-music))
735         (length-callback . ,Repeated_music::unfolded_music_length)
736         ))
737     (PercentRepeatedMusic
738      . (
739         (internal-class-name . "Music")
740         (description .  "Repeats encoded by percents.")
741         (iterator-ctor . ,Percent_repeat_iterator::constructor)
742         (start-callback .  ,Repeated_music::first_start)
743         (length-callback . ,Repeated_music::unfolded_music_length)
744         (types . (general-music repeated-music percent-repeated-music))
745         ))
746     
747     (TremoloRepeatedMusic
748      . (
749         (iterator-ctor . ,Chord_tremolo_iterator::constructor)
750         (description .  "Repeated notes denoted by tremolo beams.")
751         (internal-class-name . "Music")
752         (start-callback .  ,Repeated_music::first_start)
753
754         ;; the length of the repeat is handled by shifting the note logs
755         (length-callback . ,Repeated_music::folded_music_length)
756         (types . (general-music repeated-music tremolo-repeated-music))
757         
758         ))
759     
760     (FoldedRepeatedMusic
761      . (
762         (internal-class-name . "Music")
763         (description .  "Repeats with alternatives placed in parallel. ")
764         (iterator-ctor  . ,Folded_repeat_iterator::constructor)
765         (start-callback .  ,Repeated_music::minimum_start)
766         (length-callback . ,Repeated_music::folded_music_length)
767         (types . (general-music repeated-music folded-repeated-music))
768         ))
769     ))
770
771 (set! music-descriptions
772       (sort music-descriptions alist<?))
773
774 (define music-name-to-property-table (make-vector 59 '()))
775
776 ;; init hash table,
777 ;; transport description to an object property.
778 (set!
779  music-descriptions
780  (map (lambda (x)
781         (set-object-property! (car x)
782                               'music-description
783                               (cdr (assq 'description (cdr x))))
784         (let ((lst (cdr x)))
785           (set! lst (assoc-set! lst 'name (car x)))
786           (set! lst (assq-remove! lst 'description))
787           (hashq-set! music-name-to-property-table (car x) lst)
788           (cons (car x) lst)))
789       music-descriptions))
790
791 (define-safe-public (make-music name . music-properties)
792   "Create a music object of given name, and set its properties
793 according to `music-properties', a list of alterning property symbols
794 and values. E.g:
795   (make-music 'OverrideProperty 
796               'symbol 'Stem
797               'grob-property 'thickness
798               'grob-value (* 2 1.5))"
799   (if (not (symbol? name))
800       (ly:error (_ "symbol expected: ~S") name))
801   (let ((props (hashq-ref music-name-to-property-table name '())))
802     (if (not (pair? props))
803         (ly:error (_ "can't find music object: ~S") name))
804     (let ((m (ly:make-bare-music (cdr (assoc 'internal-class-name props)) props)))
805       (define (set-props mus-props)
806         (if (and (not (null? mus-props))
807                  (not (null? (cdr mus-props))))
808             (begin
809               (set! (ly:music-property m (car mus-props)) (cadr mus-props))
810               (set-props (cddr mus-props)))))
811       (set-props music-properties)
812       m)))
813
814 (define-public (make-repeated-music name)
815   (let* ((handle (assoc name '(("volta" . VoltaRepeatedMusic)
816                                ("unfold" . UnfoldedRepeatedMusic)
817                                ("percent" . PercentRepeatedMusic)
818                                ("tremolo" . TremoloRepeatedMusic)
819                                ("fold" . FoldedRepeatedMusic))))
820          (music-name (if (pair? handle)
821                          (cdr handle)
822                          (begin
823                            (ly:warning (_ "unknown repeat type `~S'") name)
824                            (ly:warning (_ "See music-types.scm for supported repeats"))
825                            'VoltaRepeatedMusic))))
826     (make-music music-name)))
827