CS285 -- Lab 3: Guitar Simulator

Winter 2004
Objectives Addressed
Requirements

You are to write program with a command line interface that will generate .wav files. The command line options are as follows:

Details

I would suggest making use of the utility classes developed by Dr. Fred DePiero for reading and writing .wav files and refined by Dr. Eric Durant. An example of how to use the classes is 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 must create a Note class that describes each guitar pluck.

Jaffe-Smith Algorithm

Information 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.

Just for fun (optional)

Here is a sample waveform produced by one team from a previous quarter that got a bit carried away on this assignment. Knock yourselves out (but make sure you do the base requirements first).

Lab report (due 11:00pm, the day prior to week 5 lab)

Here is a template file to use as a starting point for this report.

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 XML help video and/or 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.

Acknowledgment

This 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.

Last Updated: Friday, 02-Jan-2015 10:08:18 EST