thanks for this pointer -- i'll have a look into it tomorrow. its definitely getting close to my bedtime. *gg*
it's an interesting solution -- i don't know any lisp to hack it into emacs, but i do know perl, so i'll mebbe have a crack at that tomorrow. or maybe in vbscript -- that should be a fairly quick script. thanks again, raybro. good night, simon. On Tue, 2002-07-30 at 03:19, William R Brohinsky wrote: > 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 > > _______________________________________________ > Lilypond-user mailing list > [EMAIL PROTECTED] > http://mail.gnu.org/mailman/listinfo/lilypond-user -- Confucius say, man who live in glass house shower in basement. _______________________________________________ Lilypond-user mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/lilypond-user
