In message <c6334c1b.93d6%c_soren...@byu.edu>, Carl D. Sorensen
<c_soren...@byu.edu> writes
On 5/15/09 3:06 PM, "Anthony W. Youngman" <lilyp...@thewolery.demon.co.uk>
wrote:
In message <200905151909580...@1654122929>, David Pounder
<pound...@lineone.net> writes
I don't know if it's worth mentioning, but you can also run into
problems using \repeat inside a \relative block if an \unfoldRepeats is
used outside the block. For example in
Tune = \relative c' { \partial 4 d4 |
\repeat volta 2 { c4 d e g | }
}
the first c will be relative to the last g on the second play through
using \unfoldRepeats. Rewriting as
Tune = { \partial 4 d'4 |
\repeat volta 2 \relative c' { c4 d e g | }
}
resolves the problem. I try to make sure I keep \relatives at the
innermost block for this reason. Is this a case of programming style,
and should the docs cover it?
Han-Wen gave me a resetOctave function that deals with this. I don't
know if it's made its way into the docs, though.
I just use the octave check construct and ignore the warning.
Example of resetOctave and its use attached ...
\version "2.8.2"
resetOctave =
#(define-music-function
(parser location reference-note)
(ly:music?)
(let*
((notes (ly:music-property reference-note 'elements))
(pitch (ly:music-property (car notes) 'pitch))
)
(set! (ly:music-property reference-note 'elements) '())
(set! (ly:music-property reference-note
'to-relative-callback)
(lambda (music last-pitch)
pitch))
reference-note
))
pennsylvania = \context Voice = pennsylvania {
\override NoteHead #'style = #'cross
r2_\markup{ shout } f8. f16 f8. f16 f4 f f8. f16 r4
}
pennsylvaniaLyrics = \lyricmode { \small { Penn syl van ia six five thou sand }
}
voiceTromboneI = \relative c' {
r2 ef4.-- ef8-> ~ ef1 r2 r4 bf8.->( ef16-.) r2 r4 ef,8. af,16-> ~ |
af2 c-- df-- d-- ef-- df-- c-- bf-- |
\repeat "volta" 2 { R1*6 } \alternative { { \resetOctave f
\pennsylvania } { \pennsylvania } }
bf8-. cf4-> bf8-> ~ bf4 bf8.-- af16-. r8 af4.---. r2 bf8-. cf4-- bf8->
~ bf4 bf8.-- af16-> ~ |
af2~ af8 r8 r8. b16( ~ c4-.) cs8-- c8-> ~ c8 b4.-- bf4 af8. bf16 ~ bf4
r c2( d4.) df8-> ~ |
df8 d4-- df8-> ~ df4 r4 R1*6 \resetOctave f \pennsylvania |
af,2-- cf-- af2.-- r4 af2-- cf-- af-- a-- |
bf2.-- r4 ef2.-- ef4-- af,2 c df4.---> d8---> ~ d ef4.---> |
af,2-- cf-- af2.-- r4 af2-- cf-- af-- a-- |
bf2.-- r4 ef2.-- ef4-- af,2-- c-- df4 ef8.->( af,16) ~ af4 r |
r8 c'4.---> ~ c2 r8 b4.---> ~ b2 r8. c16-> b8.-> b16-> c8.-> c16->
b8.-> b16-> c4-> r r2
\repeat "volta" 2 { \repeat "percent" 3 { df8^+ df4.^o ~ df4 r R1 }
df4.^\markup{ +o } df8^\markup{ +o } ~ df4. df8^\markup{ +o } ~ }
\alternative { { df4. df8^\markup{ +o } ~ df4. r8 } { df4 df8. d16 r8 df4.--->
} }
R1*7 r2 r8 b4.^-^+( \glissando c1^o) ~
c4 r r8 b4.^-^+( \glissando c1^o) ~ c4 r r8 c4.^-^+( \glissando df1^o) ~
df4 r r8 b4.^-^+( \glissando c1^o) ~ c4 r r8 e4.^-^+( \glissando
\repeat "volta" 2 { f1) ~
f4 r r8 e4.^-^+( \glissando f1) ~ f4 r r8 e4.^-^+( \glissando f1) ~
f4 r r8 e4.^-^+( \glissando f1) ~ } \alternative { { f2 r8 e4.^-^+(
\glissando } { f2) r8 e4.^-^+( \glissando } }
f1) ~ f4 r r8 e4.^-^+( \glissando f1) ~ f4 r r8 ef4.^-^+( \glissando
f1) ~ f4. f8 r4 d8.-> df16-> r8 d4.---> ef8.-> e16-> f8.-> gf16-> ~ gf1
}
Cheers,
Wol
--
Anthony W. Youngman - anth...@thewolery.demon.co.uk
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user