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