Andrew Bernard <andrew.bern...@gmail.com> writes: > I use debug print statements when developing scheme music functions. I > have this evening noticed for the first time that my complete > perplexity regarding various properties may actually come from the > following problem. When I run a function several times in a row, the > print output comes out in backwards order to the score note order. [No > wonder I have been confused.] The MWE here shows this.
No, it doesn't. You don't put display statements into the music function (which is run at the time it is encountered in the source) but into a callback. The order in which callbacks are called is pretty much arbitrary. In fact, callbacks may be called more than once in unpure-pure-containers (I think that's the basic remaining point of duplicity) for different line break configurations. Or not at all, depending on when LilyPond decides that it does not need the particular stencil for typesetting. Or earlier than you expect when some other grob needs some callback-triggered property of a different grob in order to figure out some details. So when you put debug output in callbacks, the time of call is unknown, it is not known whether you get called at all, and depending on the callback type, you might be called several times. Spanners are often active in several systems at once, at each of the spanner parts gets its own callback calls. -- David Kastrup _______________________________________________ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user