[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: |
Marc Hohl |
Subject: |
Re: Enhancement: command line option to transpose N halftones up or down |
Date: |
Mon, 16 Mar 2015 18:07:04 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 |
Am 16.03.2015 um 16:09 schrieb Simon Albrecht:
Hello Michael,
I think this question is more appropriate for the -user list.
Since I usually call lily from inside frescobaldi, my solution to this
has been defining a variable for the resulting pitch:
\version "2.18"
newTonic = des
music = \relative { c' }
\score {
\transpose c \newTonic \music
}
%%%%%%%%%%%%%%
Anyone else knowing how to get this via the commandline? I seem to
recall there was some possibility for custom options or something.
I have done something like that some time ago.
I put these definitions in an include file:
#(define opt-octave (or (ly:get-option 'octave) 0))
#(define opt-note (or (ly:get-option 'note) 0))
#(define opt-alteration (or (ly:get-option 'alteration) 0))
#(define to-pitch (ly:make-pitch opt-octave opt-note opt-alteration))
optionalTranspose = #(define-music-function (parser location music)
(ly:music?)
#{ \transpose c' $to-pitch $music #})
In the main file, you can use
\optionalTranspose { ...your music ...}
It is a bit cumbersome to specify
lilypond -dopt-octave=... -dopt-note=--- -dopt-alteration=... <filename.ly>
for each file, but aas I used this in a bash script to transpose a tune
in *all* keys, it didn't matter.
HTH,
marc
HTH, Simon
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.
Does this sound reasonable?
Michael
_______________________________________________
bug-lilypond mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/bug-lilypond
_______________________________________________
lilypond-user mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/lilypond-user