[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
The life of a Grob
From: |
Joe Neeman |
Subject: |
The life of a Grob |
Date: |
Sat, 16 Sep 2006 23:40:59 +1000 |
Understanding the LilyPond source often boils down to figuring out what
is happening to the Grobs. Where (and why) are they being created,
modified and destroyed? I've spent many hours tracing Lily through a
debugger and it is mind-blowingly tedious.
So I quickly hacked a few things together and came up with something a
bit better. I added hooks into internal_grob_set_property and
make_grob_from_properties. You can register a scheme callback which will
get called whenever a Grob is modified or created. The scheme callback
will receive the file and line numbers in the C++ source where the call
was made. This can help you to trace cause and effect through the C++
source.
This is very hackish right now (I only started this morning), but I
thought I'd share a quick application. The file test.ly produces a
graphviz output file, "graph.dot", that lets you visualise the changes
in Grobs throughout LilyPond execution. For now, you'll need to add a
closing brace to the end of graph.dot.
I attach a patch, an example input file and a sample output.
life_of_a_grob.patch
Description: Text Data
graph.ps.gz
Description: application/gzpostscript
test.ly
Description: Text document
- The life of a Grob,
Joe Neeman <=
Re: The life of a Grob, Werner LEMBERG, 2006/09/16