In message <[EMAIL PROTECTED]>, Jesús Guillermo Andrade <[EMAIL PROTECTED]> writes >Thanks Joseph for your prompt reply! I tried your suggestion but, >instead of fixing the notes, they went way off even further down. >After many tries, i found a solution: each sequence must be preceded by >a \relative fa, so the position restarts. >Is there any other way to do this? > >>> fragA = << > \relative fa >>> {<si do mi> <si do mi> <la do mi> <la do mi>} \\ >>> {la,,} >>> >> > I don't know if I've understood you correctly, but I think I have exactly the same problem in one of my pieces. I want to insert a fragment in a '\relative' bit of music, and the octave keeps going wrong. Han Wen gave me a solution, which I attach below.
He gave me the "resetOctave" function. Note that every time, in the main music, I preface my references to "\pennsylvania" with "\resetOctave". That forces the first note in \pennsylvania to be relative to the absolute pitch note mentioned in \resetOctave, and not to the last note of music that preceded it. I think this should have been added to the documentation somewhere, but don't ask me where - I've never seen it, because I've never really looked for it. Once Han Wen gave me the function, I grabbed and ran with it. \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 } -- Anthony W. Youngman - [EMAIL PROTECTED] _______________________________________________ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user