[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Convert Lilypond syntax to Scheme list
From: |
Thorsten Jolitz |
Subject: |
Re: Convert Lilypond syntax to Scheme list |
Date: |
Sun, 22 Jun 2014 04:31:30 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) |
Jay Anderson <address@hidden> writes:
> On Sat, Jun 21, 2014 at 6:36 PM, Thorsten Jolitz <address@hidden> 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:
,----
| address@hidden ~]$ 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