
reference: http://www.seventhstring.com/resources/notefrequencies.html
note: some music has a different "temperment" which use different frequencies.

middle octave (4), last item of line being roundoff used.

C		261.6	262
C#		277.2	277
D		293.7	294

E_		311.1	311
E		329.6	330
F		349.2	349

F#		370.0	370
G		392.0	392
G#		415.3	415

middle-A	440.0 Hz	440
B_		466.2	466
B		493.9	494


First draft of notes.sh below, the current one also has "p" or "r"
for pause/rests, and will append comments found between comment lines.
e.g.

BEGIN=
blah blah... BEGIN= and END= must be at start-of-line to delimit comment.
END=

Songs generated by note files sound awful...
Notes run together, and if you put short gaps between notes
they still sounds awful! The forceful changing of tones
causes an irritating click sound.

----------------------- cut -----------------------------
#!/system/bin/sh

cat "$1" | tr "abcdefghijklmnopqrstuvwxyz" "ABCDEFGHIJKLMNOPQRSTUVWXYZ" |
           sed -ne "/^BEGIN=/,/^END=/p" > "$2"

## sharps first

sed -i -e "s/C#/277/g; s/F#/370/g; s/G#/415/g;" "$2"

## now the flats

sed -i -e "s/E_/311/g; s/B_/466/g;" "$2"

## with sharps/flats out of the way regular notes won't get mixed up

sed -i -e "s/C/262/g; s/D/294/g; s/E/330/g" "$2"
sed -i -e "s/F/349/g; s/G/392/g; s/A/440/g; s/B/494/g" "$2"

echo -e "\n------------------------------------------------------\n" >> "$2"
echo "This file was autogenerated by 'notes.sh' using '$1' as input." >> "$2"
echo -e "\n------------------------------------------------------\n" >> "$2"

cat "$1" | sed -ne "/^COMMENT=/,/^END=/p" >> "$2"

----------------------------- cut ------------------------------------

