[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Please help with Lilypond calling Scheme
From: |
PMA |
Subject: |
Please help with Lilypond calling Scheme |
Date: |
Tue, 20 Sep 2016 13:12:26 -0400 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.8.0 |
Hi Lilypond Gurus!
I need help, when you can spare the time, to get an already-
working Lilypond music function to call my just-added Scheme
routine.
This Scheme procedure works when called directly from Guile:
entering "(colorNote -1)" get output "red".
--------------------------------
(define (colorNote n)
(cond ((eq? (- n) 1) 'red )
((eq? (- n) 2) 'blue)))
--------------------------------
But in trying to evoke the procedure, the following Lilypond
function hits two snags: it apparently doesn't see colorNote
at all, and even if it did, it still would not convert the
returned "red" to "#red". (I've omitted irrelevant lines.)
----------------------------------------------------------------
FS =
#(define-music-function (parser location offset) (number?)
#{
\override NoteHead.font-size = #offset % This line works.
%\override NoteHead.color = #red % This line worked.
\override NoteHead.color = #(colorNote #offset) % *ERRORS*.
#})
----------------------------------------------------------------
I suspect that a fix here is easy. But it's beyond my naive
struggles. I'd appreciate any suggestions.
Pete
- Please help with Lilypond calling Scheme,
PMA <=
- Re: Please help with Lilypond calling Scheme, PMA, 2016/09/20
- Re: Please help with Lilypond calling Scheme, Urs Liska, 2016/09/20
- Re: Please help with Lilypond calling Scheme, Malte Meyn, 2016/09/20
- Please help enable fussy \tempo output, PMA, 2016/09/22
- Re: Please help enable fussy \tempo output, Simon Albrecht, 2016/09/23