lilypond-user
[Top][All Lists]
Advanced

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

Including only definitions from a Lilypond file


From: Jérôme Plût
Subject: Including only definitions from a Lilypond file
Date: Thu, 13 Aug 2020 18:18:45 +0000
User-agent: NeoMutt/20170113 (1.7.2)

Hello everybody,

I have some lilypond files that contain both music variables and
typesetting instructions, like this:

soprano = \relative {
  % music here...
}

\bookpart {
  % typesetting here...
}

I would like to include this file while importing the definitions and
ignoring the typesetting. (The long-term goal is to display some
statistics (range, etc.) about the various voices in the piece. So the
including file will want to know what \soprano contains, but to
replace all typesetting instructions by its own).

I *could* do this by writing a separate (e.g. Perl) parser that looks
only for music definitions, but it would be cleaner (and also more
robust) if there existed a way to do this from inside Lilypond or
Scheme. Ideally I would need the parser to obtain both the list of
variables defined in the file and the contents of those variables.

Before I start hacking something: does there already exist a simpler
way to do this?

Thanks,

-- 
        Jérôme
 



reply via email to

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