[Top][All Lists]

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

Re: passing a Context to a scheme function (format-metronome-markup)

From: Han-Wen Nienhuys
Subject: Re: passing a Context to a scheme function (format-metronome-markup)
Date: Tue, 7 Oct 2008 11:58:06 -0300

You can't do this; the format-metronome-markup is run during
interpreting, from Metronome_mark_engraver, which will pass the
context object by doing context()->self_scm() in C++.

I suggest you refactor the code a bit, so your call and
format-metronome-markup use the same code.

On Mon, Oct 6, 2008 at 7:10 PM, Graham Percival <address@hidden> wrote:
> I'm experimenting with calling (format-metronome-markup) directly,
> but I'm having difficulty with the context argument.
>   // main code:
> (define-public (format-metronome-markup text dur count context)
> ...
> My code:
> \header{
>  piece = #(format-metronome-markup "Allegro" 4 120 'Global)
> }
> \relative c' { c }
> Error message:
> error: GUILE signaled an error for the expression
> beginning here
>  piece = #
>           (format-metronome-markup "Allegro" 4 120 'Global)
> Wrong type argument in position 1 (expecting Context): Global
> I've tried #f, '(), 'void, 'Score, and a few other things I can't
> remember.  The only time that context occurs in the function is
>  (let* ((hide_note (eq? #t (ly:context-property context
> 'tempoHideNote))) which doesn't concern me -- I want this to always
> resolve to false.  How do I give the function a Context?

Han-Wen Nienhuys - address@hidden -

reply via email to

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