lilypond-user
[Top][All Lists]
Advanced

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

Re: Transpose a lilypond file


From: Richard Shann
Subject: Re: Transpose a lilypond file
Date: Sun, 05 Oct 2014 11:52:34 +0100

On Sun, 2014-10-05 at 11:27 +0200, Urs Liska wrote:
> 
> Am 5. Oktober 2014 11:18:42 MESZ, schrieb Marc Hohl <address@hidden>:
> >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
> >> address@hidden
> >> https://lists.gnu.org/mailman/listinfo/lilypond-user
> >>
> >
> >
> >_______________________________________________
> >lilypond-user mailing list
> >address@hidden
> >https://lists.gnu.org/mailman/listinfo/lilypond-user
> 
> 
> _______________________________________________
> 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]