lilypond-user
[Top][All Lists]
Advanced

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

Re: Pull in external LilyPond files into a score of movements


From: Urs Liska
Subject: Re: Pull in external LilyPond files into a score of movements
Date: Sun, 27 Apr 2014 08:13:37 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.4.0

Am 27.04.2014 00:22, schrieb Knute Snortum:
Okay, that looks good.  But there are two things:  First, can the files be
*.ly files instead of *.ily files?

As Paul said, the file extension is purely a convenience for human readers. When \include-ing a file LilyPond will simply read in that file and treat it exactly as if its content would have been written directly in the original input file.

And if not, will *.ily files compile
standalone?  (People will still want to download just one movement.)

The idea is to use the *.ily files as pure includable files (hence .IncludableLY) and _not_ to compile them standalone. In your case you would have to find some cascading set-up, writing the content of the music in one file, the score structure of this individual piece in another one and yet a third one for the whole piece that pulls in the individual movements.

  Second, when I tried to use includes, I got a message saying it couldn't
find the file.  Then it gave me a search path for the includes.  None of
them were the current directory (.). #

The current directory isn't mentioned but searched by default (but you don't have to start it with "./"). So there has to be some detail error in your actual code.

In any case you should be able to do that without an external preprocessor.

HTH
Urs

If I have to put the files in some
standard include directory, it's not going to work.

Thanks for your input.


Knute Snortum
(via Gmail)


On Sat, Apr 26, 2014 at 12:57 PM, Jay Anderson <address@hidden> wrote:

On Sat, Apr 26, 2014 at 11:54 AM, Knute Snortum <address@hidden>
wrote:
Short version:  I'd like to be able to pull in (import) several external
ly
files into a multi-movement piece.

Long version:

I'm transcribing for Mutopia and we have several pieces where people
like to
download one movement from a piece.  For instance, I'm working on
Mussorgsky's Pictures at an Exhibition.  Many people just want the
Promenade
but I don't want make people download 10-14 files to get the whole piece.
Yes, we could zip them, but they would still have to print a dozen files
and
there's no indication of order.

What I'm wondering is if there is some way to create a LilyPond file
containing a book with several scores, where the source of the movements
is
an external file.  "includes" won't do.  Something like this:

\book {
   \score {
     import "./ly_files/promenade-1/promenade-1.ly"
   }
   \score {
     import "./ly_files/gnomus/gnomus.ly"
   }
   ...
}

Possible?  On a wish list?  Some other way to do it?

If there's no good way to do it, I will probably write a Perl
preprocessor
to do it.

Why won't includes work? This is actually how I prefer to work (rather
than variables storing music). Here's an example:

=====================================
\version "2.18.0"

\include "defs.ily"

instrument = "Horn in F"

\include "header.ily"

\score
{
   \new Staff
   <<
     { \include "mvt1/horn.ily" }
     { \include "mvt1/outline.ily" }
   >>
}
\score
{
   \new Staff
   <<
     { \include "mvt2/horn.ily" }
     { \include "mvt2/outline.ily" }
   >>
}
\score
{
   \new Staff
   <<
     { \include "mvt3/horn.ily" }
     { \include "mvt3/outline.ily" }
   >>
}
=====================================

I can use this file for the individual part, another for the piano
part, and anther which compiles a multiple pieces together. (assuming
a similar file structure: mvt1/horn.ily, mvt/outline.ily,
mvt1/piano_right.ily, etc.)

When typing out the score block becomes too repetitive I do something like
this:

=====================================
\version "2.18.0"

... includes ...

makeGallayScore =
#(define-void-function (parser location num) (string?)
   (let ((score
          #{
            \score
            {
              \new Staff { \include #(string-append num ".ily") }
            }
          #}))
     (add-score parser score)))

makeGallay =
#(define-void-function (parser location low high) (number? number?)
   (do ((i low (+ i 1)))
       ((> i high))
     (let ((n (format #f "~2,'0d" i)))
       #{ \makeGallayScore $n #})))

\makeGallay 1 40
=====================================

This was for a book of etudes. Each etude is the raw music in files
named 01.ily through 40.ily.

-----Jay




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





reply via email to

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