lilypond-user
[Top][All Lists]
Advanced

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

Re: transposing


From: William R Brohinsky
Subject: Re: transposing
Date: Mon, 29 Jul 2002 21:19:21 -0400

Simon Bailey wrote:
> 
> On Mon, 2002-07-29 at 22:18, Rune Zedeler wrote:
> > > i know this may seem like a weird question but is there a way to
> > > transpose and generate "lily-input" output?
> >
> > Why would you need that?
> 
> one of the projects i'm currently working on is rearranging a march from
> the american civil war for a modern marching band. the thing is -- the
> original version is written mainly for e-flat instruments -- a modern
> band (here in austria at least) has almost only b-flat instruments
> written in treble (tranposed to b-flat) and bass (natural in c) clef.

This really isn't a lily problem, since lily tends not to concern itself
with generating output (other than in the case of midy2ly). However,
it's not an intractible problem.

The easiest thing to do would be to program a module for the editor you
use. I'm currently not using linux for lily, so my tendency is to look
at windows solutions. Notepad is a total loss. Word has VBA now, which
is good: you could write the module in VBA, bind it to a keycombo,
highlight the music to transpose, do the keycombo, insert the current
key (don't make the poor program try to fingure that out) and the key to
transpose to. 

Since you are only looking to transpose Eb parts to Bb, you could make a
simpler program with just that one change. It'd only need a two
dimensional text array, with element [0,0]= "C" and [0,1] = "G", [1,0] =
"D", [1,1]="A". Do this logically: first for the major scale (mostlikely
notes to see), then after that, chromatics properly named. Then
chromatics that wouldn't be properly named, just for good luck. Have the
module look at each note entry, separate the note name from the number,
look up the number in the [0,*] array, print out the same index from the
[1,*] array, stick the duration number on the end, and do it again.

For all transposing cases, you'd want to have a 2D array with more than
2  1D arrays: one for each possible key. Then, it'd be a matter of
locating the proper first index for the from- and to- keys, and then the
solution is identical to the previous paragraph.

It should be possible to do this in Emacs Lisp. It is certainly easy to
do in C, if there's a good interface in emacs for running external
programs on highlighted text. I just don't know emacs well enough to
begin there.

An external C program could certainly be written (or god forbid, C++,
Perl, REXX, Python, whatever) that parses the Lily code, finds music,
determines the key that music is notated in (maybe by the nearest
preceding \key command?) finds out what interval to transpose by, and
has at it. If all the rest of this seems gobbletygookish to you, I'll
take a crack at that, since I have been able to write programs in unix
with some modicum of success.

raybro



reply via email to

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