+2006-06-07 Graham Percival <gpermus@gmail.com>
+
+ * input/test/ add-staccato.ly, add-text-script.ly,
+ unfold-all-repeats.ly, music-box.ly: \applyMusic to
+ music functions update, thanks to Michael Meixner.
+
2006-06-07 Jan Nieuwenhuizen <janneke@gnu.org>
* SConstruct (LILYPONDPREFIX): Bootstrap fix.
Harald Wellmann
Karl Hammar
Keith Packard
+Michael Meixner
Orm Finnendahl
Quentin Spencer
Rick Hansen
-
-\version "2.7.39"
+\version "2.9.7"
+\sourcefilename "add-staccato.ly"
\header {
-
texidoc= "@cindex Add Stacato
Using @code{make-music}, you can add various stuff to notes. In this
example staccato dots are added to the notes."
#(define (make-script x)
(make-music 'ArticulationEvent
'articulation-type x))
-
+
#(define (add-script m x)
(if
(equal? (ly:music-property m 'name) 'EventChord)
#(define (add-staccato m)
(add-script m "staccato"))
+addStacc =
+#(define-music-function (parser location music)
+ (ly:music?)
+ (music-map add-staccato music))
+
\score {
\relative c'' {
- a b \applyMusic #(lambda (x) (music-map add-staccato x)) { c c }
+ a b \addStacc { c c }
}
\layout{ ragged-right = ##t }
}
-
-\version "2.7.39"
+\version "2.9.7"
+\sourcefilename "add-text-script.ly"
\header {
texidoc= "@cindex make-music Fingering
You can add various stuff to notes using @code{make-music}.
In this example, an extra fingering is attached to a note.
-
-In general, first do a @code{display} of the music you want to
-create, then write a function that will structure the music for you.
"
}
(make-music 'TextScriptEvent
'direction DOWN
'text (make-simple-markup x)))
-
+
#(define (add-text-script m x)
(if (equal? (ly:music-property m 'name) 'EventChord)
(set! (ly:music-property m 'elements)
(add-text-script e x))))
m)
+addScript =
+#(define-music-function (parser location script music )
+ ( string? ly:music? )
+ (add-text-script music script))
+
\score {
- \applyMusic #(lambda (x) (add-text-script x "6") (display-music x) x ) { c'4-3 }
- \layout{ ragged-right = ##t }
+ {
+ \addScript "6" { c'4-3 }
+ }
}
-
-\version "2.7.39"
+\version "2.9.7"
+\sourcefilename "music-box.ly"
+
\include "deutsch.ly"
% possible rename to scheme- something. -gp
% TODO: ask if it needs to have so many empty bars in the middle. -gp
(recurse (cdr elts))
)))))
music
- ))
+ ))
#(define ((trans pitches) music)
(let* ((es (ly:music-property music 'elements))
music))
-
-
-
-\version "2.7.39"
-
pat = \transpose c c' \repeat unfold 2 {
<< { \context Staff = "up" {r8 e16 f g e f g } }
{ \context Staff = "down" <<
endb = {\stemUp \tieUp r16 c,8.~c,4~c,2 r16 h,,8.~h,,4~h,,2 c,1 \bar "|."}
endc = {\stemDown \tieDown c,,2~c,, c,,~c,, c,,1_\fermata }
+
+prelude =
+#(define-music-function (parser location patterns) (ly:music?)
+ (transform patterns))
+
+
\score {
\transpose c c' \context PianoStaff <<
\new Staff = "up" { \clef "G" }
\new Staff = "down" { \clef "F" }
- { \applyMusic #transform {
+ { \prelude {
\pat {c e g c' e' }
\pat {c d a d' f' }
}
-
+
%{
%Etc.
%}
}
>>
-
+
\layout {
\context {
\PianoStaff
}
line-width = 18.0 \cm
}
-
+
\midi {
\tempo 4 = 80
}
-\version "2.7.39"
+\version "2.9.7"
+\sourcefilename "unfold-all-repeats.ly"
\header {
texidoc = "Applying the standard function @code{unfold-repeats} unfolds
recursively all repeats for a correct MIDI output."
}
-mel = \context Staff {
+unfoldAll =
+ #(define-music-function (parser location music )
+ (ly:music?)
+ #{
+ \unfoldRepeats $music
+ #})
+
+mel = \context Staff {
\repeat tremolo 8 {c'32 e' }
\repeat percent 2 { c''8 d'' }
\repeat volta 2 {c'4 d' e' f'}
\score { {
\mel \break
- \applyMusic #unfold-repeats \mel
+ \unfoldAll \mel
}
}
-
-
-