lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: music-to-markup


From: Urs Liska
Subject: Re: music-to-markup
Date: Wed, 23 Jul 2014 21:54:27 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.6.0

Am 23.07.2014 18:52, schrieb David Kastrup:
Urs Liska <address@hidden> writes:

is it possible to take a music expression and print out its literal
input?

Sort of.

In other words: Could I write a function "\example" that takes a music
expression as an argument and that first outputs the input code as
text and then as a score?

So that

\example {
   \relative c' {
     c8 d e
   }
}

Well, if you write

example =
#(make-scheme-function (parser location music) (ly:music)
...
then (ly:input-both-locations location)
will return

-- Function: ly:input-both-locations sip
      Return input location in SIP as ‘(file-name first-line first-column
      last-line last-column)’.

So you'll be able to take the input location information and read the
corresponding source from the file.

So you mean I should parse this (example result):
(/tmp/frescobaldi-4Orug3/tmp8Y5V5X/document.ly 8 0 16 1)

open the file (separately) from Scheme and read the given range?
You're right, that looks somewhat awkward but whould give me a start.

Thanks
Urs


It is sort of annoying that LilyPond does not offer something already
doing that since it _does_ have the information available (as you can
see when it produces error messages).





reply via email to

[Prev in Thread] Current Thread [Next in Thread]