lilypond-user
[Top][All Lists]
Advanced

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

Re: Please help with Lilypond calling Scheme


From: Thomas Morley
Subject: Re: Please help with Lilypond calling Scheme
Date: Wed, 21 Sep 2016 01:42:44 +0200

2016-09-20 23:30 GMT+02:00 Malte Meyn <address@hidden>:
>
>
> Am 20.09.2016 um 19:12 schrieb PMA:
>>
>> (define (colorNote n)
>>   (cond ((eq? (- n) 1) 'red )
>>         ((eq? (- n) 2) 'blue)))
>
>
> This returns the symbol 'red or the symbol 'blue, not the constant named red
> (value (1.0 0.0 0.0)) or the constant named blue.

For the record, with x11-color you can use symbols.

#(define (colorNote n)
  (case n
    ((-1) 'red)
    ((-2) 'blue)
    (else '())))

FS =
#(define-music-function (parser location offset) (number?)
  #{
    \override NoteHead.font-size = #offset
    \override NoteHead.color = #(x11-color (colorNote offset))
  #})

{ \FS -1 c'1 }

Cheers,
  Harm



reply via email to

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