Carl Sorensen schrieb:
[...]

The *specific* behavior you have requested can be achieved by the following:

#(define myBool #f)

myMusicFunc =
#(define-music-function (parser location) ()
   #{
     \once \override Slur #'dummyProperty = ##t
   #})

#(define-public (slur::boolean grob)
  ;; just a test function to try and switch boolean values
    (let ((my-prop (ly:grob-property grob 'dummyProperty #f)))
      (display "\nWithin callback\n")
      (display "my-prop: ")(display my-prop)(newline)
    (if my-prop
        (display "Actions for #t go here...")
        (display "Actions for #f go here..."))
    (set! myBool #f)
    (display "myBool: ")(display myBool)(newline)
    (ly:slur::print grob)))

\layout {
  \context {
    \Voice
    \override Slur #'stencil = #slur::boolean
  }
}

\relative c'' {
    c4 ( c )
    \myMusicFunc
    c ( c )
    c ( c )
    \myMusicFunc
    c ( c )
}

Ok, I played with your code - the result on console for my-prop is #f #t #t #f,
but it should be #f #t #f #t, isn't it?

Marc


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

Reply via email to