Building Your Own Synthesizer
- Due Apr 30, 2020 by 10am
- Points 20
- Submitting a text entry box, a website url, a media recording, or a file upload
In either Max/MSP or JavaScript/WebAudio, write a program that allows you to play your computer like a synthesizer. The methods of input will be the mouse and keyboard of the computer. [If you have access to a MIDI keyboard controller, you're welcome to use that, but if not, the computer keyboard and mouse will suffice for this assignment.] The output should be the sound of a note played at the desired frequency and loudness.
The first task will be to use some input, most likely a keystroke, to indicate the pitch of the note and trigger the output of the sound, which will most likely be made by one or more oscillators (or possibly prerecorded sound, or some hybrid of the two). Your synthesizer need only be able to play one note at a time, but you will probably want different keys to correspond to different pitches, the way that keys on a music keyboard do.
Since your computer keyboard doesn't report how hard you typed the key, the way that a velocity-sensitive MIDI keyboard would do, you'll need to use some other way to indicate how loud the note should be.
There will need to be some way to make a note stop. (In MIDI, the keyboard would send a note-off message, or a note-on message with 0 velocity, when the key is released.)
That's a description of a very minimal synthesizer; it's too simple to be of much interest, but it's at least playable. It allows you to trigger a note with the desired pitch, and then stop it. The basic method of how to do this, in either Max or JavaScript, is already provided for you in the lessons. However, we expect you to go beyond that, to make your synthesizer better. So, once you've got the minimal program working, do some of the following improvements. Your goal is to make your instrument as "musical" and "interesting" sounding as possible.
1. Instead of turning the oscillator on or off instantaneously, you probably want the amplitude of the sound to change gradually over the course of a note. Consider imposing an ADSR envelope, or similar shape, upon the amplitude of the sound.
2. Most good synthesizers can play notes over a pitch range of several octaves. You might want to consider how to do octave transpositions of notes, so you can play a given note in any of several different registers (octaves).
3. A sine wave is the simplest timbre. You might want to use some other waveform, e.g. triangle, square, or sawtooth, to get a richer sound. How else can you create a more interesting timbre? You might consider using two oscillators, tuned slightly apart, to create a slight dissonance, or...
4. In demonstrations you've seen how an LFO can be used to create pitch fluctuation (vibrato, by means of frequency modulation), or loudness fluctuations (tremolo, by means of amplitude modulation), or other sorts of change. You might choose to implement those in your sound generator.
5. An alternative way to influence the sound could be by using the mouse (or trackpad) location to change some parameter of the synth.
6. A filter can shape the timbre of the sound. If the filter changes over time, it will make the timbre more interesting.
7. If you have access to a MIDI controller (a small MIDI keyboard, for example), you're welcome to experiment with using MIDI as your input.
8. You're very welcome to try to implement any other way you can think of to make your sound more interesting, lively, and attractive.
Please submit all necessary files (.maxpat files, or .html and .js files), compressed as a .zip archive, in the Canvas dropbox associated with this assignment. Come to class prepared to demonstrate your synthesizer, playing something that shows off its capabilities. Or, if you have the time, make a very short screen capture video of you playing your synthesizer, and upload it with your assignment (and/or to YouTube or your own website).