lilypond-user
[Top][All Lists]
Advanced

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

e: Scheme question: symbol to music


From: Roman Stawski
Subject: e: Scheme question: symbol to music
Date: Thu, 13 Nov 2008 10:50:02 +0100

address@hidden wrote:

Roman Stawski <address@hidden> writes:

Take a look at http://lsr.dsi.unimi.it/LSR/Item?u=1&id=493

Nice!

Is there a way to get rid of the "warning: no such internal option:
target"?

I asked Nicolas Sceaux the same question when he helped me set this up.
Apparently, the internal options are hard-coded and the warning is
displayed before the scheme code is executed. :-(


This lets you have constructs such as

\ifTargetIn #'(foo) {
    ...
}

A limitation is that it works on music expressions, while I would like
such a function to operate on (a series of) input lines.

Similar to

  \ifTargetIn #'(foo) \include "somelines.ly"

but then with the contents of somelines.ly included, e.g.,

  \ifTargetIn #'(foo) \do
    ... arbitrary lines of lilypond code ...
  \done

Agreed.

My original solution was to use a perl pre-processor that stripped out
unwanted code. This made debugging much more difficult since the lilypond
parser dosn't see the same thing as in the source code (different line
numbers and unexpected side-effects).

I've come across four cases using the 'ifTarget' solution

1. Musical expressions work fine (when used with grouping like <<...>> and
   {...}

2. Scheme snippets and markup blocks for which there are #if-target-in
   equivalents

3. Layout, paper and other context configuration can usually be handled by
   scheme snippets, though some acrobatics may be necessary.

4. Top-level constructs (\include, \score, variable definitions) for which
   I haven't been able to find a solution. On other hand, this hasn't raised
   too many problems since the /contents/ of these constructs can always be
   protected by the macros. The downside is that I need to live with warnings
   such as "warning: no music found in score"

If you have any ideas on how to improve it, let me know

Roman




reply via email to

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