2 (define-public music-descriptions
6 (description . "End the currently running spanners.")
7 (internal-class-name . "Event")
9 (types . (general-music event abort-event))
13 (description . "Creates a dynamic mark. Syntax: @var{note}@code{\\x},
14 where x is one of \@\{\\ppp, \\pp, \\p, \\mp, \\mf, \\f, \\ff, \\fff.\@\}")
15 (internal-class-name . "Event")
16 (types . (general-music event dynamic-event absolute-dynamic-event))
20 (description . "Call the argument with the current context during interpreting phase")
21 (internal-class-name . "Music")
22 (types . (general-music apply-context))
23 (iterator-ctor . ,Apply_context_iterator::constructor)
27 (description . "Make an arpeggio on this note. Syntax:
28 @var{note}-@code{\\arpeggio}")
29 (internal-class-name . "Event")
30 (types . (general-music arpeggio-event event))
33 ;; todo: use articulation-event for slur as well.
34 ;; separate non articulation scripts
37 (description . "Adds an articulation marking to a note. Syntax:
38 @var{note}@code{X}@code{Y}, where X is a direction (up @code{^}, down
39 @code{_}, or Lilypond's choice (no direction specified)), and where Y
40 is an articulation (such as @code{-.}, @code{->}, @code{\\tenuto},
41 @code{\\downbow}). See the user manual for details.")
43 (internal-class-name . "Event")
44 (types . (general-music event articulation-event script-event))
50 (internal-class-name . "Music_wrapper")
51 (iterator-ctor . ,Auto_change_iterator::constructor)
52 (types . (general-music music-wrapper-music auto-change-instruction))
57 (internal-class-name . "Music")
58 (types . (general-music bar-check))
59 (iterator-ctor . ,Bar_check_iterator::constructor)
65 (internal-class-name . "Event")
66 (types . (general-music event rhythmic-event bass-figure-event))
70 (description . "Starts or stops a beam. Syntax for manual control:
73 (internal-class-name . "Event")
74 (types . (general-music event beam-event span-event))
78 (description . "Starts or stops a beam. Syntax for manual control:
80 (internal-class-name . "Event")
81 (types . (general-music event new-beam-event span-event))
85 (description . "Creates a line break. Syntax: \\break.")
87 (internal-class-name . "Event")
88 (types . (general-music break-event event))
92 (description . "Creates a `breath mark' or `comma'. Syntax:
93 @var{note}\\breathe.")
95 (internal-class-name . "Event")
96 (types . (general-music event breathing-event))
102 (internal-class-name . "Event")
103 (types . (general-music event busy-playing-event))
107 (description . "Begins or ends a cluster.")
108 (internal-class-name . "Event")
109 (types . (general-music cluster-event span-event event))
114 (iterator-ctor . ,Context_specced_music_iterator::constructor)
115 (internal-class-name . "Music_wrapper")
116 (types . (context-specification general-music music-wrapper-music))
120 (description . "Begins or ends a crescendo. Syntax: @var{note}\\cr
121 ... @var{note}\\rc (you can also use \\<, \\!, \\cresc, and
122 \\endcresc. See the user manual for details.).")
124 (internal-class-name . "Event")
125 (types . (general-music dynamic-event crescendo-event event))
131 (internal-class-name . "Event")
132 (types . (general-music dynamic-event decrescendo-event event))
139 (internal-class-name . "Event")
140 (types . (general-music extender-event event))
145 (internal-class-name . "Event")
146 (types . (general-music fingering-event event))
152 (internal-class-name . "Event")
153 (types . (general-music glissando-event event))
159 (internal-class-name . "Grace_music")
160 (iterator-ctor . ,Grace_iterator::constructor)
161 (types . (grace-music music-wrapper-music general-music))
165 (description . "Start or stop grouping brackets.")
166 (internal-class-name . "Event")
167 (types . (general-music event note-grouping-event))
173 (internal-class-name . "Event")
174 (types . (general-music hyphen-event event))
180 (internal-class-name . "Key_change_ev")
181 (types . (general-music key-change-event event))
187 (internal-class-name . "Event")
188 (span-type . ligature)
189 (types . (general-music span-event ligature-event event))
195 (internal-class-name . "Lyric_combine_music")
196 (types . (general-music lyric-combine-music))
197 (iterator-ctor . ,Lyric_combine_music_iterator::constructor)
202 (description . "A lyric syllable. Must be entered in lyrics mode, i.e.
203 @code{\\lyrics @{ twinkle4 twinkle4 @} } .")
205 (internal-class-name . "Event")
206 (types . (general-music rhythmic-event lyric-event event))
212 (internal-class-name . "Event")
213 (types . (general-music mark-event event))
218 (internal-class-name . "Event")
219 (types . (general-music melisma-playing-event event))
221 (MultiMeasureRestEvent
223 (description . "Rests that may be compressed into Multi rests. Syntax
224 @code{R2.*4} for 4 measures in 3/4 time. Note the capital R.")
225 (internal-class-name . "Event")
226 (types . (general-music event multi-measure-rest-event))
232 (internal-class-name . "Music")
233 (types . (general-music))
239 (internal-class-name . "Event")
240 (types . (general-music event note-event rhythmic-event melodic-event))
246 (internal-class-name . "Music")
247 (types . (general-music layout-instruction))
248 (iterator-ctor . , Push_property_iterator::constructor)
255 (internal-class-name . "Simultaneous_music")
256 (types . (general-music part-combine-music))
257 (iterator-ctor . ,Part_combine_music_iterator::constructor)
261 (description . "Start or end phrasing slur. Syntax NOTE \\( and \\) NOTE")
262 (internal-class-name . "Event")
263 (types . (general-music span-event phrasing-slur-event))
268 (internal-class-name . "Music")
269 (types . (layout-instruction general-music))
270 (iterator-ctor . ,Property_iterator::constructor)
277 (internal-class-name . "Music")
278 (types . (layout-instruction general-music))
279 (iterator-ctor . ,Property_unset_iterator::constructor)
286 (internal-class-name . "Event")
287 (types . (general-music porrectus-event event))
293 (type . repeated-music)
294 (types . (general-music repeated-music))
300 (internal-class-name . "Event")
301 (types . (general-music event))
307 (internal-class-name . "Event")
308 (types . (general-music event rhythmic-event rest-event))
312 (description . "Music expressions concatenated. Syntax \\sequential @{..@} or simply @{..@} .")
314 (internal-class-name . "Sequential_music")
315 (iterator-ctor . ,Sequential_music_iterator::constructor)
316 (types . (general-music sequential-music))
320 (description . "Music playing together. Syntax: \\simultaneous @{ .. @} or < .. >.")
322 (internal-class-name . "Simultaneous_music")
323 (iterator-ctor . ,Simultaneous_music_iterator::constructor)
325 (types . (general-music simultaneous-music))
329 (description . "Start or end slur. Syntax NOTE( and )NOTE")
330 (internal-class-name . "Event")
331 (types . (general-music span-event slur-event))
338 (internal-class-name . "Music")
339 (types . (general-music layout-instruction))
340 (iterator-ctor . , Pop_property_iterator::constructor)
343 (OutputPropertySetMusic
347 (internal-class-name . "Music")
348 (iterator-ctor . ,Output_property_music_iterator::constructor)
349 (types . (general-music layout-instruction))
354 (description . "Start a text spanner like 8va.....|")
355 (internal-class-name . "Event")
356 (types . (general-music span-event text-span-event))
361 (internal-class-name . "Music")
362 (iterator-ctor . , Change_iterator::constructor)
363 (types . (general-music translator-change-instruction))
369 (internal-class-name . "Time_scaled_music")
370 (iterator-ctor . ,Time_scaled_music_iterator::constructor)
371 (types . (time-scaled-music music-wrapper-music general-music))
377 (internal-class-name . "Transposed_music")
378 (types . (music-wrapper-music general-music transposed-music))
385 (internal-class-name . "Untransposable_music")
386 (types . (music-wrapper-music general-music untransposable-music))
392 (internal-class-name . "Un_relativable_music")
393 (types . (music-wrapper-music general-music unrelativable-music))
400 (internal-class-name . "Relative_octave_music")
401 (types . (music-wrapper-music general-music relative-octave-music))
409 (internal-class-name . "Simultaneous_music")
410 (iterator-ctor . ,Event_chord_iterator::constructor)
411 (types . (general-music event-chord simultaneous-music))
419 (internal-class-name . "Event")
420 (types . (general-music event))
426 (internal-class-name . "Event")
427 (types . (general-music event rhythmic-event skip-event))
433 (internal-class-name . "Event")
434 (types . (general-music event))
439 (internal-class-name . "Event")
440 (types . (general-music pedal-event sustain-pedal-event))
445 (internal-class-name . "Event")
446 (types . (general-music pedal-event sostenuto-pedal-event))
451 (internal-class-name . "Event")
452 (types . (general-music pedal-event una-corda-pedal-event))
458 (internal-class-name . "Event")
459 (types . (general-music string-number-event event))
464 (internal-class-name . "Event")
465 (types . (general-music tempo-event event))
470 (internal-class-name . "Event")
471 (types . (general-music script-event text-script-event event))
475 (description . "A tie. Entered as ~.")
476 (internal-class-name . "Event")
477 (types . (general-music tie-event event))
481 (description . "A tie. Entered as @var{note}-~.")
482 (internal-class-name . "Event")
483 (types . (general-music new-tie-event event))
487 (description . "Un measured tremolo.")
488 (internal-class-name . "Event")
489 (types . (general-music event tremolo-event))
495 (internal-class-name . "Music")
496 (types . (separator general-music))
501 (iterator-ctor . ,Volta_repeat_iterator::constructor)
502 (internal-class-name . "Repeated_music")
504 (start-moment-function . ,Repeated_music::first_start)
505 (length . ,Repeated_music::volta_music_length)
506 (types . (general-music repeated-music volta-repeated-music))
509 (UnfoldedRepeatedMusic
511 (iterator-ctor . ,Unfolded_repeat_iterator::constructor)
513 (start-moment-function . ,Repeated_music::first_start)
514 (internal-class-name . "Repeated_music")
515 (types . (general-music repeated-music unfolded-repeated-music))
516 (length . ,Repeated_music::unfolded_music_length)
518 (PercentRepeatedMusic
520 (internal-class-name . "Repeated_music")
522 (iterator-ctor . ,Percent_repeat_iterator::constructor)
523 (start-moment-function . ,Repeated_music::first_start)
524 (length . ,Repeated_music::unfolded_music_length)
525 (types . (general-music repeated-music percent-repeated-music))
528 (TremoloRepeteadMusic
530 (iterator-ctor . ,Chord_tremolo_iterator::constructor)
532 (internal-class-name . "Repeated_music")
533 (start-moment-function . ,Repeated_music::first_start)
535 ;; the length of the repeat is handled by shifting the note logs
536 (length . ,Repeated_music::folded_music_length)
537 (types . (general-music repeated-music tremolo-repeated-music))
542 (internal-class-name . "Repeated_music")
544 (iterator-ctor . ,Folded_repeat_iterator::constructor)
545 (start-moment-function . ,Repeated_music::minimum_start)
546 (length . ,Repeated_music::folded_music_length)
547 (types . (general-music repeated-music folded-repeated-music))
551 (set! music-descriptions
552 (sort music-descriptions alist<?))
554 (define music-name-to-property-table (make-vector 59 '()))
558 ;; transport description to an object property.
562 (set-object-property! (car x)
564 (cdr (assq 'description (cdr x))))
567 (set! l (assoc-set! l 'name (car x)))
568 (set! l (assq-remove! l 'description))
569 (hashq-set! music-name-to-property-table (car x) l)
576 (define-public (make-music-by-name x)
577 (if (not (symbol? x))
578 (error (format "Not a symbol: ~a" x)))
581 (props (hashq-ref music-name-to-property-table x '()))
582 (name (if (pair? props)
583 (cdr (assoc 'internal-class-name props))
584 (error "Can not find music object" x)))
588 (ly:warn (format "Could not find music type `~a'" x)))
589 (ly:make-bare-music name props)
594 (define-public (make-repeated-music name)
599 '(("volta" . VoltaRepeatedMusic)
600 ("unfold" . UnfoldedRepeatedMusic)
601 ("percent" . PercentRepeatedMusic)
602 ("tremolo" . TremoloRepeteadMusic)
603 ("fold" . FoldedRepeatedMusic)
610 (string-append "Unknown repeat type `" name
611 "'\nSee music-types.scm for supported repeats"))
617 (make-music-by-name music-name)