lilypond-user
[Top][All Lists]
Advanced

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

how to define a boolean?


From: Marc Hohl
Subject: how to define a boolean?
Date: Sat, 08 Aug 2009 19:31:26 +0200
User-agent: Thunderbird 2.0.0.22 (X11/20090608)

Sorry if this is a stupid question, but here im totally stuck:

I need to define a boolean which is to be changed within a music-function
and a stencil callback.

I tried

#(define mybool #f)

at the beginning and later

myfunc = #(define-music-function (parser location note) (ly:music?)
 (set! mybool #t)
 #{
   ...do some stuff with... $note
 #})

and

#(define-public (my-callback grob)
  ...

  (if (eq? mybool #t)
      (...stuff for true ...)
      (...stuff for false ... ))
  ;; reset mybool
  (set! mybool #f)
  ...
)

but this approach doesn't seem to work; the value doesn't change when I call \myfunc within a Voice. I tried the same thing with numeric values, but that didn't work either.
What am I doing wrong?

Marc





reply via email to

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