]> git.donarmstrong.com Git - lilypond.git/blob - ly/music-functions-init.ly
Add docstrings to ly/music-functions-init.ly; contributed by Frederic
[lilypond.git] / ly / music-functions-init.ly
1 % -*-Scheme-*-
2
3 \version "2.12.0"
4
5
6 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7 %% this file is alphabetically sorted.
8 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9
10 %% need SRFI-1 filter 
11
12 #(use-modules (srfi srfi-1))
13
14 acciaccatura =
15 #(def-grace-function startAcciaccaturaMusic stopAcciaccaturaMusic)
16
17 addQuote =
18 #(define-music-function (parser location name music) (string? ly:music?)
19    (_i "Add a piece of music to be quoted ")
20    (add-quotable parser name music)
21    (make-music 'SequentialMusic 'void #t))
22
23 afterGraceFraction =
24 #(cons 6 8)
25
26 afterGrace =
27 #(define-music-function
28   (parser location main grace)
29   (ly:music? ly:music?)
30
31   (let*
32       ((main-length (ly:music-length main))
33        (fraction  (ly:parser-lookup parser 'afterGraceFraction)))
34     
35     (make-simultaneous-music
36      (list
37       main
38       (make-sequential-music
39        (list
40
41         (make-music 'SkipMusic
42                     'duration (ly:make-duration
43                                0 0
44                                (* (ly:moment-main-numerator main-length)
45                                   (car fraction))
46                                (* (ly:moment-main-denominator main-length)
47                                   (cdr fraction)) ))
48         (make-music 'GraceMusic
49                     'element grace)))))))
50
51 applyMusic =
52 #(define-music-function (parser location func music) (procedure? ly:music?)
53                (func music))
54
55
56 applyOutput =
57 #(define-music-function (parser location ctx proc) (symbol? procedure?)
58                 (make-music 'ApplyOutputEvent
59                   'origin location
60                   'procedure proc
61                   'context-type ctx))
62
63 appoggiatura =
64 #(def-grace-function startAppoggiaturaMusic stopAppoggiaturaMusic)
65
66
67
68 % for regression testing purposes.
69 assertBeamQuant =
70 #(define-music-function (parser location l r) (pair? pair?)
71   (make-grob-property-override 'Beam 'positions
72    (ly:make-simple-closure
73     (ly:make-simple-closure
74      (append
75       (list chain-grob-member-functions `(,cons 0 0))
76       (check-quant-callbacks l r))))))
77     
78 % for regression testing purposes.
79 assertBeamSlope =
80 #(define-music-function (parser location comp) (procedure?)
81   (make-grob-property-override 'Beam 'positions
82    (ly:make-simple-closure
83     (ly:make-simple-closure
84      (append
85       (list chain-grob-member-functions `(,cons 0 0))
86       (check-slope-callbacks comp))))))
87
88
89
90 autochange =
91 #(define-music-function (parser location music) (ly:music?)
92                (make-autochange-music parser music))
93
94 applyContext =
95 #(define-music-function (parser location proc) (procedure?)
96                  (make-music 'ApplyContext 
97                    'origin location
98                    'procedure proc))
99
100
101 balloonGrobText =
102 #(define-music-function (parser location grob-name offset text) (symbol? number-pair? markup?)
103    
104     (make-music 'AnnotateOutputEvent
105                 'symbol grob-name
106                 'X-offset (car offset)
107                 'Y-offset (cdr offset)
108                 'text text))
109
110 balloonText =
111 #(define-music-function (parser location offset text) (number-pair? markup?)
112    
113     (make-music 'AnnotateOutputEvent
114                 'X-offset (car offset)
115                 'Y-offset (cdr offset)
116                 'text text))
117
118
119 bar =
120 #(define-music-function (parser location type)
121    (string?)
122    (context-spec-music
123     (make-property-set 'whichBar type)
124     'Timing))
125
126
127 barNumberCheck =
128 #(define-music-function (parser location n) (integer?)
129   (_i "Print a warning if the current bar number is not @var{n}.")
130    (make-music 'ApplyContext 
131                'origin location
132                'procedure 
133                (lambda (c)
134                  (let*
135                      ((cbn (ly:context-property c 'currentBarNumber)))
136                    (if (and  (number? cbn) (not (= cbn n)))
137                        (ly:input-message location "Barcheck failed got ~a expect ~a"
138                                          cbn n))))))
139
140
141 bendAfter =
142 #(define-music-function (parser location delta) (real?)
143   (_i "Create a fall or doit of pitch interval @var{delta}.")
144   (make-music 'BendAfterEvent
145    'delta-step delta))
146
147 %% why a function?
148 breathe =
149 #(define-music-function (parser location) ()
150   (_i "Insert a breath mark.")
151             (make-music 'EventChord 
152               'origin location
153               'elements (list (make-music 'BreathingEvent))))
154
155
156 clef =
157 #(define-music-function (parser location type) (string?)
158   (_i "Set the current clef to @var{type}.")
159    (make-clef-set type))
160
161
162 cueDuring = 
163 #(define-music-function
164   (parser location what dir main-music) (string? ly:dir? ly:music?)
165   (_i "Insert contents of quote @var{what} corresponding to @var{main-music},
166 in a CueVoice oriented by @var{dir}.")
167   (make-music 'QuoteMusic
168               'element main-music 
169               'quoted-context-type 'Voice
170               'quoted-context-id "cue"
171               'quoted-music-name what
172               'quoted-voice-direction dir
173               'origin location))
174
175 displayLilyMusic =
176 #(define-music-function (parser location music) (ly:music?)
177   (_i "Display  @var{music} to the console in LilyPond input notation.")
178    (newline)
179    (display-lily-music music parser)
180    music)
181
182 displayMusic =
183 #(define-music-function (parser location music) (ly:music?)
184   (_i "Display the internal representation of @var{music} to the console.")
185    (newline)
186    (display-scheme-music music)
187    music)
188
189
190 endSpanners =
191 #(define-music-function (parser location music) (ly:music?)
192   (_i "Terminate the next spanner prematurely after exactly one note without the need of a specific end spanner.")
193    (if (eq? (ly:music-property music 'name) 'EventChord)
194        (let*
195            ((elts (ly:music-property music 'elements))
196             (start-span-evs (filter (lambda (ev)
197                                 (and (music-has-type ev 'span-event)
198                                      (equal? (ly:music-property ev 'span-direction)
199                                              START)))
200                               elts))
201             (stop-span-evs
202              (map (lambda (m)
203                     (let* ((c (music-clone m)))
204                       (set! (ly:music-property c 'span-direction) STOP)
205                       c))
206                   start-span-evs))
207             (end-ev-chord (make-music 'EventChord
208                                       'elements stop-span-evs))
209             (total (make-music 'SequentialMusic
210                                'elements (list music
211                                                end-ev-chord))))
212          total)
213        
214        (ly:input-message location (_ "argument endSpanners is not an EventChord: ~a" music))))
215
216 featherDurations=
217 #(define-music-function (parser location factor argument) (ly:moment? ly:music?)
218    (_i "Rearrange durations in ARGUMENT so there is an
219 acceleration/deceleration. ")
220    
221    (let*
222        ((orig-duration (ly:music-length argument))
223         (multiplier (ly:make-moment 1 1)))
224
225      (music-map 
226       (lambda (mus)
227         (if (and (eq? (ly:music-property mus 'name) 'EventChord)
228                  (< 0 (ly:moment-main-denominator (ly:music-length mus))))
229             (begin
230               (ly:music-compress mus multiplier)
231               (set! multiplier (ly:moment-mul factor multiplier)))
232             )
233         mus)
234       argument)
235
236      (ly:music-compress
237       argument
238       (ly:moment-div orig-duration (ly:music-length argument)))
239
240      argument))
241
242 grace =
243 #(def-grace-function startGraceMusic stopGraceMusic)
244
245
246 "instrument-definitions" = #'()
247
248 addInstrumentDefinition =
249 #(define-music-function
250    (parser location name lst) (string? list?)
251
252    (set! instrument-definitions (acons name lst instrument-definitions))
253
254    (make-music 'SequentialMusic 'void #t))
255
256
257 instrumentSwitch =
258 #(define-music-function
259    (parser location name) (string?)
260    (let*
261        ((handle  (assoc name instrument-definitions))
262         (instrument-def (if handle (cdr handle) '()))
263         )
264
265      (if (not handle)
266          (ly:input-message "No such instrument: ~a" name))
267      (context-spec-music
268       (make-music 'SimultaneousMusic
269                   'elements
270                   (map (lambda (kv)
271                          (make-property-set
272                           (car kv)
273                           (cdr kv)))
274                        instrument-def))
275       'Staff)))
276
277
278 %% Parser used to read page-layout file, and then retreive score tweaks.
279 #(define page-layout-parser #f)
280
281 includePageLayoutFile = 
282 #(define-music-function (parser location) ()
283    (_i "If page breaks and tweak dump is not asked, and the file
284 <basename>-page-layout.ly exists, include it.")
285    (if (not (ly:get-option 'dump-tweaks))
286        (let ((tweak-filename (format #f "~a-page-layout.ly"
287                                      (ly:parser-output-name parser))))
288          (if (access? tweak-filename R_OK)
289              (begin
290                (ly:message "Including tweak file ~a" tweak-filename)
291                (set! page-layout-parser (ly:parser-clone parser))
292                (ly:parser-parse-string page-layout-parser
293                                        (format #f "\\include \"~a\""
294                                                tweak-filename))))))
295    (make-music 'SequentialMusic 'void #t))
296
297
298
299 keepWithTag =
300 #(define-music-function
301   (parser location tag music) (symbol? ly:music?)
302   (music-filter
303    (lambda (m)
304     (let* ((tags (ly:music-property m 'tags))
305            (res (memq tag tags)))
306      (or
307       (eq? tags '())
308       res)))
309    music))
310
311 removeWithTag = 
312 #(define-music-function
313   (parser location tag music) (symbol? ly:music?)
314   (music-filter
315    (lambda (m)
316     (let* ((tags (ly:music-property m 'tags))
317            (res (memq tag tags)))
318      (not res)))
319  music))
320
321 killCues =
322 #(define-music-function
323    (parser location music)
324    (ly:music?)
325    (music-map
326     (lambda (mus)
327       (if (string? (ly:music-property mus 'quoted-music-name))
328           (ly:music-property mus 'element)
329           mus)) music))
330
331 label = 
332 #(define-music-function (parser location label) (symbol?)
333    (_i "Place a bookmarking label, either at top-level or inside music.")
334    (make-music 'EventChord
335                'page-marker #t
336                'page-label label
337                'elements (list (make-music 'LabelEvent
338                                            'page-label label)))) 
339
340 makeClusters =
341 #(define-music-function
342                 (parser location arg) (ly:music?)
343                 (music-map note-to-cluster arg))
344
345 musicMap =
346 #(define-music-function (parser location proc mus) (procedure? ly:music?)
347              (music-map proc mus))
348
349
350
351 oldaddlyrics =
352 #(define-music-function (parser location music lyrics) (ly:music? ly:music?)
353
354               (make-music 'OldLyricCombineMusic 
355                           'origin location
356                           'elements (list music lyrics)))
357
358
359 overrideProperty =
360 #(define-music-function (parser location name property value)
361    (string? symbol? scheme?)
362
363
364    (_i "Set @var{property} to @var{value} in all grobs named @var{name}.
365 The @var{name} argument is a string of the form @code{\"Context.GrobName\"}
366 or @code{\"GrobName\"}")
367
368    (let*
369        ((name-components (string-split name #\.))
370         (context-name 'Bottom)
371         (grob-name #f))
372
373      (if (> 2 (length name-components))
374          (set! grob-name (string->symbol (car name-components)))
375          (begin
376            (set! grob-name (string->symbol (list-ref name-components 1)))
377            (set! context-name (string->symbol (list-ref name-components 0)))))
378
379      (make-music 'ApplyOutputEvent
380                  'origin location
381                  'context-type context-name
382                  'procedure
383                  (lambda (grob orig-context context)
384                    (if (equal?
385                         (cdr (assoc 'name (ly:grob-property grob 'meta)))
386                         grob-name)
387                        (set! (ly:grob-property grob property) value))))))
388
389 %% These are music functions (iso music indentifiers), because music identifiers
390 %% are not allowed at top-level.
391 pageBreak =
392 #(define-music-function (location parser) ()
393    (_i "Force a page break. May be used at toplevel (ie between scores or
394 markups), or inside a score.")
395    (make-music 'EventChord
396                'page-marker #t
397                'line-break-permission 'force
398                'page-break-permission 'force
399                'elements (list (make-music 'LineBreakEvent
400                                            'break-permission 'force)
401                                (make-music 'PageBreakEvent
402                                            'break-permission 'force))))
403
404 noPageBreak =
405 #(define-music-function (location parser) ()
406    (_i "Forbid a page break. May be used at toplevel (ie between scores or
407 markups), or inside a score.")
408    (make-music 'EventChord
409                'page-marker #t
410                'page-break-permission 'forbid
411                'elements (list (make-music 'PageBreakEvent
412                                            'break-permission '()))))
413
414 pageTurn =
415 #(define-music-function (location parser) ()
416    (_i "Force a page turn between two scores or top-level markups.")
417    (make-music 'EventChord 
418                'page-marker #t
419                'line-break-permission 'force
420                'page-break-permission 'force
421                'page-turn-permission 'force
422                'elements (list (make-music 'LineBreakEvent
423                                            'break-permission 'force)
424                                (make-music 'PageBreakEvent
425                                            'break-permission 'force)
426                                (make-music 'PageTurnEvent
427                                            'break-permission 'force))))
428
429 noPageTurn =
430 #(define-music-function (location parser) ()
431    (_i "Forbid a page turn. May be used at toplevel (ie between scores or
432 markups), or inside a score.")
433    (make-music 'EventChord
434                'page-marker #t
435                'page-turn-permission 'forbid
436                'elements (list (make-music 'PageTurnEvent
437                                            'break-permission '()))))
438
439 allowPageTurn =
440 #(define-music-function (location parser) ()
441    (_i "Allow a page turn. May be used at toplevel (ie between scores or
442 markups), or inside a score.")
443    (make-music 'EventChord
444                'page-marker #t
445                'page-turn-permission 'allow
446                'elements (list (make-music 'PageTurnEvent
447                                            'break-permission 'allow))))
448
449 %% Todo:
450 %% doing
451 %% define-music-function in a .scm causes crash.
452
453 octaveCheck =
454 #(define-music-function (parser location pitch-note) (ly:music?)
455    (_i "octave check")
456
457    (make-music 'RelativeOctaveCheck
458                'origin location
459                'pitch (pitch-of-note pitch-note) 
460            ))
461
462 ottava = #(define-music-function (parser location octave) (number?)
463   (_i "set the octavation ")
464   (make-ottava-set octave))
465
466 partcombine =
467 #(define-music-function (parser location part1 part2) (ly:music? ly:music?)
468                 (make-part-combine-music parser
469                                          (list part1 part2)))
470
471               
472 pitchedTrill =
473 #(define-music-function
474    (parser location main-note secondary-note)
475    (ly:music? ly:music?)
476    (let*
477        ((get-notes (lambda (ev-chord)
478                      (filter
479                       (lambda (m) (eq? 'NoteEvent (ly:music-property m 'name)))
480                       (ly:music-property ev-chord 'elements))))
481         (sec-note-events (get-notes secondary-note))
482         (trill-events (filter (lambda (m) (music-has-type m 'trill-span-event))
483                               (ly:music-property main-note 'elements))))
484
485      (if (pair? sec-note-events)
486          (begin
487            (let*
488                ((trill-pitch (ly:music-property (car sec-note-events) 'pitch))
489                 (forced (ly:music-property (car sec-note-events ) 'force-accidental)))
490              
491              (if (ly:pitch? trill-pitch)
492                  (for-each (lambda (m) (ly:music-set-property! m 'pitch trill-pitch))
493                            trill-events)
494                  (begin
495                    (ly:warning (_ "Second argument of \\pitchedTrill should be single note: "))
496                    (display sec-note-events)))
497
498              (if (eq? forced #t)
499                  (for-each (lambda (m) (ly:music-set-property! m 'force-accidental forced))
500                            trill-events)))))
501      main-note))
502
503
504
505 %% for lambda*
506 #(use-modules (ice-9 optargs))
507
508 parallelMusic =
509 #(define-music-function (parser location voice-ids music) (list? ly:music?)
510   (_i "Define parallel music sequences, separated by '|' (bar check signs),
511 and assign them to the identifiers provided in @var{voice-ids}.
512
513 @var{voice-ids}: a list of music identifiers (symbols containing only letters)
514
515 @var{music}: a music sequence, containing BarChecks as limiting expressions.
516
517 Example:
518
519 @verbatim
520   \\parallelMusic #'(A B C) {
521     c c | d d | e e |
522     d d | e e | f f |
523   }
524 <==>
525   A = { c c | d d | }
526   B = { d d | e e | }
527   C = { e e | f f | }
528 @end verbatim
529 ")
530   (let* ((voices (apply circular-list (make-list (length voice-ids) (list))))
531          (current-voices voices)
532          (current-sequence (list)))
533     ;;
534     ;; utilities
535     (define (push-music m)
536       "Push the music expression into the current sequence"
537       (set! current-sequence (cons m current-sequence)))
538     (define (change-voice)
539       "Stores the previously built sequence into the current voice and
540        change to the following voice."
541       (list-set! current-voices 0 (cons (make-music 'SequentialMusic 
542                                          'elements (reverse! current-sequence))
543                                         (car current-voices)))
544       (set! current-sequence (list))
545       (set! current-voices (cdr current-voices)))
546     (define (bar-check? m)
547       "Checks whether m is a bar check."
548       (eq? (ly:music-property m 'name) 'BarCheck))
549     (define (music-origin music)
550       "Recursively search an origin location stored in music."
551       (cond ((null? music) #f)
552             ((not (null? (ly:music-property music 'origin)))
553              (ly:music-property music 'origin))
554             (else (or (music-origin (ly:music-property music 'element))
555                       (let ((origins (remove not (map music-origin 
556                                                       (ly:music-property music 'elements)))))
557                         (and (not (null? origins)) (car origins)))))))
558     ;;
559     ;; first, split the music and fill in voices
560     (map-in-order (lambda (m)
561                     (push-music m)
562                     (if (bar-check? m) (change-voice)))
563                   (ly:music-property music 'elements))
564     (if (not (null? current-sequence)) (change-voice))
565     ;; un-circularize `voices' and reorder the voices
566     (set! voices (map-in-order (lambda (dummy seqs)
567                                  (reverse! seqs))
568                                voice-ids voices))
569     ;;
570     ;; set origin location of each sequence in each voice
571     ;; for better type error tracking
572     (for-each (lambda (voice)
573                 (for-each (lambda (seq)
574                             (set! (ly:music-property seq 'origin)
575                                   (or (music-origin seq) location)))
576                           voice))
577               voices)
578     ;;
579     ;; check sequence length
580     (apply for-each (lambda* (#:rest seqs)
581                       (let ((moment-reference (ly:music-length (car seqs))))
582                         (for-each (lambda (seq moment)
583                                     (if (not (equal? moment moment-reference))
584                                         (ly:music-message seq 
585                                          "Bars in parallel music don't have the same length")))
586                           seqs (map-in-order ly:music-length seqs))))
587            voices)
588    ;;
589    ;; bind voice identifiers to the voices
590    (map (lambda (voice-id voice)
591           (ly:parser-define! parser voice-id 
592                              (make-music 'SequentialMusic 
593                                'origin location
594                                'elements voice)))
595         voice-ids voices))
596  ;; Return an empty sequence. this function is actually a "void" function.
597  (make-music 'SequentialMusic 'void #t))
598
599
600
601 parenthesize =
602 #(define-music-function (parser loc arg) (ly:music?)
603    (_i "Tag @var{arg} to be parenthesized.")
604
605    (if (memq 'event-chord (ly:music-property arg 'types))
606      ; arg is an EventChord -> set the parenthesize property on all child notes and rests
607      (map
608        (lambda (ev)
609          (if (or (memq 'note-event (ly:music-property ev 'types))
610                  (memq 'rest-event (ly:music-property ev 'types)))
611            (set! (ly:music-property ev 'parenthesize) #t)))
612        (ly:music-property arg 'elements))
613      ; No chord, simply set property for this expression:
614      (set! (ly:music-property arg 'parenthesize) #t))
615    arg)
616
617
618 quoteDuring = #
619 (define-music-function
620   (parser location what main-music)
621   (string? ly:music?)
622   (make-music 'QuoteMusic
623               'element main-music
624               'quoted-music-name what
625               'origin location))
626
627
628
629 resetRelativeOctave  =
630 #(define-music-function
631     (parser location reference-note)
632     (ly:music?)
633     (_i "Set the octave inside a \\relative section.")
634
635    (let*
636     ((notes (ly:music-property reference-note 'elements))
637      (pitch (ly:music-property (car notes) 'pitch)))
638
639     (set! (ly:music-property reference-note 'elements) '())
640     (set! (ly:music-property reference-note
641        'to-relative-callback)
642        (lambda (music last-pitch)
643         pitch))
644
645     reference-note))
646
647
648 scaleDurations =
649 #(define-music-function
650                   (parser location fraction music) (number-pair? ly:music?)
651                   (ly:music-compress music (ly:make-moment (car fraction) (cdr fraction))))
652
653
654
655 shiftDurations =
656 #(define-music-function (parser location dur dots arg) (integer? integer? ly:music?)
657    (_i "")
658    
659    (music-map
660     (lambda (x)
661       (shift-one-duration-log x dur dots)) arg))
662
663 spacingTweaks =
664 #(define-music-function (parser location parameters) (list?)
665    (_i "Set the system stretch, by reading the 'system-stretch property of
666 the `parameters' assoc list.")
667    #{
668       \overrideProperty #"Score.NonMusicalPaperColumn"
669         #'line-break-system-details
670         #$(list (cons 'alignment-extra-space (cdr (assoc 'system-stretch parameters)))
671                 (cons 'system-Y-extent (cdr (assoc 'system-Y-extent parameters))))
672    #})
673
674
675 rightHandFinger =
676 #(define-music-function (parser location finger) (number-or-string?)
677    (_i "Define a StrokeFingerEvent")
678    
679    (apply make-music
680           (append
681            (list 
682             'StrokeFingerEvent
683             'origin location)
684            (if  (string? finger)
685                 (list 'text finger)
686                 (list 'digit finger)))))
687
688 scoreTweak =
689 #(define-music-function (parser location name) (string?)
690    (_i "Include the score tweak, if exists.")
691    (if (and page-layout-parser (not (ly:get-option 'dump-tweaks)))
692        (let ((tweak-music (ly:parser-lookup page-layout-parser
693                                             (string->symbol name))))
694          (if (ly:music? tweak-music)
695              tweak-music
696              (make-music 'SequentialMusic)))
697        (make-music 'SequentialMusic)))
698
699
700 tag = #(define-music-function (parser location tag arg)
701    (symbol? ly:music?)
702
703    (_i "Add @var{tag} to the @code{tags} property of @var{arg}.")
704
705    (set!
706     (ly:music-property arg 'tags)
707     (cons tag
708           (ly:music-property arg 'tags)))
709    arg)
710
711
712
713 transposedCueDuring =
714 #(define-music-function
715   (parser location what dir pitch-note main-music)
716   (string? ly:dir? ly:music? ly:music?)
717
718   (_i "Insert notes from the part @var{what} into a voice called @code{cue},
719 using the transposition defined by @var{pitch-note}.  This happens
720 simultaneously with @var{main-music}, which is usually a rest.  The
721 argument @var{dir} determines whether the cue notes should be notated
722 as a first or second voice.")
723
724   (make-music 'QuoteMusic
725               'element main-music
726               'quoted-context-type 'Voice
727               'quoted-context-id "cue"
728               'quoted-music-name what
729               'quoted-voice-direction dir
730               'quoted-transposition (pitch-of-note pitch-note)
731               'origin location))
732
733
734
735 transposition =
736 #(define-music-function (parser location pitch-note) (ly:music?)
737    (_i "Set instrument transposition")
738
739    (context-spec-music
740     (make-property-set 'instrumentTransposition
741                        (ly:pitch-negate (pitch-of-note pitch-note)))
742         'Staff))
743
744 tweak = #(define-music-function (parser location sym val arg)
745            (symbol? scheme? ly:music?)
746
747            (_i "Add @code{sym . val} to the @code{tweaks} property of @var{arg}.")
748            
749            (set!
750             (ly:music-property arg 'tweaks)
751             (acons sym val
752                    (ly:music-property arg 'tweaks)))
753            arg)
754
755
756
757 unfoldRepeats =
758 #(define-music-function (parser location music) (ly:music?)
759                   (unfold-repeats music))
760
761
762
763 withMusicProperty =
764 #(define-music-function (parser location sym val music) (symbol? scheme? ly:music?)
765    (_i "Set @var{sym} to @var{val} in @var{music}.")
766
767    (set! (ly:music-property music sym) val)
768    music)