lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

question about overrides within repeats


From: David Nalesnik
Subject: question about overrides within repeats
Date: Sun, 22 Nov 2015 13:10:09 -0600

Hi,

Given the following function, each time an override of NoteHead.color occurs, a new color from the list is used:

\version "2.19.30"

#(define test
   (let ((colors (circular-list red green blue yellow darkgreen magenta)))
     (lambda ()
       (let ((color (car colors)))
         (set! colors (cdr colors))
         color))))

{
  \once\override NoteHead.color = #(test)
  c''4
  \once\override NoteHead.color = #(test)
  c''4
  \once\override NoteHead.color = #(test)
  c''4
  \once\override NoteHead.color = #(test)
  c''4
  \once\override NoteHead.color = #(test)
  c''4
  \once\override NoteHead.color = #(test)
  c''4
  \once\override NoteHead.color = #(test)
  c''4
  \once\override NoteHead.color = #(test)
  c''4
  \once\override NoteHead.color = #(test)
  c''4
  \once\override NoteHead.color = #(test)
  c''4
}

However, when I put the override within a repeat structure, the override only seems to happen once:

%% All darkgreen (we left off with yellow above
{
  \repeat unfold 10 {
    \once \override NoteHead.color = #(test)
    c''4
  }
}

Is there any way to get the override to be reevaluated with each repeat?

Thanks,
David

reply via email to

[Prev in Thread] Current Thread [Next in Thread]