| CS285 -- Lab 3: Guitar Simulator |
|
|
Objectives Addressed
AcknowledgementThis assignment, inspired by a similar assignment by Timothy Snyder, was developed by Dr. Chris Taylor and is based on the Jaffe-Smith algorithm. (See D.A. Jaffe and J.O. Smith in: "Extensions of the Karplus-Strong Plucked-string Algorithm," Computer Music Journal, 7(2), 1983, pp. 56-67. RequirementsYou are to write program with a command line interface that will generate .wav files. The command line options are as follows:
DetailsI would suggest making use of the utility classes developed by Dr. Fred DePiero for reading and writing .wav files. The classes and an example of how to use them are available from my examples webpage. In your implementation of the -rev option, you are required to make use of the STL stack class. In your implementation of the -pluck option, you are required to make use of the STL queue class. The Jaffe-Smith algorithm is described below. You may want to play with the -rev option on these two files: ominous.wav and cinema.wav. Jaffe-Smith AlgorithmInformation on the Jaffe-Smith algorithm (which is based on the Karplus-Strong algorithm) is available here. Here is pseudocode for the algorithm:
enqueue N random numbers between -1.0 and 1.0 into que1
enqueue one 0.0 into que2
repeat the following M times:
{
data1 = que1.dequeue(); // Notice that this is not the correct
data2 = que2.dequeue(); // function call for the std::queue class
sample = decrate * (data1 + data2) * 0.5;
que1.enqueue(sample);
que2.enqueue(data1);
write 32000*sample to .wav file (assuming 16 bit data)
}
where N = samprate/frequency and M = length*samprate. Lab report (due 11:00pm, the day prior to week 6 lab)Your report should include:
As with any report you submit, correct spelling and grammar are required. In addition, your report should be submitted electronically following the Electronic submission guidelines. (You may wish to consult the sample report before submitting your report.) Be sure to keep copies of all your files, in case something gets lost. It may be wise to keep a diskette backup as well. Your grade will depend on quality of design, clarity of code and documentation, as well as whether your program produces the correct results. If you have any questions, consult your instructor. |
| © 2001-2002 Dr. Christopher C. Taylor | Office: CC-27C | Phone: 277-7339 | Last Updated: Tue Oct 8 11:27:33 2002 |
| I am responsible for all content posted on these pages; MSOE is welcome to share these opinions but may not want to. | |||