On Sun 01 May 2016 at 23:04:05 (+0000), Joseph Chrestien wrote: > > Yes, see this thread in the german forum > > http://www.lilypondforum.de/index.php?topic=2087.0 > discussed are different possibilities: > > > (1) python from within a lilyfile.ly: > > Yay, it works! I have "Hello world" in the log, which is already great. > > However, I can't find yet whether I have some chance of recursively modifying > the Lilypond input through python before compilation goes any further... the > German forum conversation does not mention that and I suspect it will not be > very easy... However, I should be able to read from it and (over)write an > external lilyfile, then have that one included in the original score. Looking > good to me. > > I'll keep you updated with that. Thanks for the tip (I'm desperate with Guile > :S)
It works for me on linux. I've also attached the file that gets written on the fly. Whether make-cake.py can read yummy.ly while LP is also processing it may depend on your OS. Cheers, David.
outfile = open('eat-me.ly', 'w')
print('{ c\'4 }', file=outfile)
pyMx =
#(define-void-function (parser location)()
(system "python3 make-cake.py")
)
\pyMx
\include "eat-me.ly"
yummy.pdf
Description: Adobe PDF document
{ c'4 }
_______________________________________________ lilypond-user mailing list [email protected] https://lists.gnu.org/mailman/listinfo/lilypond-user
