1 %%%% -*- Mode: Scheme -*-
3 %%%% This file is part of LilyPond, the GNU music typesetter.
5 %%%% Copyright (C) 2003--2010 Han-Wen Nienhuys <hanwen@xs4all.nl>
6 %%%% Jan Nieuwenhuizen <janneke@gnu.org>
8 %%%% LilyPond is free software: you can redistribute it and/or modify
9 %%%% it under the terms of the GNU General Public License as published by
10 %%%% the Free Software Foundation, either version 3 of the License, or
11 %%%% (at your option) any later version.
13 %%%% LilyPond is distributed in the hope that it will be useful,
14 %%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
15 %%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 %%%% GNU General Public License for more details.
18 %%%% You should have received a copy of the GNU General Public License
19 %%%% along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
24 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
25 %% this file is alphabetically sorted.
26 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
28 %% need SRFI-1 for filter;
29 %% optargs for lambda*;
30 %% regex for string-match
31 #(use-modules (srfi srfi-1)
35 %% TODO: using define-music-function in a .scm causes crash.
38 #(def-grace-function startAcciaccaturaMusic stopAcciaccaturaMusic
39 (_i "Create an acciaccatura from the following music expression"))
41 %% keep these two together
42 "instrument-definitions" = #'()
43 addInstrumentDefinition =
44 #(define-music-function
45 (parser location name lst) (string? list?)
46 (_i "Create instrument @var{name} with properties @var{list}.")
47 (set! instrument-definitions (acons name lst instrument-definitions))
48 (make-music 'SequentialMusic 'void #t))
51 #(define-music-function (parser location name music) (string? ly:music?)
52 (_i "Define @var{music} as a quotable music expression named
54 (add-quotable parser name music)
55 (make-music 'SequentialMusic 'void #t))
57 %% keep these two together
58 afterGraceFraction = #(cons 6 8)
60 #(define-music-function (parser location main grace) (ly:music? ly:music?)
61 (_i "Create @var{grace} note(s) after a @var{main} music expression.")
62 (let ((main-length (ly:music-length main))
63 (fraction (ly:parser-lookup parser 'afterGraceFraction)))
64 (make-simultaneous-music
67 (make-sequential-music
70 (make-music 'SkipMusic
71 'duration (ly:make-duration
73 (* (ly:moment-main-numerator main-length)
75 (* (ly:moment-main-denominator main-length)
77 (make-music 'GraceMusic
81 %% music identifiers not allowed at top-level,
82 %% so this is a music-function instead.
84 #(define-music-function (location parser) ()
85 (_i "Allow a page turn. May be used at toplevel (ie between scores or
86 markups), or inside a score.")
87 (make-music 'EventChord
89 'page-turn-permission 'allow
90 'elements (list (make-music 'PageTurnEvent
91 'break-permission 'allow))))
94 #(define-music-function (parser location proc) (procedure?)
95 (_i "Modify context properties with Scheme procedure @var{proc}.")
96 (make-music 'ApplyContext
101 #(define-music-function (parser location func music) (procedure? ly:music?)
102 (_i"Apply procedure @var{func} to @var{music}.")
106 #(define-music-function (parser location ctx proc) (symbol? procedure?)
107 (_i "Apply function @code{proc} to every layout object in context @code{ctx}")
108 (make-music 'ApplyOutputEvent
114 #(def-grace-function startAppoggiaturaMusic stopAppoggiaturaMusic
115 (_i "Create an appoggiatura from @var{music}"))
117 % for regression testing purposes.
119 #(define-music-function (parser location l r) (pair? pair?)
120 (_i "Testing function: check whether the beam quants @var{l} and @var{r} are correct")
121 (make-grob-property-override 'Beam 'positions
122 (ly:make-simple-closure
123 (ly:make-simple-closure
125 (list chain-grob-member-functions `(,cons 0 0))
126 (check-quant-callbacks l r))))))
128 % for regression testing purposes.
130 #(define-music-function (parser location comp) (procedure?)
131 (_i "Testing function: check whether the slope of the beam is the same as @code{comp}")
132 (make-grob-property-override 'Beam 'positions
133 (ly:make-simple-closure
134 (ly:make-simple-closure
136 (list chain-grob-member-functions `(,cons 0 0))
137 (check-slope-callbacks comp))))))
140 #(define-music-function (parser location music) (ly:music?)
141 (_i "Make voices that switch between staves automatically")
142 (make-autochange-music parser music))
147 #(define-music-function (parser location grob-name offset text)
148 (symbol? number-pair? markup?)
149 (_i "Attach @var{text} to @var{grob-name} at offset @var{offset}
150 (use like @code{\\once})")
151 (make-music 'AnnotateOutputEvent
153 'X-offset (car offset)
154 'Y-offset (cdr offset)
158 #(define-music-function (parser location offset text) (number-pair? markup?)
159 (_i "Attach @var{text} at @var{offset} (use like @code{\\tweak})")
160 (make-music 'AnnotateOutputEvent
161 'X-offset (car offset)
162 'Y-offset (cdr offset)
166 #(define-music-function (parser location type) (string?)
167 (_i "Insert a bar line of type @var{type}")
169 (make-property-set 'whichBar type)
173 #(define-music-function (parser location n) (integer?)
174 (_i "Print a warning if the current bar number is not @var{n}.")
175 (make-music 'ApplyContext
179 (let ((cbn (ly:context-property c 'currentBarNumber)))
180 (if (and (number? cbn) (not (= cbn n)))
181 (ly:input-message location
182 "Barcheck failed got ~a expect ~a"
186 #(define-music-function (parser location delta) (real?)
187 (_i "Create a fall or doit of pitch interval @var{delta}.")
188 (make-music 'BendAfterEvent
192 #(define-music-function (parser location newfilename) (string?)
193 (_i "Direct output for the current book block to @var{newfilename}.")
194 (set! book-filename newfilename)
195 (make-music 'SequentialMusic 'void #t))
198 #(define-music-function (parser location newsuffix) (string?)
199 (_i "Set the output filename suffix for the current book block to
201 (set! book-output-suffix newsuffix)
202 (make-music 'SequentialMusic 'void #t))
206 #(define-music-function (parser location) ()
207 (_i "Insert a breath mark.")
208 (make-music 'EventChord
210 'elements (list (make-music 'BreathingEvent))))
215 #(define-music-function (parser location type) (string?)
216 (_i "Set the current clef to @var{type}.")
217 (make-clef-set type))
220 #(define-music-function
221 (parser location what dir main-music) (string? ly:dir? ly:music?)
222 (_i "Insert contents of quote @var{what} corresponding to @var{main-music},
223 in a CueVoice oriented by @var{dir}.")
224 (make-music 'QuoteMusic
226 'quoted-context-type 'Voice
227 'quoted-context-id "cue"
228 'quoted-music-name what
229 'quoted-voice-direction dir
235 #(define-music-function (parser location music) (ly:music?)
236 (_i "Display the LilyPond input representation of @var{music}
239 (display-lily-music music parser)
243 #(define-music-function (parser location music) (ly:music?)
244 (_i "Display the internal representation of @var{music} to the console.")
246 (display-scheme-music music)
252 #(define-music-function (parser location music) (ly:music?)
253 (_i "Terminate the next spanner prematurely after exactly one note
254 without the need of a specific end spanner.")
255 (if (eq? (ly:music-property music 'name) 'EventChord)
256 (let* ((elts (ly:music-property music 'elements))
257 (start-span-evs (filter (lambda (ev)
258 (and (music-has-type ev 'span-event)
259 (equal? (ly:music-property ev 'span-direction)
264 (let ((c (music-clone m)))
265 (set! (ly:music-property c 'span-direction) STOP)
268 (end-ev-chord (make-music 'EventChord
269 'elements stop-span-evs))
270 (total (make-music 'SequentialMusic
271 'elements (list music
275 (ly:input-message location (_ "argument endSpanners is not an EventChord: ~a" music))))
280 #(define-music-function (parser location factor argument) (ly:moment? ly:music?)
281 (_i "Adjust durations of music in @var{argument} by rational @var{factor}.")
282 (let ((orig-duration (ly:music-length argument))
283 (multiplier (ly:make-moment 1 1)))
287 (if (and (eq? (ly:music-property mus 'name) 'EventChord)
288 (< 0 (ly:moment-main-denominator (ly:music-length mus))))
290 (ly:music-compress mus multiplier)
291 (set! multiplier (ly:moment-mul factor multiplier))))
297 (ly:moment-div orig-duration (ly:music-length argument)))
304 #(def-grace-function startGraceMusic stopGraceMusic
305 (_i "Insert @var{music} as grace notes."))
310 #(define-music-function
311 (parser location name) (string?)
312 (_i "Switch instrument to @var{name}, which must be predefined with
313 @code{\\addInstrumentDefinition}.")
314 (let* ((handle (assoc name instrument-definitions))
315 (instrument-def (if handle (cdr handle) '())))
318 (ly:input-message location "No such instrument: ~a" name))
320 (make-music 'SimultaneousMusic
332 #(define-music-function (parser location tag music) (symbol? ly:music?)
333 (_i "Include only elements of @var{music} that are tagged with @var{tag}.")
336 (let* ((tags (ly:music-property m 'tags))
337 (res (memq tag tags)))
344 #(define-music-function (parser location music) (ly:music?)
345 (_i "Remove cue notes from @var{music}.")
348 (if (and (string? (ly:music-property mus 'quoted-music-name))
349 (string=? (ly:music-property mus 'quoted-context-id "") "cue"))
350 (ly:music-property mus 'element)
357 #(define-music-function (parser location label) (symbol?)
358 (_i "Create @var{label} as a bookmarking label.")
359 (make-music 'EventChord
362 'elements (list (make-music 'LabelEvent
363 'page-label label))))
367 #(define-music-function (parser location str) (string?)
368 (_i "Select note-names language.")
369 ;; This function is a hack around the old language
370 ;; selection system, using separate .ly files for each
371 ;; supported languages.
372 ;; TODO: re-implement language selection in a cleaner way.
373 (let* ((file-name (string-append (string-downcase! str) ".ly"))
375 ; Ugh. ly:gulp-file's "file not found" error message
376 ; won't be much informative in this specific case.
377 (raw-string (ly:gulp-file file-name))
379 ; extract the pitchnames alist.
380 (delim-alist (string-match "`\\(.*\\)\\)\\s[ |\n]?\\)" raw-string ))
381 (extract-alist (if delim-alist
382 (match:substring delim-alist)
386 (let ((lang-alist (eval-string extract-alist)))
387 (if (ly:get-option 'verbose)
388 (ly:message (_ "Using ~a note names...") str))
389 (set! pitchnames lang-alist)
390 (ly:parser-set-note-names parser lang-alist))
391 (ly:error (_ "Cannot process ~a as a language file.
392 Use \\include \"~a\" instead.") file-name file-name))
397 #(define-music-function (parser location arg) (ly:music?)
398 (_i "Display chords in @var{arg} as clusters.")
399 (music-map note-to-cluster arg))
402 #(define-music-function (parser location proc mus) (procedure? ly:music?)
403 (_i "Apply @var{proc} to @var{mus} and all of the music it contains.")
404 (music-map proc mus))
408 %% noPageBreak and noPageTurn are music functions (not music indentifiers),
409 %% because music identifiers are not allowed at top-level.
411 #(define-music-function (location parser) ()
412 (_i "Forbid a page break. May be used at toplevel (i.e., between scores or
413 markups), or inside a score.")
414 (make-music 'EventChord
416 'page-break-permission 'forbid
417 'elements (list (make-music 'PageBreakEvent
418 'break-permission '()))))
421 #(define-music-function (location parser) ()
422 (_i "Forbid a page turn. May be used at toplevel (i.e., between scores or
423 markups), or inside a score.")
424 (make-music 'EventChord
426 'page-turn-permission 'forbid
427 'elements (list (make-music 'PageTurnEvent
428 'break-permission '()))))
433 #(define-music-function (parser location pitch-note) (ly:music?)
435 (make-music 'RelativeOctaveCheck
437 'pitch (pitch-of-note pitch-note)))
440 #(define-music-function (parser location octave) (integer?)
441 (_i "Set the octavation.")
442 (make-music 'OttavaMusic
443 'ottava-number octave))
445 overrideTimeSignatureSettings =
446 #(define-music-function
447 (parser location context time-signature base-moment beat-structure beam-exceptions)
448 (symbol? pair? pair? cheap-list? cheap-list?)
450 (_i "Override @code{timeSignatureSettings} in @var{context}
451 for time signatures of @var{time-signature} to have settings
452 of @var{base-moment}, @var{beat-structure}, and @var{beam-exceptions}.")
454 ;; TODO -- add warning if largest value of grouping is
455 ;; greater than time-signature.
456 (let ((setting (make-setting base-moment beat-structure beam-exceptions)))
457 (override-time-signature-setting time-signature setting context)))
460 #(define-music-function (parser location name property value)
461 (string? symbol? scheme?)
463 (_i "Set @var{property} to @var{value} in all grobs named @var{name}.
464 The @var{name} argument is a string of the form @code{\"Context.GrobName\"}
465 or @code{\"GrobName\"}.")
467 (let ((name-components (string-split name #\.))
468 (context-name 'Bottom)
471 (if (> 2 (length name-components))
472 (set! grob-name (string->symbol (car name-components)))
474 (set! grob-name (string->symbol (list-ref name-components 1)))
475 (set! context-name (string->symbol (list-ref name-components 0)))))
477 (make-music 'ApplyOutputEvent
479 'context-type context-name
481 (lambda (grob orig-context context)
483 (cdr (assoc 'name (ly:grob-property grob 'meta)))
485 (set! (ly:grob-property grob property) value))))))
489 %% pageBreak and pageTurn are music functions (iso music indentifiers),
490 %% because music identifiers are not allowed at top-level.
492 #(define-music-function (location parser) ()
493 (_i "Force a page break. May be used at toplevel (i.e., between scores or
494 markups), or inside a score.")
495 (make-music 'EventChord
497 'line-break-permission 'force
498 'page-break-permission 'force
499 'elements (list (make-music 'LineBreakEvent
500 'break-permission 'force)
501 (make-music 'PageBreakEvent
502 'break-permission 'force))))
505 #(define-music-function (location parser) ()
506 (_i "Force a page turn between two scores or top-level markups.")
507 (make-music 'EventChord
509 'line-break-permission 'force
510 'page-break-permission 'force
511 'page-turn-permission 'force
512 'elements (list (make-music 'LineBreakEvent
513 'break-permission 'force)
514 (make-music 'PageBreakEvent
515 'break-permission 'force)
516 (make-music 'PageTurnEvent
517 'break-permission 'force))))
520 #(define-music-function (parser location voice-ids music) (list? ly:music?)
521 (_i "Define parallel music sequences, separated by '|' (bar check signs),
522 and assign them to the identifiers provided in @var{voice-ids}.
524 @var{voice-ids}: a list of music identifiers (symbols containing only letters)
526 @var{music}: a music sequence, containing BarChecks as limiting expressions.
531 \\parallelMusic #'(A B C) {
541 (let* ((voices (apply circular-list (make-list (length voice-ids) (list))))
542 (current-voices voices)
543 (current-sequence (list)))
546 (define (push-music m)
547 "Push the music expression into the current sequence"
548 (set! current-sequence (cons m current-sequence)))
549 (define (change-voice)
550 "Stores the previously built sequence into the current voice and
551 change to the following voice."
552 (list-set! current-voices 0 (cons (make-music 'SequentialMusic
553 'elements (reverse! current-sequence))
554 (car current-voices)))
555 (set! current-sequence (list))
556 (set! current-voices (cdr current-voices)))
557 (define (bar-check? m)
558 "Checks whether m is a bar check."
559 (eq? (ly:music-property m 'name) 'BarCheck))
560 (define (music-origin music)
561 "Recursively search an origin location stored in music."
562 (cond ((null? music) #f)
563 ((not (null? (ly:music-property music 'origin)))
564 (ly:music-property music 'origin))
565 (else (or (music-origin (ly:music-property music 'element))
566 (let ((origins (remove not (map music-origin
567 (ly:music-property music 'elements)))))
568 (and (not (null? origins)) (car origins)))))))
570 ;; first, split the music and fill in voices
571 (map-in-order (lambda (m)
573 (if (bar-check? m) (change-voice)))
574 (ly:music-property music 'elements))
575 (if (not (null? current-sequence)) (change-voice))
576 ;; un-circularize `voices' and reorder the voices
577 (set! voices (map-in-order (lambda (dummy seqs)
581 ;; set origin location of each sequence in each voice
582 ;; for better type error tracking
583 (for-each (lambda (voice)
584 (for-each (lambda (seq)
585 (set! (ly:music-property seq 'origin)
586 (or (music-origin seq) location)))
590 ;; check sequence length
591 (apply for-each (lambda* (#:rest seqs)
592 (let ((moment-reference (ly:music-length (car seqs))))
593 (for-each (lambda (seq moment)
594 (if (not (equal? moment moment-reference))
595 (ly:music-message seq
596 "Bars in parallel music don't have the same length")))
597 seqs (map-in-order ly:music-length seqs))))
600 ;; bind voice identifiers to the voices
601 (map (lambda (voice-id voice)
602 (ly:parser-define! parser voice-id
603 (make-music 'SequentialMusic
607 ;; Return an empty sequence. This function is actually a "void" function.
608 (make-music 'SequentialMusic 'void #t))
611 #(define-music-function (parser loc arg) (ly:music?)
612 (_i "Tag @var{arg} to be parenthesized.")
614 (if (memq 'event-chord (ly:music-property arg 'types))
615 ;; arg is an EventChord -> set the parenthesize property
616 ;; on all child notes and rests
619 (if (or (memq 'note-event (ly:music-property ev 'types))
620 (memq 'rest-event (ly:music-property ev 'types)))
621 (set! (ly:music-property ev 'parenthesize) #t)))
622 (ly:music-property arg 'elements))
623 ;; No chord, simply set property for this expression:
624 (set! (ly:music-property arg 'parenthesize) #t))
628 #(define-music-function (parser location part1 part2) (ly:music? ly:music?)
629 (_i "Take the music in @var{part1} and @var{part2} and typeset so
630 that they share a staff.")
631 (make-part-combine-music parser
634 #(define (symbol-or-boolean? x) (or (symbol? x) (boolean? x)))
636 #(define-music-function (location parser type once) (symbol-or-boolean? boolean?)
637 (_i "Override the part-combiner.")
638 (make-music 'EventChord
639 'elements (list (make-music 'PartCombineForceEvent
642 partcombineApart = \partcombineForce #'apart ##f
643 partcombineApartOnce = \partcombineForce #'apart ##t
644 partcombineChords = \partcombineForce #'chords ##f
645 partcombineChordsOnce = \partcombineForce #'chords ##t
646 partcombineUnisono = \partcombineForce #'unisono ##f
647 partcombineUnisonoOnce = \partcombineForce #'unisono ##t
648 partcombineSoloI = \partcombineForce #'solo1 ##f
649 partcombineSoloIOnce = \partcombineForce #'solo1 ##t
650 partcombineSoloII = \partcombineForce #'solo2 ##f
651 partcombineSoloIIOnce = \partcombineForce #'solo2 ##t
652 partcombineAutomatic = \partcombineForce ##f ##f
653 partcombineAutomaticOnce = \partcombineForce ##f ##t
657 #(define-music-function
658 (parser location main-note secondary-note)
659 (ly:music? ly:music?)
660 (_i "Print a trill with @var{main-note} as the main note of the trill and
661 print @var{secondary-note} as a stemless note head in parentheses.")
662 (let* ((get-notes (lambda (ev-chord)
664 (lambda (m) (eq? 'NoteEvent (ly:music-property m 'name)))
665 (ly:music-property ev-chord 'elements))))
666 (sec-note-events (get-notes secondary-note))
667 (trill-events (filter (lambda (m) (music-has-type m 'trill-span-event))
668 (ly:music-property main-note 'elements))))
670 (if (pair? sec-note-events)
672 (let* ((trill-pitch (ly:music-property (car sec-note-events) 'pitch))
673 (forced (ly:music-property (car sec-note-events) 'force-accidental)))
675 (if (ly:pitch? trill-pitch)
676 (for-each (lambda (m)
677 (ly:music-set-property! m 'pitch trill-pitch)) trill-events)
679 (ly:warning (_ "Second argument of \\pitchedTrill should be single note: "))
680 (display sec-note-events)))
683 (for-each (lambda (m)
684 (ly:music-set-property! m 'force-accidental forced))
689 #(define-music-function (parser location what main-music) (string? ly:music?)
690 (_i "Indicate a section of music to be quoted. @var{what} indicates the name
691 of the quoted voice, as specified in an @code{\\addQuote} command.
692 @var{main-music} is used to indicate the length of music to be quoted;
693 usually contains spacers or multi-measure rests.")
694 (make-music 'QuoteMusic
696 'quoted-music-name what
700 #(define-music-function (parser location tag music) (symbol? ly:music?)
701 (_i "Remove elements of @var{music} that are tagged with @var{tag}.")
704 (let* ((tags (ly:music-property m 'tags))
705 (res (memq tag tags)))
709 resetRelativeOctave =
710 #(define-music-function (parser location reference-note) (ly:music?)
711 (_i "Set the octave inside a \\relative section.")
713 (let* ((notes (ly:music-property reference-note 'elements))
714 (pitch (ly:music-property (car notes) 'pitch)))
716 (set! (ly:music-property reference-note 'elements) '())
717 (set! (ly:music-property reference-note 'to-relative-callback)
718 (lambda (music last-pitch)
723 revertTimeSignatureSettings =
724 #(define-music-function
725 (parser location context time-signature)
728 (_i "Revert @code{timeSignatureSettings} in @var{context}
729 for time signatures of @var{time-signature}.")
730 (revert-time-signature-setting time-signature context))
733 #(define-music-function (parser location finger) (number-or-string?)
734 (_i "Apply @var{finger} as a fingering indication.")
743 (list 'digit finger)))))
748 #(define-music-function (parser location fraction music)
749 (number-pair? ly:music?)
750 (_i "Multiply the duration of events in @var{music} by @var{fraction}.")
751 (ly:music-compress music
752 (ly:make-moment (car fraction) (cdr fraction))))
755 #(define-music-function (parser location dur dots arg)
756 (integer? integer? ly:music?)
757 (_i "Scale @var{arg} up by a factor of @var{2^dur*(2-(1/2)^dots)}.")
761 (shift-one-duration-log x dur dots)) arg))
764 #(define-music-function (parser location parameters) (list?)
765 (_i "Set the system stretch, by reading the 'system-stretch property of
766 the `parameters' assoc list.")
768 \overrideProperty #"Score.NonMusicalPaperColumn"
769 #'line-break-system-details
770 #$(list (cons 'alignment-extra-space (cdr (assoc 'system-stretch parameters)))
771 (cons 'system-Y-extent (cdr (assoc 'system-Y-extent parameters))))
775 #(define-music-function (parser location style heads music)
776 (symbol? list-or-symbol? ly:music?)
777 (_i "Set @var{heads} in @var{music} to @var{style}.")
778 (style-note-heads heads style music))
783 #(define-music-function (parser location) ()
784 (_i "Include the string information in a chord repetition.")
785 (ly:parser-set-repetition-function parser tab-repeat-chord)
786 (make-music 'SequentialMusic 'void #t))
789 #(define-music-function (parser location tag arg) (symbol? ly:music?)
791 (_i "Add @var{tag} to the @code{tags} property of @var{arg}.")
794 (ly:music-property arg 'tags)
796 (ly:music-property arg 'tags)))
799 transposedCueDuring =
800 #(define-music-function
801 (parser location what dir pitch-note main-music)
802 (string? ly:dir? ly:music? ly:music?)
804 (_i "Insert notes from the part @var{what} into a voice called @code{cue},
805 using the transposition defined by @var{pitch-note}. This happens
806 simultaneously with @var{main-music}, which is usually a rest. The
807 argument @var{dir} determines whether the cue notes should be notated
808 as a first or second voice.")
810 (make-music 'QuoteMusic
812 'quoted-context-type 'Voice
813 'quoted-context-id "cue"
814 'quoted-music-name what
815 'quoted-voice-direction dir
816 'quoted-transposition (pitch-of-note pitch-note)
820 #(define-music-function (parser location pitch-note) (ly:music?)
821 (_i "Set instrument transposition")
824 (make-property-set 'instrumentTransposition
825 (ly:pitch-negate (pitch-of-note pitch-note)))
829 #(define-music-function (parser location sym val arg)
830 (symbol? scheme? ly:music?)
831 (_i "Add @code{sym . val} to the @code{tweaks} property of @var{arg}.")
833 (if (equal? (object-property sym 'backend-type?) #f)
835 (ly:warning (_ "cannot find property type-check for ~a") sym)
836 (ly:warning (_ "doing assignment anyway"))))
838 (ly:music-property arg 'tweaks)
840 (ly:music-property arg 'tweaks)))
846 #(define-music-function (parser location music) (ly:music?)
847 (_i "Force any @code{\\repeat volta}, @code{\\repeat tremolo} or
848 @code{\\repeat percent} commands in @var{music} to be interpreted
849 as @code{\\repeat unfold}.")
850 (unfold-repeats music))
855 #(define-music-function (parser location sym val music)
856 (symbol? scheme? ly:music?)
857 (_i "Set @var{sym} to @var{val} in @var{music}.")
859 (set! (ly:music-property music sym) val)