Hello -
This is a repost of a question with an altered criterion: the
following program doesn't have to be a Word macro.
I have a collection of about 70 songs, containing lyrics and chords --
many of which I need to transpose. They're all in separate Microsoft
Word files. I need an intelligent "search and replace", fairly
straightforward program written that will transpose an MS Word file
(executable either within Word or outside of Word). I'd like to have
a link where I can download it.
The program should do the following:
Prompts the user for two inputs: 1) the existing key and 2) the
desired new key to the song. It will then traverse the document and
transpose every chord to the new key. There is a chart containing the
1-7 chords in all the keys at this link:
http://www.guitarforbeginners.com/capo.html
Some of these songs have more complicated chords, with adjacent
superscripts such as 9th's, 11th's, etc. However, this shouldn't be a
problem, as the program could simply identify the fundamental chord
and leave everything to the immediate right of it the same (with the
exception of encountering a "/" character). For example:
Cm(Add9b5)/Bb
In this case, the program would identify the first character (C) and
change it to the appropriate new root chord letter; it would then scan
for a "/" character; if found, it would advance to the next, immediate
alpha character (B), changing that to the appropriate new root chord
letter. The "(Add9b5)" would remain intact, as would any accidentals
or additional characters. It would then advance to the next chord (or
chord combo). The end of the line I believe could be a hard return
character. I don't know the optimum way for the program to determine
a "chord line" vs. a "lyric line." There's no consistency in regards
to the use of tab characters and space characters. However, as the
first criterion, any line containing am, bm, cm, dm, em, fm, or gm
(even with any characters in between the chord letter and the "m",
case insensitive) should be considered a "chord line" immediately.
Perhaps the next criterion could be to see if there are any uppercase
characters, A through G, either prepended or appended by a tab, a
numerical character, or more than 2 spaces? There may be a better
way.
The program would make its way through to the end of the document,
processing all chord lines and be finished when there are no more
chord lines to process.
An example of a few lines of one of the files:
C D F G Dm Cm7
This is a sample lyric line with chords above it
E Fm7/G A B9 B11
This is a sample lyric line with chords above it
E G B Em Am G7sus
Chorus: This is a sample lyric line with chords above it
F Gm B9 Bb9
This is a sample lyric line with chords above it
Please feel free to ask for any clarification.
barryf |
Request for Question Clarification by
elmarto-ga
on
24 Sep 2004 08:58 PDT
Hi barryf,
Are your files in .doc format, or in .txt format, such that they can
be read, for example, using the Windows Notepad? I might be able to
write this program in the latter case.
Thanks,
elmarto
|
Clarification of Question by
barryf-ga
on
24 Sep 2004 09:30 PDT
Hi elmarto -
The files are all in .DOC Word format. Are you able to write a Word
macro, perhaps? I have Conversions Plus by Dataviz, which allows me
to convert doc files to a variety of formats. The problem is, when I
load one of the files into .txt format and load it into Notepad, the
alignment is all messed up. I don't know if that would be a problem,
though, in terms of your program actually transposing the file, but
converting it back to Word might be a problem?
barryf
|