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; optargs for lambda*
29 #(use-modules
(srfi srfi-
1)
32 %% TODO: using define-music-function in a .scm causes crash.
35 #(def-grace-function startAcciaccaturaMusic stopAcciaccaturaMusic
36 (_i
"Create an acciaccatura from the following music expression"))
38 %% keep these two together
39 "instrument-definitions" = #'()
40 addInstrumentDefinition
=
41 #(define-music-function
42 (parser location name lst
) (string? list?
)
43 (_i
"Create instrument @var{name} with properties @var{list}.")
44 (set
! instrument-definitions
(acons name lst instrument-definitions
))
45 (make-music
'SequentialMusic
'void
#t
))
48 #(define-music-function
(parser location name music
) (string? ly
:music?
)
49 (_i
"Define @var{music} as a quotable music expression named
51 (add-quotable parser name music
)
52 (make-music
'SequentialMusic
'void
#t
))
54 %% keep these two together
55 afterGraceFraction
= #(cons
6 8)
57 #(define-music-function
(parser location main grace
) (ly
:music? ly
:music?
)
58 (_i
"Create @var{grace} note(s) after a @var{main} music expression.")
59 (let
((main-length
(ly
:music-length main
))
60 (fraction
(ly
:parser-lookup parser
'afterGraceFraction
)))
61 (make-simultaneous-music
64 (make-sequential-music
67 (make-music
'SkipMusic
68 'duration
(ly
:make-duration
70 (* (ly
:moment-main-numerator main-length
)
72 (* (ly
:moment-main-denominator main-length
)
74 (make-music
'GraceMusic
78 %% music identifiers not allowed at top-level,
79 %% so this is a music-function instead.
81 #(define-music-function
(location parser
) ()
82 (_i
"Allow a page turn. May be used at toplevel (ie between scores or
83 markups), or inside a score.")
84 (make-music
'EventChord
86 'page-turn-permission
'allow
87 'elements
(list
(make-music
'PageTurnEvent
88 'break-permission
'allow
))))
91 #(define-music-function
(parser location proc
) (procedure?
)
92 (_i
"Modify context properties with Scheme procedure @var{proc}.")
93 (make-music
'ApplyContext
98 #(define-music-function
(parser location func music
) (procedure? ly
:music?
)
99 (_i
"Apply procedure @var{func} to @var{music}.")
103 #(define-music-function
(parser location ctx proc
) (symbol? procedure?
)
104 (_i
"Apply function @code{proc} to every layout object in context @code{ctx}")
105 (make-music
'ApplyOutputEvent
111 #(def-grace-function startAppoggiaturaMusic stopAppoggiaturaMusic
112 (_i
"Create an appoggiatura from @var{music}"))
114 % for regression testing purposes.
116 #(define-music-function
(parser location l r
) (pair? pair?
)
117 (_i
"Testing function: check whether the beam quants @var{l} and @var{r} are correct")
118 (make-grob-property-override
'Beam
'positions
119 (ly
:make-simple-closure
120 (ly
:make-simple-closure
122 (list chain-grob-member-functions `
(,cons
0 0))
123 (check-quant-callbacks l r
))))))
125 % for regression testing purposes.
127 #(define-music-function
(parser location comp
) (procedure?
)
128 (_i
"Testing function: check whether the slope of the beam is the same as @code{comp}")
129 (make-grob-property-override
'Beam
'positions
130 (ly
:make-simple-closure
131 (ly
:make-simple-closure
133 (list chain-grob-member-functions `
(,cons
0 0))
134 (check-slope-callbacks comp
))))))
137 #(define-music-function
(parser location music
) (ly
:music?
)
138 (_i
"Make voices that switch between staves automatically")
139 (make-autochange-music parser music
))
144 #(define-music-function
(parser location grob-name offset text
)
145 (symbol? number-pair? markup?
)
146 (_i
"Attach @var{text} to @var{grob-name} at offset @var{offset}
147 (use like @code{\\once})")
148 (make-music
'AnnotateOutputEvent
150 'X-offset
(car offset
)
151 'Y-offset
(cdr offset
)
155 #(define-music-function
(parser location offset text
) (number-pair? markup?
)
156 (_i
"Attach @var{text} at @var{offset} (use like @code{\\tweak})")
157 (make-music
'AnnotateOutputEvent
158 'X-offset
(car offset
)
159 'Y-offset
(cdr offset
)
163 #(define-music-function
(parser location type
) (string?
)
164 (_i
"Insert a bar line of type @var{type}")
166 (make-property-set
'whichBar type
)
170 #(define-music-function
(parser location n
) (integer?
)
171 (_i
"Print a warning if the current bar number is not @var{n}.")
172 (make-music
'ApplyContext
176 (let
((cbn
(ly
:context-property
c 'currentBarNumber
)))
177 (if
(and
(number? cbn
) (not
(= cbn n
)))
178 (ly
:input-message location
179 "Barcheck failed got ~a expect ~a"
183 #(define-music-function
(parser location delta
) (real?
)
184 (_i
"Create a fall or doit of pitch interval @var{delta}.")
185 (make-music
'BendAfterEvent
189 #(define-music-function
(parser location newfilename
) (string?
)
190 (_i
"Direct output for the current book block to @var{newfilename}.")
191 (set
! book-filename newfilename
)
192 (make-music
'SequentialMusic
'void
#t
))
195 #(define-music-function
(parser location newsuffix
) (string?
)
196 (_i
"Set the output filename suffix for the current book block to
198 (set
! book-output-suffix newsuffix
)
199 (make-music
'SequentialMusic
'void
#t
))
203 #(define-music-function
(parser location
) ()
204 (_i
"Insert a breath mark.")
205 (make-music
'EventChord
207 'elements
(list
(make-music
'BreathingEvent
))))
212 #(define-music-function
(parser location type
) (string?
)
213 (_i
"Set the current clef to @var{type}.")
214 (make-clef-set type
))
217 #(define-music-function
218 (parser location what dir main-music
) (string? ly
:dir? ly
:music?
)
219 (_i
"Insert contents of quote @var{what} corresponding to @var{main-music},
220 in a CueVoice oriented by @var{dir}.")
221 (make-music
'QuoteMusic
223 'quoted-context-type
'Voice
224 'quoted-context-id
"cue"
225 'quoted-music-name what
226 'quoted-voice-direction dir
232 #(define-music-function
(parser location music
) (ly
:music?
)
233 (_i
"Display the LilyPond input representation of @var{music}
236 (display-lily-music music parser
)
240 #(define-music-function
(parser location music
) (ly
:music?
)
241 (_i
"Display the internal representation of @var{music} to the console.")
243 (display-scheme-music music
)
249 #(define-music-function
(parser location music
) (ly
:music?
)
250 (_i
"Terminate the next spanner prematurely after exactly one note
251 without the need of a specific end spanner.")
252 (if
(eq?
(ly
:music-property music
'name
) 'EventChord
)
253 (let
* ((elts
(ly
:music-property music
'elements
))
254 (start-span-evs
(filter
(lambda
(ev
)
255 (and
(music-has-type ev
'span-event
)
256 (equal?
(ly
:music-property ev
'span-direction
)
261 (let
((c (music-clone m
)))
262 (set
! (ly
:music-property
c 'span-direction
) STOP
)
265 (end-ev-chord
(make-music
'EventChord
266 'elements stop-span-evs
))
267 (total
(make-music
'SequentialMusic
268 'elements
(list music
272 (ly
:input-message location
(_ "argument endSpanners is not an EventChord: ~a" music
))))
277 #(define-music-function
(parser location factor argument
) (ly
:moment? ly
:music?
)
278 (_i
"Adjust durations of music in @var{argument} by rational @var{factor}.")
279 (let
((orig-duration
(ly
:music-length argument
))
280 (multiplier
(ly
:make-moment
1 1)))
284 (if
(and
(eq?
(ly
:music-property mus
'name
) 'EventChord
)
285 (< 0 (ly
:moment-main-denominator
(ly
:music-length mus
))))
287 (ly
:music-compress mus multiplier
)
288 (set
! multiplier
(ly
:moment-mul factor multiplier
))))
294 (ly
:moment-div orig-duration
(ly
:music-length argument
)))
301 #(def-grace-function startGraceMusic stopGraceMusic
302 (_i
"Insert @var{music} as grace notes."))
307 #(define-music-function
308 (parser location name
) (string?
)
309 (_i
"Switch instrument to @var{name}, which must be predefined with
310 @code{\\addInstrumentDefinition}.")
311 (let
* ((handle
(assoc name instrument-definitions
))
312 (instrument-def
(if handle
(cdr handle
) '())))
315 (ly
:input-message location
"No such instrument: ~a" name
))
317 (make-music
'SimultaneousMusic
329 #(define-music-function
(parser location tag music
) (symbol? ly
:music?
)
330 (_i
"Include only elements of @var{music} that are tagged with @var{tag}.")
333 (let
* ((tags
(ly
:music-property m
'tags
))
334 (res
(memq tag tags
)))
341 #(define-music-function
(parser location music
) (ly
:music?
)
342 (_i
"Remove cue notes from @var{music}.")
345 (if
(and
(string?
(ly
:music-property mus
'quoted-music-name
))
346 (string
=?
(ly
:music-property mus
'quoted-context-id
"") "cue"))
347 (ly
:music-property mus
'element
)
354 #(define-music-function
(parser location label
) (symbol?
)
355 (_i
"Create @var{label} as a bookmarking label.")
356 (make-music
'EventChord
359 'elements
(list
(make-music
'LabelEvent
360 'page-label label
))))
365 #(define-music-function
(parser location arg
) (ly
:music?
)
366 (_i
"Display chords in @var{arg} as clusters.")
367 (music-map note-to-cluster arg
))
370 #(define-music-function
(parser location proc mus
) (procedure? ly
:music?
)
371 (_i
"Apply @var{proc} to @var{mus} and all of the music it contains.")
372 (music-map proc mus
))
376 %% noPageBreak and noPageTurn are music functions (not music indentifiers),
377 %% because music identifiers are not allowed at top-level.
379 #(define-music-function
(location parser
) ()
380 (_i
"Forbid a page break. May be used at toplevel (i.e., between scores or
381 markups), or inside a score.")
382 (make-music
'EventChord
384 'page-break-permission
'forbid
385 'elements
(list
(make-music
'PageBreakEvent
386 'break-permission
'()))))
389 #(define-music-function
(location parser
) ()
390 (_i
"Forbid a page turn. May be used at toplevel (i.e., between scores or
391 markups), or inside a score.")
392 (make-music
'EventChord
394 'page-turn-permission
'forbid
395 'elements
(list
(make-music
'PageTurnEvent
396 'break-permission
'()))))
401 #(define-music-function
(parser location pitch-note
) (ly
:music?
)
403 (make-music
'RelativeOctaveCheck
405 'pitch
(pitch-of-note pitch-note
)))
408 #(define-music-function
(parser location octave
) (number?
)
409 (_i
"Set the octavation.")
410 (make-ottava-set octave
))
412 overrideBeamSettings
=
413 #(define-music-function
414 (parser location context time-signature rule-type grouping-rule
)
415 (symbol? pair? symbol? pair?
)
417 (_i
"Override beamSettings in @var{context}
418 for time signatures of @var{time-signature} and rules of type
419 @var{rule-type} to have a grouping rule alist
421 @var{rule-type} can be @code{end} or @code{subdivide},
422 with a potential future value of @code{begin}.
423 @var{grouping-rule} is an alist of @var{(beam-type . grouping)}
424 entries. @var{grouping} is in units of @var{beam-type}. If
425 @var{beam-type} is @code{*}, grouping is in units of the denominator
426 of @var{time-signature}.")
428 ;; TODO -- add warning if largest value of grouping is
429 ;; greater than time-signature
.
432 #(override-beam-setting
433 $time-signature $rule-type $grouping-rule $context
)
437 #(define-music-function
(parser location name property value
)
438 (string? symbol? scheme?
)
440 (_i
"Set @var{property} to @var{value} in all grobs named @var{name}.
441 The @var{name} argument is a string of the form @code{\"Context.GrobName\"}
442 or @code{\"GrobName\"}.")
444 (let
((name-components
(string-split name
#\
.))
445 (context-name
'Bottom
)
448 (if
(> 2 (length name-components
))
449 (set
! grob-name
(string-
>symbol
(car name-components
)))
451 (set
! grob-name
(string-
>symbol
(list-ref name-components
1)))
452 (set
! context-name
(string-
>symbol
(list-ref name-components
0)))))
454 (make-music
'ApplyOutputEvent
456 'context-type context-name
458 (lambda
(grob orig-context context
)
460 (cdr
(assoc
'name
(ly
:grob-property grob
'meta
)))
462 (set
! (ly
:grob-property grob property
) value
))))))
466 %% pageBreak and pageTurn are music functions (iso music indentifiers),
467 %% because music identifiers are not allowed at top-level.
469 #(define-music-function
(location parser
) ()
470 (_i
"Force a page break. May be used at toplevel (i.e., between scores or
471 markups), or inside a score.")
472 (make-music
'EventChord
474 'line-break-permission
'force
475 'page-break-permission
'force
476 'elements
(list
(make-music
'LineBreakEvent
477 'break-permission
'force
)
478 (make-music
'PageBreakEvent
479 'break-permission
'force
))))
482 #(define-music-function
(location parser
) ()
483 (_i
"Force a page turn between two scores or top-level markups.")
484 (make-music
'EventChord
486 'line-break-permission
'force
487 'page-break-permission
'force
488 'page-turn-permission
'force
489 'elements
(list
(make-music
'LineBreakEvent
490 'break-permission
'force
)
491 (make-music
'PageBreakEvent
492 'break-permission
'force
)
493 (make-music
'PageTurnEvent
494 'break-permission
'force
))))
497 #(define-music-function
(parser location voice-ids music
) (list? ly
:music?
)
498 (_i
"Define parallel music sequences, separated by '|' (bar check signs),
499 and assign them to the identifiers provided in @var{voice-ids}.
501 @var{voice-ids}: a list of music identifiers (symbols containing only letters)
503 @var{music}: a music sequence, containing BarChecks as limiting expressions.
508 \\parallelMusic #'(A B C) {
518 (let
* ((voices
(apply circular-list
(make-list
(length voice-ids
) (list
))))
519 (current-voices voices
)
520 (current-sequence
(list
)))
523 (define
(push-music m
)
524 "Push the music expression into the current sequence"
525 (set
! current-sequence
(cons m current-sequence
)))
526 (define
(change-voice
)
527 "Stores the previously built sequence into the current voice and
528 change to the following voice."
529 (list-set
! current-voices
0 (cons
(make-music
'SequentialMusic
530 'elements
(reverse
! current-sequence
))
531 (car current-voices
)))
532 (set
! current-sequence
(list
))
533 (set
! current-voices
(cdr current-voices
)))
534 (define
(bar-check? m
)
535 "Checks whether m is a bar check."
536 (eq?
(ly
:music-property m
'name
) 'BarCheck
))
537 (define
(music-origin music
)
538 "Recursively search an origin location stored in music."
539 (cond
((null? music
) #f)
540 ((not
(null?
(ly
:music-property music
'origin
)))
541 (ly
:music-property music
'origin
))
542 (else
(or
(music-origin
(ly
:music-property music
'element
))
543 (let
((origins
(remove not
(map music-origin
544 (ly
:music-property music
'elements
)))))
545 (and
(not
(null? origins
)) (car origins
)))))))
547 ;; first
, split the music and fill in voices
548 (map-in-order
(lambda
(m
)
550 (if
(bar-check? m
) (change-voice
)))
551 (ly
:music-property music
'elements
))
552 (if
(not
(null? current-sequence
)) (change-voice
))
553 ;; un-circularize `voices
' and reorder the voices
554 (set
! voices
(map-in-order
(lambda
(dummy seqs
)
558 ;; set origin location of each sequence in each voice
559 ;; for better type error tracking
560 (for-each
(lambda
(voice
)
561 (for-each
(lambda
(seq
)
562 (set
! (ly
:music-property seq
'origin
)
563 (or
(music-origin seq
) location
)))
567 ;; check sequence length
568 (apply for-each
(lambda
* (#:rest seqs
)
569 (let
((moment-reference
(ly
:music-length
(car seqs
))))
570 (for-each
(lambda
(seq moment
)
571 (if
(not
(equal? moment moment-reference
))
572 (ly
:music-message seq
573 "Bars in parallel music don't have the same length")))
574 seqs
(map-in-order ly
:music-length seqs
))))
577 ;; bind voice identifiers to the voices
578 (map
(lambda
(voice-id voice
)
579 (ly
:parser-define
! parser voice-id
580 (make-music
'SequentialMusic
584 ;; Return an empty sequence
. This function is actually
a "void" function
.
585 (make-music
'SequentialMusic
'void
#t
))
588 #(define-music-function
(parser loc arg
) (ly
:music?
)
589 (_i
"Tag @var{arg} to be parenthesized.")
591 (if
(memq
'event-chord
(ly
:music-property arg
'types
))
592 ;; arg is an EventChord -
> set the parenthesize property
593 ;; on all child notes and rests
596 (if
(or
(memq
'note-event
(ly
:music-property ev
'types
))
597 (memq
'rest-event
(ly
:music-property ev
'types
)))
598 (set
! (ly
:music-property ev
'parenthesize
) #t
)))
599 (ly
:music-property arg
'elements
))
600 ;; No chord
, simply set property for this expression
:
601 (set
! (ly
:music-property arg
'parenthesize
) #t
))
605 #(define-music-function
(parser location part
1 part
2) (ly
:music? ly
:music?
)
606 (_i
"Take the music in @var{part1} and @var{part2} and typeset so
607 that they share a staff.")
608 (make-part-combine-music parser
612 #(define-music-function
613 (parser location main-note secondary-note
)
614 (ly
:music? ly
:music?
)
615 (_i
"Print a trill with @var{main-note} as the main note of the trill and
616 print @var{secondary-note} as a stemless note head in parentheses.")
617 (let
* ((get-notes
(lambda
(ev-chord
)
619 (lambda
(m
) (eq?
'NoteEvent
(ly
:music-property m
'name
)))
620 (ly
:music-property ev-chord
'elements
))))
621 (sec-note-events
(get-notes secondary-note
))
622 (trill-events
(filter
(lambda
(m
) (music-has-type m
'trill-span-event
))
623 (ly
:music-property main-note
'elements
))))
625 (if
(pair? sec-note-events
)
627 (let
* ((trill-pitch
(ly
:music-property
(car sec-note-events
) 'pitch
))
628 (forced
(ly
:music-property
(car sec-note-events
) 'force-accidental
)))
630 (if
(ly
:pitch? trill-pitch
)
631 (for-each
(lambda
(m
)
632 (ly
:music-set-property
! m
'pitch trill-pitch
)) trill-events
)
634 (ly
:warning
(_ "Second argument of \\pitchedTrill should be single note: "))
635 (display sec-note-events
)))
638 (for-each
(lambda
(m
)
639 (ly
:music-set-property
! m
'force-accidental forced
))
644 #(define-music-function
(parser location what main-music
) (string? ly
:music?
)
645 (_i
"Indicate a section of music to be quoted. @var{what} indicates the name
646 of the quoted voice, as specified in an @code{\\addQuote} command.
647 @var{main-music} is used to indicate the length of music to be quoted;
648 usually contains spacers or multi-measure rests.")
649 (make-music
'QuoteMusic
651 'quoted-music-name what
655 #(define-music-function
(parser location tag music
) (symbol? ly
:music?
)
656 (_i
"Remove elements of @var{music} that are tagged with @var{tag}.")
659 (let
* ((tags
(ly
:music-property m
'tags
))
660 (res
(memq tag tags
)))
664 resetRelativeOctave
=
665 #(define-music-function
(parser location reference-note
) (ly
:music?
)
666 (_i
"Set the octave inside a \\relative section.")
668 (let
* ((notes
(ly
:music-property reference-note
'elements
))
669 (pitch
(ly
:music-property
(car notes
) 'pitch
)))
671 (set
! (ly
:music-property reference-note
'elements
) '())
672 (set
! (ly
:music-property reference-note
'to-relative-callback
)
673 (lambda
(music last-pitch
)
679 #(define-music-function
680 (parser location context time-signature rule-type
)
681 (symbol? pair? symbol?
)
683 (_i
"Revert beam settings in @var{context} for time signatures of
684 @var{time-signature} and groups of type
685 @var{group-type}. @var{group-type} can be @code{end}
686 or @code{subdivide}.")
688 #(revert-beam-setting $time-signature $rule-type $context
)
692 #(define-music-function
(parser location finger
) (number-or-string?
)
693 (_i
"Apply @var{finger} as a fingering indication.")
702 (list
'digit finger
)))))
707 #(define-music-function
(parser location fraction music
)
708 (number-pair? ly
:music?
)
709 (_i
"Multiply the duration of events in @var{music} by @var{fraction}.")
710 (ly
:music-compress music
711 (ly
:make-moment
(car fraction
) (cdr fraction
))))
714 #(define-music-function
(parser location grouping
) (pair?
)
715 (_i
"Set the beat grouping in the current time signature to
717 (define
(default-group-setting
c)
718 (let
* ((context-time-signature
719 (ly
:context-property
c 'timeSignatureFraction
))
720 (time-signature
(if
(null? context-time-signature
)
722 context-time-signature
)))
723 (override-property-setting
726 (list time-signature
'end
)
727 (list
(cons
'* grouping
)))))
730 (make-apply-context default-group-setting
)
734 #(define-music-function
(parser location dur dots arg
)
735 (integer? integer? ly
:music?
)
736 (_i
"Scale @var{arg} up by a factor of @var{2^dur*(2-(1/2)^dots)}.")
740 (shift-one-duration-log x dur dots
)) arg
))
743 #(define-music-function
(parser location parameters
) (list?
)
744 (_i
"Set the system stretch, by reading the 'system-stretch property of
745 the `parameters' assoc list.")
747 \overrideProperty #"Score.NonMusicalPaperColumn"
748 #'line-break-system-details
749 #$
(list
(cons
'alignment-extra-space
(cdr
(assoc
'system-stretch parameters
)))
750 (cons
'system-Y-extent
(cdr
(assoc
'system-Y-extent parameters
))))
754 #(define-music-function
(parser location style heads music
)
755 (symbol? list-or-symbol? ly
:music?
)
756 (_i
"Set @var{heads} in @var{music} to @var{style}.")
757 (style-note-heads heads style music
))
762 #(define-music-function
(parser location
) ()
763 (_i
"Include the string information in a chord repetition.")
764 (ly
:parser-set-repetition-function parser tab-repeat-chord
)
765 (make-music
'SequentialMusic
'void
#t
))
768 #(define-music-function
(parser location tag arg
) (symbol? ly
:music?
)
770 (_i
"Add @var{tag} to the @code{tags} property of @var{arg}.")
773 (ly
:music-property arg
'tags
)
775 (ly
:music-property arg
'tags
)))
778 transposedCueDuring
=
779 #(define-music-function
780 (parser location what dir pitch-note main-music
)
781 (string? ly
:dir? ly
:music? ly
:music?
)
783 (_i
"Insert notes from the part @var{what} into a voice called @code{cue},
784 using the transposition defined by @var{pitch-note}. This happens
785 simultaneously with @var{main-music}, which is usually a rest. The
786 argument @var{dir} determines whether the cue notes should be notated
787 as a first or second voice.")
789 (make-music
'QuoteMusic
791 'quoted-context-type
'Voice
792 'quoted-context-id
"cue"
793 'quoted-music-name what
794 'quoted-voice-direction dir
795 'quoted-transposition
(pitch-of-note pitch-note
)
799 #(define-music-function
(parser location pitch-note
) (ly
:music?
)
800 (_i
"Set instrument transposition")
803 (make-property-set
'instrumentTransposition
804 (ly
:pitch-negate
(pitch-of-note pitch-note
)))
808 #(define-music-function
(parser location sym val arg
)
809 (symbol? scheme? ly
:music?
)
810 (_i
"Add @code{sym . val} to the @code{tweaks} property of @var{arg}.")
812 (if
(equal?
(object-property sym
'backend-type?
) #f)
814 (ly
:warning
(_ "cannot find property type-check for ~a") sym
)
815 (ly
:warning
(_ "doing assignment anyway"))))
817 (ly
:music-property arg
'tweaks
)
819 (ly
:music-property arg
'tweaks
)))
825 #(define-music-function
(parser location music
) (ly
:music?
)
826 (_i
"Force any @code{\\repeat volta}, @code{\\repeat tremolo} or
827 @code{\\repeat percent} commands in @var{music} to be interpreted
828 as @code{\\repeat unfold}.")
829 (unfold-repeats music
))
834 #(define-music-function
(parser location sym val music
)
835 (symbol? scheme? ly
:music?
)
836 (_i
"Set @var{sym} to @var{val} in @var{music}.")
838 (set
! (ly
:music-property music sym
) val
)