On Tue, Mar 10, 2015 at 10:49:05AM +0100, Thomas Morley wrote:
> 
> Something in
> http://lsr.di.unimi.it/LSR/Item?id=871
> which matches your needs?
> (didn't test myself)
> 
> Cheers,
>   Harm

Thank you, Harm!  That looks very promising.  I must train myself
to remember the snippet repository when I'm Googling for
solutions.

\taggedRep looks especially interesting.  I often use the
'extractMusic' family of snippet functions, for cases when a
phrase repeats, but with slight variation (most conveniently, at
the beginning or ending of the phrase):

\include "extractMusic.ily" % http://lsr.dsi.unimi.it/LSR/Item?id=542

Aphrase = {
  c'4 d' e' f'
  g' a' b' c''
  c'' b' a' g'
  f' e' d' c'
}

\score {
  \extractBegin { \repeat unfold 3 \Aphrase } s1*11 % copy first 11 bars
  d'4 f' e' c' % 12th bar
}

But \taggedRep doesn't quite fit that use case.  Hmm, I'll have
to muse over it a while and see if new uses for \taggedRep reveal
themselves to me.

Thanks again!

Jim
\include "extractMusic.ily" % http://lsr.dsi.unimi.it/LSR/Item?id=542
\include "tagging.ily" % http://lsr.di.unimi.it/LSR/Item?id=871

Aphrase = {
  c'4 d' e' f'
  g' a' b' c''
  c'' b' a' g'
  f' e' d' c'  
}

\score {
  \new Staff {
    \extractBegin { \repeat unfold 3 \Aphrase } s1*11 % copy first 11 bars
    d'4 f' e' c' % 12th bar
  }
}

Aphrase = {
  c'4 d' e' f'
  g' a' b' c''
  c'' b' a' g' 
  <<
    { f' e' d' c' } % 4th bar and 8th bar
    \tag #'lasttime { d'4 f' e' c' } % 12th bar
  >>
}

\score {
  \new Staff \taggedRep #'firsttime #'lasttime 3 \Aphrase
}

Attachment: foo.pdf
Description: Adobe PDF document

_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to