[Top][All Lists]

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

Re: Some questions related to score video generation

From: David Kastrup
Subject: Re: Some questions related to score video generation
Date: Fri, 07 Jul 2017 14:55:29 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

Knut Petersen <address@hidden> writes:

> Question 2: I also would like to change the color of the stems, flags
> and dots that
> belong to a notehead, but those have no 'duration.

You keep saying that, but you look at the duration of the causing event
for noteheads in your example anyway, and of course one can do that with

> Does anybody have an idea how to give a certain color to those grobs
> from inside the code called by the notehead after-line-breaking
> override?

colorizator =
#(lambda (grob)
  (define bla (vector red green blue cyan yellow magenta black))
  (vector-ref bla (ly:duration-log
                   (ly:event-property (event-cause grob) 'duration))))

\layout {
  \context {
    \override NoteHead.color = #colorizator
    \override Stem.color = #colorizator
    \override Dots.color = #colorizator

\fixed c' {
  \new Staff {
    a4. b'16 c' a8 a'2 g'2. f'4

David Kastrup

reply via email to

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