(In reply to
re(3): An observation -- hint by Gamer)
Having peeked at the answer, and having had no success identifying the song from the notes given, I looked into one of my wife's Christmas song books and wrote the notes. The staff indicated that B's and F's were flatted, which my wife tells me means the piece is written for the key of B flat:
fDacbgFgF
fgabbcdCC
fDacbgFgF
fGgagfBB
The capital letters are quarter notes and the lower case eighth notes. (Actually a couple of the capitals are dotted quarter notes, but it's not noticeable, especially as in one case a dotted quarter note should have been tied to another quarter note.) The F was the lowest note in the octave used (all the F's).
The first part of the following program plays this, and it's recognizable this time.
The second part transposes it so that the F that starts every verse is translated down to a C. I haven't bothered to put octave notations in, as I had done in the first part so that the tune would be recognizable (the computer treats an octave as beginning with A, but I had to change that to F for the playing of the first part, as that was the lowest note; it would be different for the transposed version, which has C low).
DIM n$(12)
CLS
DATA c,cd,d,de,e,f,fg,g,ga,a,ab,b
FOR i = 1 TO 12: READ n$(i): PRINT n$(i); " "; : NEXT
theMusic:
DATA fDacbgFgF
DATA fgabbcdCC
DATA fDacbgFgF
DATA fGgagfBB
' play the original
FOR i = 1 TO 4
READ vs$
FOR j = 1 TO LEN(vs$)
c$ = MID$(vs$, j, 1)
cc$ = c$
IF LCASE$(cc$) = "b" OR LCASE$(cc$) = "e" THEN c$ = c$ + "-"
IF cc$ = UCASE$(cc$) THEN c$ = "l4" + c$: ELSE c$ = "l8" + c$
IF LCASE$(cc$) >= "f" THEN c$ = "<" + c$ + ">"
PLAY c$: PRINT c$;
NEXT
PRINT
NEXT
RESTORE theMusic
' transpose F down to C (5 halftones)
FOR i = 1 TO 4
READ vs$
FOR j = 1 TO LEN(vs$)
c$ = MID$(vs$, j, 1)
cc$ = LCASE$(c$)
FOR ix = 1 TO 12
IF n$(ix) = cc$ THEN EXIT FOR
NEXT
IF cc$ = "b" OR cc$ = "e" THEN ix = ix - 1
ix = ix - 5
IF ix < 1 THEN ix = ix + 12
cc$ = n$(ix)
IF cc$ = "fg" THEN cc$ = "f#"
IF c$ = UCASE$(c$) THEN cc$ = UCASE$(cc$)
PRINT cc$; " ";
NEXT
PRINT
NEXT
The transposed version, beginning each verse with a low C (not just the first and third verses), comes out as follows:
c A e g f d C d C
c d e f f g a G G
c A e g f d C d C
c D d e d c F F
Again, capital means quarter note and lower case eighth note. All the C's are the low end of the scale, as were all the F's in the songbook.
compare to
c a g g d c d c
c d e f f g a g
c a e a f d c d c
c d d e c f
The editing of this comment corrects the previous version in which the transposition did not take into consideration the flat nature of B's and E's in the original. That correction was made by adding the program line
IF cc$ = "b" OR cc$ = "e" THEN ix = ix - 1
Edited on December 30, 2007, 10:58 pm
Edited on December 30, 2007, 11:20 pm
|
Posted by Charlie
on 2007-12-30 22:53:24 |