PlayThatTune4 - Working with Files and Audio

Develop a Java program that uses the StdAudioOut to play music from text files with note and duration information modified with harmonics. There are two file representations of the note and duration data. One has int / double pairs representing pitch and duration respectively with 0 being the pitch of concert A (440 hz.) The other file representation has Alpha in the file name and uses a String / double pair representing pitch and duration respectively with A being the pitch of concert A. This contrived alpha convention for reprsenting change in octave uses preceeding - or + signs. One sign for each octave, - for lower frequencies and + for higher frequencies -see the table below.  Work to be submitted in Blackboard.

Requirements for the program

Program Design

Your program consists of two classes:

The PlayThatTune class

This class must contain methods with the following signatures:

The StdAudioOut class

This class is a reduced version of StdAudio. In its reduced format, this class only plays music when the play method is invoked.

A table of calculated frequencies based on concert A = 0

frequency = 440*Math.pow(2, i / 12)
i note frequency
-48 ----A 27.50
-47 ----A# Bb 29.14
-46 ----B 30.87
-45 ----C 32.70
-44 ----C# Db 34.65
-43 ----D 36.71
-42 ----D# Eb 38.89
-41 ----E 41.20
-40 ----F 43.65
-39 ----F# Gb 46.25
-38 ----G 49.00
-37 ----G# Ab 51.91
-36 ---A 55.00
-35 ---A# Bb 58.27
-34 ---B 61.74
-33 ---C 65.41
-32 ---C# Db 69.30
-31 ---D 73.42
-30 ---D# Eb 77.78
-29 ---E 82.41
-28 ---F 87.31
-27 ---F# Gb 92.50
-26 ---G 98.00
-25 ---G# Ab 103.83
-24 --A 110.00
-23 --A# Bb 116.54
-22 --B 123.47
-21 --C 130.81
-20 --C# Db 138.59
-19 --D 146.83
-18 --D# Eb 155.56
-17 --E 164.81
-16 --F 174.61
-15 --F# Gb 185.00
-14 --G 196.00
-13 --G# Ab 207.65
-12 -A 220.00
-11 -A# Bb 233.08
-10 -B 246.94
-9 -C 261.63
-8 -C# Db 277.18
-7 -D 293.66
-6 -D# Eb 311.13
-5 -E 329.63
-4 -F 349.23
-3 -F# Gb 369.99
-2 -G 392.00
-1 -G# Ab 415.30
0 A 440.00
1 A# Bb 466.16
2 B 493.88
3 C 523.25
4 C# Db 554.37
5 D 587.33
6 D# Eb 622.25
7 E 659.26
8 F 698.46
9 F# Gb 739.99
10 G 783.99
11 G# Ab 830.61
12 +A 880.00
13 +A# Bb 932.33
14 +B 987.77
15 +C 1046.50
16 +C# Db 1108.73
17 +D 1174.66
18 +D# Eb 1244.51
19 +E 1318.51
20 +F 1396.91
21 +F# Gb 1479.98
22 +G 1567.98
23 +G# Ab 1661.22
24 ++A 1760.00
25 ++A# Bb 1864.66
26 ++B 1975.53
27 ++C 2093.00
28 ++C# Db 2217.46
29 ++D 2349.32
30 ++D# Eb 2489.02
31 ++E 2637.02
32 ++F 2793.83
33 ++F# Gb 2959.96
34 ++G 3135.96
35 ++G# Ab 3322.44
36 +++A 3520.00
37 +++A# Bb 3729.31
38 +++B 3951.07
39 +++C 4186.01
40 +++C# Db 4434.92
41 +++D 4698.64
42 +++D# Eb 4978.03
43 +++E 5274.04
44 +++F 5587.65
45 +++F# Gb 5919.91
46 +++G 6271.93
47 +++G# Ab 6644.88
48 ++++A 7040.00
49 ++++A# Bb 7458.62
50 ++++B 7902.13
51 ++++C 8372.02
52 ++++C# Db 8869.84
53 ++++D 9397.27
54 ++++D# Eb 9956.06
55 ++++E 10548.08
56 ++++F 11175.30
57 ++++F# Gb 11839.82
58 ++++G 12543.85
59 ++++G# Ab 13289.75
60 +++++A 14080.00
61 +++++A# Bb 14917.24
62 +++++B 15804.27
63 +++++C 16744.04
64 +++++C# Db 17739.69
65 +++++D 18794.55
66 +++++D# Eb 19912.13
67 +++++E 21096.16
68 +++++F 22350.61
69 +++++F# Gb 23679.64
70 +++++G 25087.71
71 +++++G# Ab 26579.50
72 ++++++A 28160.00