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



_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to