lilypond-user
[Top][All Lists]
Advanced

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

Re: Enhancement: command line option to transpose N halftones up or down


From: David Nalesnik
Subject: Re: Enhancement: command line option to transpose N halftones up or down
Date: Mon, 16 Mar 2015 11:26:30 -0500


Hi Michael,
 

Am 16.03.2015 um 15:02 schrieb Michael Schuerig:

I've only been using LilyPond for a rather short time, so far mostly for
engraving short snippets transposed into several keys for practicing. Of
course, the transpose command works nicely for this.

However, it made me think of how transposing could be even nicer and now I'm
wishing for a command line option to the lilypond command to transpose the
engraved document by N halftones up or down. The particular advantage would
be that this way the original document doesn't need to be changed in any way
in order to transpose it.

If you're simply dealing with numbers of semitones, how would you be able to control whether the output begins on, say, F# versus Gb?  

I can imagine something which specifies that the music begin on such-and-such a pitch.  For that, you could define a simple music function--which really isn't saving any effort!

%%%
\version "2.19.16"

beginOn =
#(define-music-function (layout props new mus)
   (ly:pitch? ly:music?)
   #{
     \transpose #(ly:make-pitch 0 0) #new
     #mus
   #})

music = { c' d' e' f' }

{
  \music
  \beginOn es'' \music
  \beginOn g \music
}

%%%
I'd have to investigate what would be possible from the command line.

--David

reply via email to

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