I545/N564/N364 Simple Musical Sound Processing

Don Byrd, rev. 23 Feb. 2008

In doing this assignment, you might find it helpful to look at the CombineWaves example program, or even use it as the basis for your program.

Using the mono piano A4 note from our recorded musical instrument samples, write an R program to: (1) multiply all the samples by -1; (2) make a sound consisting of five copies of the first 100 milliseconds; (3) make a sound consisting of every third sample; and (4) make a sound with two overlapping copies of the entire note, the second starting 50 millisec. after the first. (Hint: at 44,100 samples per second, there are 44.1 samples per millisec. How many samples does it take to last 50 milliseconds?) Write a brief description of what each sounds like. Also make and print out a graph of #3 with the plot() command.

CompSci/Informatics majors: In addition to the above, add to your program code that tries to find the offset between the two copies that produces the most destructive interference. Use autocorrelation (R's acf function) or anything else you want.