This page defines Project 1. The project is due Monday, November 2 at 11:59pm *revised*. Details on how to turn in the project will follow. The project is a group project. Groups of five will be assigned.
I've added a Questions page with many answers to past questions. I've also added past questions to some component pages.
I will not fear . Fear is the mind
killer.
Fear is the little death that brings total Oblivion.
I will permit my fear to pass over me and through me.
And where it has gone, I will turn the inner eye.
Nothing will be there, only I will remain.
Dune by Frank
Herbert
You are to create a music synthesizer program. This is an off-line program that will generate output as an audio file. Your final result will include the production of a one minute musical selection that demonstrates the functionality of your system.
The program will consist of five distinct components and a sequencer. The components are:
If your group has less than five members, you will create fewer synthesis components. As an example, a group with four members would do three synthesis components and one effects component. The component options are:
Each group member will be considered to "own" one component. Two group members can choose to do wavetable synthesis subject to the rules on that page. All other instruments must be the only one implemented by the group. The group member who owns the component is the developer of that component. Your group must early on decide on a structure that will make it easy to combine the components into a system.
Project requirements are subject to modification on request if you think you have a better idea for some component. Contact the instructor early if you want to request a requirement modification.
Your system structure should be something like this:

Your program accepts as input an XML "score file". This is a file that tells your program what audio to play when in order to make music. This should be loaded into the sequencer, which is responsible for telling each synthesis component when to make sound and for how long. In addition, this component may tell the components other information about their sound generation, such as sound modifiers. You are welcome to load additional files as necessary to configure your system, but the score file must completely define the music you will be playing.
Each synthesis component will accept orders from the sequencer and generate a stream of audio samples. You are creating a "streaming" application, one that generates the samples on-the-fly one at a time. Notice: It is an absolute requirement that the output of each component be a stream of audio samples. You may not create a large array in memory for your audio selection. Your program must "stream" the audio. Example: one minute of audio would require 5,292,000 frames of audio. You could allocate an array that big and add in each part one at a time. Writing your solution this way is not acceptable and will not be accepted as a solution.
Step 5 sets up a structure for the project that meets all of these requirements.
The effects component accepts audio from the synthesis components, mixes them together, and applies any audio effects.
The entire group is responsible for the creation of the sequencer and a structure for moving audio around within the program. I highly recommend creating a superclass for the synthesis components and for the effects component, then initially getting your program going with simple sine-wave generators as in Step 5.
Some elements will be common among the components. As an example, most components will require some method for envelope generation. You are welcome to share code among your synthesis components, and I encourage you to do so. If you wish to move functionality out of the components and into the system, that is fine, but clearly describe what you did in the web page.
We will discuss many techniques in class, but your group will also have to do research on how to implement these features. Try to anticipate the problems you don't know how to solve and attack them as a group.
1) You are required to produce a musical selection of at least one minute and no more than 1.5 minutes duration (I will consider longer durations on request). The result should be at 44,100 samples per second, 16 bit stereo. Note that this will generate 10MB per minute. Selections should be recognizable by others in the class as "music", though it need not be conventional.
2) You will produce a shorter piece (10-15 seconds) for each system component that demonstrates that component. For the synthesis components, the piece should include audio generated by that component only. This piece must demonstrate the grading rubric elements you have supported. For the effects component, the audio should be generated by one synthesis component. A group with five members will turn in five demonstration pieces.
3) Turn in a link to a web site that details the following:
You will also turn in your program, which we will check only to ensure it obeys the "streaming" criteria.
We will be posting the audio files (in MP3 format) and these pages for all the world to see.
50 points of the grade will be an individual grade assigned to the component. The pages for each component include grading criteria for each component.
The remaining points will be based on the following rubric. You must achieve all elements of each level to earn the available points:
The final 10 points requires that your program include an auditioning capability. This is a way that you can play the instruments via the user interface in your program. You need a way to play any possible note on any of the instruments by hitting a button or other location on the screen. You can draw something that looks like a keyboard or you can have a box to enter note names into. It should not crash, even if bad data is entered. A way to audition the capabilities of the effect is also required.
This section contains some suggestions. There are lots of them, but please take them as suggestions! You don't have to do any of them. Above all, try to be creative in this endeavor.
You can use whatever you want for score files, so long as it is an XML format, though starting with the Step 5 format is likely the easiest.. However, I have some suggestions you might consider. Consider some method that avoids putting absolute measure numbers in. It makes it much easier to repeat a phrase if you can just past it in without changing measure 7 to measure 8 for every line. Consider lots of rhythm, since it's easy to put that type of thing into a loop (but please don't repeat the same 2 bar pattern for one minute. Ravel you are probably not!). Some people may prefer to have a program write their score file automatically.
Consider having an extra file associated with a sample (sample1.wav and sample1.info for example) that tells where loop points might be, what the pitch is (if you know), etc. Avoid abrupt starts and ends on samples, they tend to cause clicks. Explore playing things in reverse, you'll be surprised at what you hear (please don't follow any instructions you may find). Explore playing things too fast or too slow. Try to have a note associated with all samples if possible by determining the period of its waveform.
Consider playing with your samples in AudioProcess. You can do interesting things with them now and we're going to learn more interesting things in the coming weeks. Try turning a sample up till it clips, then turning it back down. Try several short echos. Try adding various short delays to a sample. Try writing a program that varies the delay.
Create a class called CWave that you completely load a sample into. Load all of these when your program starts. Then any object that plays the wave file will be passed a pointer to the CWave object that contains the data.
Create a class such as CSample that you can instantiate to play back a sample are various rates. Consider adding basic features for vibrato, channel placement, panning, etc. to that class. Load all of your audio samples in up front into object and provide links to those objects. This will be much faster than continuously reading them from disk. You may find that it takes 20 minutes to build your 1 minute selection if you don't do something efficient on audio waveform management.
Sequencing is the determination of when notes are turned on and off in your output file. Basically, you are going to read a score and use that to produce a "sequence" that is your musical selection. Don't be constrained to simply indicating when notes are turned on and/or off! Consider algorithmic ideas. As an example, my score might indicate that a drum-like sound is to be played in some pattern repeatedly for a certain amount of time. What if you have several complex rhythms at the same time?
I hate to make any suggestions here, since you may take me up on them and that would probably be boring.
Above all, have fun with this project. Get something up and going that makes noise as quickly as you can, then start fine tuning it.