lilypond-user
[Top][All Lists]
Advanced

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

Re: How to include a file/definition temporarily?


From: David Kastrup
Subject: Re: How to include a file/definition temporarily?
Date: Mon, 20 Sep 2010 09:19:25 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

Patrick Schmidt <address@hidden> writes:

> Hi all,
>
> I have several files with definitions of guitar fret diagrams for
> various chord shapes (e.g. c-shape.ly, a-shape.ly, g-shape.ly, e- 
> shape.ly and d-shape.ly). I can't include all of these files at the
> same time in the main file as quite a few chord alternatives start on
> the same pitch. How can I use those definitions only temporarily? I
> tried this:
>
> cShape = { \include "c-shape.ly" }
> aShape = { \include "a-shape.ly"  }
>
> music = \chordmode {
>   \cShape
>   c1
>   \aShape
>   c1
> }

Maybe something like

stdfretboard = #(copy-list fretboard-table)
\include "c-shape.ly"
cshapefretboard = #(copy-list fretboard-table)
#(set! fretboard-table stdfretboard)
\include "a-shape.ly"
ashapefretboard = #(copy-list fretboard-table)
cShape = #(define-music-function ... (set! fretboard-table
           cshapefretboard)
aShape = #(define-music-funciton ...

or similar.  If c-shape/a-shape just add items to the front of
fretboard-table, you will not even need to copy stuff.  If it is
something other than a list, you'll need some other copying mechanism.

I have not checked in detail.

-- 
David Kastrup




reply via email to

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