Re: optional transposition triggered by an external file?

2013-07-30 Thread Marc Hohl

Am 30.07.2013 02:30, schrieb David Rogers:

Marc Hohl m...@hohlart.de writes:


[...]
I need a way to define an optional variable that controls (if defined)
the transposition so I can say, for example:

\begin{appendix}
\chapter{For Bb instruments}
\begin{lilypond}
#(define transposeTo d)
\include{A.ly}
\end{lilypond}

\begin{lilypond}
#(define transposeTo d)
\include{B.ly}
\end{lilypond}

...
\end{appendix}



I've never tried this. Is it even possible to define things in the latex
file that are then parsed by Lilypond? If it is possible, perhaps adding
a special line inside each of A.ly, B.ly, and C.ly, which contains
\transpose C \transposeTo .


Yes, that's the plan.

 That looks to me [if it was going to work at

all] as if your .ly files would then refuse to work if you ever forgot
to define \transposeTo in your latex file - but maybe it's worth it.



That's exactly what I want to avoid. My idea boils down to allow for
something like

transposeTo = transposeTo OR c

which is Lua-like. Is something similar possible in scheme?

Marc


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: optional transposition triggered by an external file?

2013-07-30 Thread David Kastrup
Marc Hohl m...@hohlart.de writes:

 \begin{appendix}
 \chapter{For Bb instruments}
 \begin{lilypond}
 #(define transposeTo d)
 \include{A.ly}
 \end{lilypond}

Rather \include A.ly

 That's exactly what I want to avoid. My idea boils down to allow for
 something like

 transposeTo = transposeTo OR c

 which is Lua-like. Is something similar possible in scheme?

Well, Scheme does not autodeclare variables, so it's more complex:

#(define transposeTo (if (defined? 'transposeTo) transposeTo #{ c #}))

-- 
David Kastrup


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: optional transposition triggered by an external file?

2013-07-30 Thread Marc Hohl

Am 30.07.2013 09:56, schrieb David Kastrup:

Marc Hohl m...@hohlart.de writes:


\begin{appendix}
\chapter{For Bb instruments}
\begin{lilypond}
#(define transposeTo d)
\include{A.ly}
\end{lilypond}


Rather \include A.ly


Of course, silly me.


That's exactly what I want to avoid. My idea boils down to allow for
something like

transposeTo = transposeTo OR c

which is Lua-like. Is something similar possible in scheme?


Well, Scheme does not autodeclare variables, so it's more complex:

#(define transposeTo (if (defined? 'transposeTo) transposeTo #{ c #}))


'defined?' is exactly what I needed – thanks a lot!

Marc



___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: optional transposition triggered by an external file?

2013-07-30 Thread Wim van Dommelen


On 30 Jul 2013, at 08:46 , Marc Hohl wrote:



transposeTo = transposeTo OR c

In the past I've used a very simple construct:

notes = { ... }

music = {
\tag Bassoon \notes
\tag BCl \transpose bes, c' { \notes }
}

instrument = Bassoon	% could be Bassoon or BCl (bassclarinet) in  
my case


\score
\keepWithTag \instrument \music
\layout {}
}

It is sort of hard-coded, BUT I could vary the instrument by creating  
a small file in which I stated this instrument and just included that  
file again in the Lilypond framework-file. With an external Makefile I  
steered what should be done by generating (or copying) this include- 
file and then running the lilypond command on the framework.


Regards,
Wim.



___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: optional transposition triggered by an external file?

2013-07-30 Thread Marc Hohl

Am 30.07.2013 16:30, schrieb Wim van Dommelen:


On 30 Jul 2013, at 08:46 , Marc Hohl wrote:



transposeTo = transposeTo OR c

In the past I've used a very simple construct:

notes = { ... }

music = {
 \tag Bassoon \notes
 \tag BCl \transpose bes, c' { \notes }
}

instrument = Bassoon% could be Bassoon or BCl
(bassclarinet) in my case

\score
 \keepWithTag \instrument \music
 \layout {}
}

It is sort of hard-coded, BUT I could vary the instrument by creating a
small file in which I stated this instrument and just included that file
again in the Lilypond framework-file. With an external Makefile I
steered what should be done by generating (or copying) this include-file
and then running the lilypond command on the framework.


Thanks for sharing – the (only) drawback is that I have to
define \instrument in *any* case. David's solution has the advantage
of having a completely standalone compilable LilyPond file plus the
option to change the transposition by simply including another tiny
file.

Marc


Regards,
Wim.






___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


optional transposition triggered by an external file?

2013-07-29 Thread Marc Hohl

Hello list,

for my current project I have some scores located in
individual files:

A.ly
B.ly
C.ly

which can be compiled independently, and a latex file
containing calls like this

\lilypondfile{A.ly}

[... some text ...]

\lilypondfile{B.ly}

[... even more text ...]

\lilypondfile{C.ly}

This works fine.

Now I want to include an appendix for transposing instruments
(Saxophone in e flat etc.) where all the files are transposed
accordingly.

Now my (probably way too complicated and crude) idea sounds like this:

I need a way to define an optional variable that controls (if defined)
the transposition so I can say, for example:

\begin{appendix}
\chapter{For Bb instruments}
\begin{lilypond}
#(define transposeTo d)
\include{A.ly}
\end{lilypond}

\begin{lilypond}
#(define transposeTo d)
\include{B.ly}
\end{lilypond}

...
\end{appendix}

As an alternative, the #(define ...) stuff could be hidden in a file
transposeToBes.ily and the above calls change to

\begin{appendix}
\chapter{For Bb instruments}
\begin{lilypond}
\include{transposeToBes.ily}
\include{A.ly}
\end{lilypond}

\begin{lilypond}
\include{transposeToBes.ily}
\include{B.ly}
\end{lilypond}

...
\end{appendix}

Is this feasible, or am I overlooking the obvious?
I like the idea of having compilable standaloe files for each
piece of music, so this is what I want to achieve.

Regards,

Marc

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: optional transposition triggered by an external file?

2013-07-29 Thread David Rogers
Marc Hohl m...@hohlart.de writes:

 Hello list,

 for my current project I have some scores located in
 individual files:

 A.ly
 B.ly
 C.ly

 which can be compiled independently, and a latex file
 containing calls like this

 \lilypondfile{A.ly}

 [... some text ...]

 \lilypondfile{B.ly}

 [... even more text ...]

 \lilypondfile{C.ly}

 This works fine.

 Now I want to include an appendix for transposing instruments
 (Saxophone in e flat etc.) where all the files are transposed
 accordingly.

 Now my (probably way too complicated and crude) idea sounds like this:

 I need a way to define an optional variable that controls (if defined)
 the transposition so I can say, for example:

 \begin{appendix}
 \chapter{For Bb instruments}
 \begin{lilypond}
 #(define transposeTo d)
 \include{A.ly}
 \end{lilypond}

 \begin{lilypond}
 #(define transposeTo d)
 \include{B.ly}
 \end{lilypond}

 ...
 \end{appendix}


I've never tried this. Is it even possible to define things in the latex
file that are then parsed by Lilypond? If it is possible, perhaps adding
a special line inside each of A.ly, B.ly, and C.ly, which contains
\transpose C \transposeTo . That looks to me [if it was going to work at
all] as if your .ly files would then refuse to work if you ever forgot
to define \transposeTo in your latex file - but maybe it's worth it.

-- 
David R

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user