Re: Transpose a lilypond file

2014-10-05 Thread Malte Meyn

You can do something like the following and move the “foo = …” into song.ly:

\version 2.19.13

foo = \new Score {
  
{ c' d' e' f' }
  
}

{ \foo }

\transpose c d \foo

Am 05.10.2014 um 10:03 schrieb Jay Vara:

I have a song.ly file which prints a song. Is it possible for someone to
print the song with a transposition, say c to d, without editing the .ly
file? Something like:

\transpose c d {\include song.ly}




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



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


Re: Transpose a lilypond file

2014-10-05 Thread Urs Liska
Not directly. You should somehiw pull the music variables out of song.ly and 
compile a second file.

Or you use version control and either create a transposed branch or simply 
edit, compile and discard the transposition. 

HTH
Urs

Am 5. Oktober 2014 10:03:29 MESZ, schrieb Jay Vara j...@diljun.com:
I have a song.ly file which prints a song. Is it possible for someone
to 
print the song with a transposition, say c to d, without editing the
.ly 
file? Something like:

\transpose c d {\include song.ly}




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


Re: Transpose a lilypond file

2014-10-05 Thread Marc Hohl

Am 05.10.2014 um 10:03 schrieb Jay Vara:

I have a song.ly file which prints a song. Is it possible for someone to
print the song with a transposition, say c to d, without editing the .ly
file? Something like:

\transpose c d {\include song.ly}


I had a similar problem some time ago.

I included the following lines in song.ly

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

melody = { ... }
chords = {... }

\score {
   \transpose c $transposeTo
   
 ...chords ...
 ...melody ...
   
}

Then you simply make a new file song-in-d.ly:

#(define transposeTo #{ d #})
\include song.ly



HTH,

Marc













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




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


Re: Transpose a lilypond file

2014-10-05 Thread Urs Liska


Am 5. Oktober 2014 11:18:42 MESZ, schrieb Marc Hohl m...@hohlart.de:
Am 05.10.2014 um 10:03 schrieb Jay Vara:
 I have a song.ly file which prints a song. Is it possible for someone
to
 print the song with a transposition, say c to d, without editing the
.ly
 file? Something like:

 \transpose c d {\include song.ly}

I had a similar problem some time ago.

I included the following lines in song.ly

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

melody = { ... }
chords = {... }

\score {
\transpose c $transposeTo

  ...chords ...
  ...melody ...

}

Then you simply make a new file song-in-d.ly:

#(define transposeTo #{ d #})
\include song.ly



Cool solution, I'll take this into my repertoire.

You can then factor out the function into a library file. And you could pass 
the variable on the commandline instead of adding a new file.

Urs


HTH,

Marc












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



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


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


Re: Transpose a lilypond file

2014-10-05 Thread Richard Shann
On Sun, 2014-10-05 at 11:27 +0200, Urs Liska wrote:
 
 Am 5. Oktober 2014 11:18:42 MESZ, schrieb Marc Hohl m...@hohlart.de:
 Am 05.10.2014 um 10:03 schrieb Jay Vara:
  I have a song.ly file which prints a song. Is it possible for someone
 to
  print the song with a transposition, say c to d, without editing the
 .ly
  file? Something like:
 
  \transpose c d {\include song.ly}
 
 I had a similar problem some time ago.
 
 I included the following lines in song.ly
 
 #(define transposeTo
 (if (defined? 'transposeTo)
 transposeTo
 #{ c #}))
 
 melody = { ... }
 chords = {... }
 
 \score {
 \transpose c $transposeTo
 
   ...chords ...
   ...melody ...
 
 }
 
 Then you simply make a new file song-in-d.ly:
 
 #(define transposeTo #{ d #})
 \include song.ly
 
 
 
 Cool solution, I'll take this into my repertoire.
 
 You can then factor out the function into a library file. And you could pass 
 the variable on the commandline

That's interesting - in Denemo I created a global transpose variable to
be applied not just to the score but also things like footnotes quoting
bits of music - being able to specify the value of this transposition
from the command line adds more flexibility - I guess you would need the
if-not-defined construct to handle this (otherwise you would *have* to
define the variable on the command line).

Richard



  instead of adding a new file.
 
 Urs
 
 
 HTH,
 
 Marc
 
 
 
 
 
 
 
 
 
 
 
 
  ___
  lilypond-user mailing list
  lilypond-user@gnu.org
  https://lists.gnu.org/mailman/listinfo/lilypond-user
 
 
 
 ___
 lilypond-user mailing list
 lilypond-user@gnu.org
 https://lists.gnu.org/mailman/listinfo/lilypond-user
 
 
 ___
 lilypond-user mailing list
 lilypond-user@gnu.org
 https://lists.gnu.org/mailman/listinfo/lilypond-user



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


Re: Transpose a lilypond file

2014-10-05 Thread Jay Vara
Marc 
 
 #(define transposeTo
 (if (defined? 'transposeTo)
 transposeTo
 #{ c #}))
 
 melody = { ... }
 chords = {... }
 
 \score {
 \transpose c $transposeTo
 
   ...chords ...
   ...melody ...
 
 }
 
 Then you simply make a new file song-in-d.ly:
 
 #(define transposeTo #{ d #})
 \include song.ly
 

Very nice. And easy to add to my existing .ly files. This idea may also 
work for another issue I have. Different number of music pieces in the 
score. \musicA \musicB \musicC etc. In some cases only two are defined 
and in some cases five or six are defined. I should be able to used the 
defined? construct to handle that. 

Thanks.
Jay


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


Re: Transpose a lilypond file

2014-10-05 Thread Jay Vara
Urs 

 #(define transposeTo #{ d #})
 \include song.ly
 
 
 
 Cool solution, I'll take this into my repertoire.
 
 You can then factor out the function into a library file. And you could 
pass the variable on the commandline
 instead of adding a new file.
 

Being able to call from the command line would be quite interesting. We 
were going to have a website where someone could get the song sheet plus 
the corresponding midi with the transpose they want. Would be easy to 
implement with the command line option. That project is still a few months 
away.

Thanks
Jay


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