Jay Anderson <horndud...@gmail.com> writes:

> On Sat, Jun 21, 2014 at 6:36 PM, Thorsten Jolitz <tjol...@gmail.com> wrote:
>> How do I get this list/parse-tree representation of a lilypond file
>> (without any further processing, just the Lisp representation as
>> output to stdout or into a file)?
>
> http://lilypond.org/doc/v2.18/Documentation/notation/available-music-functions#index-displayMusic
>
> You'll need to modify your file in order to get this output.

very nice, thank you!

With that tip I could find 

,----
| 
http://www.lilypond.org/doc/v2.17/Documentation/extending/displaying-music-expressions
`----

and produce something like this:

,----
| [tj@arch ~]$ lilypond test.ly
| GNU LilyPond 2.18.2
| »test.ly« wird verarbeitet
| Analysieren...
| (make-music
|   'SequentialMusic
|   'elements
|   (list (make-music
|           'RelativeOctaveMusic
|           'element
|           (make-music
|             'SequentialMusic
|             'elements
|             (list (make-music
|                     'NoteEvent
|                     'pitch
|                     (ly:make-pitch -1 5 0)
|                     'duration
|                     (ly:make-duration 2 0 1))
|                   (make-music
|                     'NoteEvent
|                     'pitch
|                     (ly:make-pitch -1 6 0)
|                     'duration
|                     (ly:make-duration 2 0 1))
|                     [...]
|                   (make-music
|                     'NoteEvent
|                     'duration
|                     (ly:make-duration 0 0 1)
|                     'pitch
|                     (ly:make-pitch -1 5 0)))))))
`----

Since this probably is produced anytime I call 

,----
| $ lilypond foo.ly
`----

I still wonder if there is a way to get my hands on this internal
representation without modifying the music notation, i.e without writing 

,----
|     {
|       \displayMusic { c'4\f }
|     }
`----

in my .ly files?

But nevertheless, this is great ... Lisp rules ;)

-- 
cheers,
Thorsten


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

Reply via email to