premature evaluation. There are also @q{splicing} operators @code{$@@}
and @code{#@@} for interpreting the members of a list individually.
+@item
+To reduce the necessity for using @code{$}, Scheme expressions written
+with @code{#} are interpreted as music inside of music lists, and as
+markups or markup lists inside of markups.
+
@item
Support for jazz-like chords has been improved: Lydian and altered
chords are recognised; separators between chord modifiers are now
\override Stem #'length = #(* 7.0 mag)
\override NoteHead #'font-size =
#(inexact->exact (* (/ 6.0 (log 2.0)) (log mag)))
- $music
+ #music
\revert Stem #'length
\revert NoteHead #'font-size
#})
"Draw a double box around text."
(interpret-markup layout props
#@{\markup \override #'(box-padding . 0.4) \box
- \override #'(box-padding . 0.6) \box @{ $text @}#@}))
+ \override #'(box-padding . 0.6) \box @{ #text @}#@}))
@end lisp
or, equivalently
(interpret-markup layout props
#@{\markup \override #`(box-padding . ,inter-box-padding) \box
\override #`(box-padding . ,box-padding) \box
- @{ $text @} #@}))
+ @{ #text @} #@}))
@end lisp
Again, the equivalent version using the markup macro would be:
(interpret-markup layout props
#{\markup \override #`(box-padding . ,inter-box-padding) \box
\override #`(box-padding . ,box-padding) \box
- { $text } #}))
+ { #text } #}))
\markup \double-box A
\markup \override #'(inter-box-padding . 0.8) \double-box A
#(define-markup-list-command (paragraph layout props args) (markup-list?)
#:properties ((par-indent 2))
(interpret-markup-list layout props
- #@{\markuplist \justified-lines @{ \hspace #par-indent $args @} #@}))
+ #@{\markuplist \justified-lines @{ \hspace #par-indent #args @} #@}))
@end example
consistent with the current Lilypond mode are accepted.
The immediate action of @code{$} can lead to surprises, @ref{Input
-variables and Scheme}. Using @code{#} where the parser supports it is
-usually preferable.
+variables and Scheme}. Using @code{#} where the parser supports it
+is usually preferable. Inside of music expressions, expressions
+created using @code{#} @emph{are} interpreted as music. However,
+they are @emph{not} copied before use. If they are part of some
+structure that might still get used, you may need to use
+@code{ly:music-deep-copy} explicitly.
@funindex $@@
@funindex #@@
@example
...
-@{ $@@newLa @}
+@{ #@@newLa @}
@end example
Here, every element of the list stored in @code{newLa} is taken in
sequence and inserted into the list, as if we had written
@example
-@{ $(first newLa) $(second newLa) @}
+@{ #(first newLa) #(second newLa) @}
@end example
Now in all of these forms, the Scheme code is evaluated while the
@example
@{
- $(with-output-to-file "display.txt"
+ #(with-output-to-file "display.txt"
(lambda () #@{ \displayMusic @{ c'4\f @} #@}))
@}
@end example
@lilypond[quote,verbatim,ragged-right]
tempoPadded = #(define-music-function (parser location padding tempotext)
- (number? string?)
+ (number? markup?)
#{
- \once \override Score.MetronomeMark #'padding = $padding
+ \once \override Score.MetronomeMark #'padding = #padding
\tempo \markup { \bold #tempotext }
#})
\relative c'' {
\tempo \markup { "Low tempo" }
c4 d e f g1
- \tempoPadded #4.0 #"High tempo"
+ \tempoPadded #4.0 "High tempo"
g4 f e d c1
}
@end lilypond
@lilypond[quote,verbatim,ragged-right]
pattern = #(define-music-function (parser location x y) (ly:music? ly:music?)
#{
- $x e8 a b $y b a e
+ #x e8 a b #y b a e
#})
\relative c''{
(parser location padding)
(number?)
#{
- \once \override TextScript #'padding = $padding
+ \once \override TextScript #'padding = #padding
#})
\relative c''' {
)
fraction = #(define-music-function (parser location music) (ly:music?)
- #{ \tweak #'text #tuplet-number::calc-fraction-text $music #})
+ #{ \tweak #'text #tuplet-number::calc-fraction-text #music #})
triangle = #(define-music-function (parser location music) (ly:music?)
- #{ \once \set shapeNoteStyles = #'#(do do do do do do do) $music #})
+ #{ \once \set shapeNoteStyles = #'#(do do do do do do do) #music #})
semicircle = #(define-music-function (parser location music) (ly:music?)
- #{ \once \set shapeNoteStyles = #'#(re re re re re re re) $music #})
+ #{ \once \set shapeNoteStyles = #'#(re re re re re re re) #music #})
blackdiamond = #(define-music-function (parser location music) (ly:music?)
- #{ \once \set shapeNoteStyles = #'#(mi mi mi mi mi mi mi) $music #})
+ #{ \once \set shapeNoteStyles = #'#(mi mi mi mi mi mi mi) #music #})
tiltedtriangle = #(define-music-function (parser location music) (ly:music?)
- #{ \once \set shapeNoteStyles = #'#(fa fa fa fa fa fa fa) $music #})
+ #{ \once \set shapeNoteStyles = #'#(fa fa fa fa fa fa fa) #music #})
square = #(define-music-function (parser location music) (ly:music?)
- #{ \once \set shapeNoteStyles = #'#(la la la la la la la) $music #})
+ #{ \once \set shapeNoteStyles = #'#(la la la la la la la) #music #})
wedge = #(define-music-function (parser location music) (ly:music?)
- #{ \once \set shapeNoteStyles = #'#(ti ti ti ti ti ti ti) $music #})
+ #{ \once \set shapeNoteStyles = #'#(ti ti ti ti ti ti ti) #music #})
harmonic = #(define-music-function (parser location music) (ly:music?)
- #{ \once \set shapeNoteStyles = #'#(harmonic harmonic harmonic harmonic harmonic harmonic harmonic) $music #})
+ #{ \once \set shapeNoteStyles = #'#(harmonic harmonic harmonic harmonic harmonic harmonic harmonic) #music #})
cross = #(define-music-function (parser location music) (ly:music?)
- #{ \once \set shapeNoteStyles = #'#(cross cross cross cross cross cross cross) $music #})
+ #{ \once \set shapeNoteStyles = #'#(cross cross cross cross cross cross cross) #music #})
white = #(define-music-function (parser location music) (ly:music?)
- #{ \once \override NoteHead #'duration-log = #1 $music #})
+ #{ \once \override NoteHead #'duration-log = #1 #music #})
@item @code{@var{@dots{}music@dots{}}}
@tab normal LilyPond input, using @code{$} (in places where only
Lilypond constructs are allowed) or @code{#} (to use it as a Scheme
-value or music function argument) to reference arguments
+value or music function argument or music inside of music lists) to
+reference arguments
(eg. @samp{#arg1}).
@end multitable
\tweak NoteHead #'text
\markup \musicglyph #"custodes.mensural.u0"
\tweak Stem #'stencil ##f
- $note
+ #note
#})
\relative c' { c4 d e f \custosNote g }
@lilypond[verbatim,quote]
forget = #(define-music-function (parser location music) (ly:music?) #{
\accidentalStyle "forget"
- $music
+ #music
\accidentalStyle "modern"
#})
{
\MyCadenza c'1
}
\new Staff {
- $(mmrest-of-length MyCadenza)
+ #(mmrest-of-length MyCadenza)
c'1
- $(skip-of-length MyCadenza)
+ #(skip-of-length MyCadenza)
c'1
}
>>