We move now from playing sound files to synthesizing audio using Max objects to create a rich drone sound using combinations of oscillators and noise. We also learn how to construct envelopes and organize our patches using the idea of encapsulation.
Exercise 3: Basic Synthesis
We’re learning how to...
- produce various classic synthetic waveforms;
- combine oscillators with detuning to make a rich sound;
- make white, pink, and band-limited noise;
- construct envelopes; and
- use subpatches to encapsulate chunks of Max code.
A Note About Audio in Max
Let’s consider how audio works in a Max patch window.
It’s helpful to think of Max objects and their patch cords as constituting a kind of network, somewhat like the Ethernet cables that let computers talk to each other. The Max message network comprises the MIDI objects, the abstract numerical and logical objects (scale, random, +), timing objects (metro, tempo), message boxes, and the patch cords that connect all of these. The MSP network comprises all of the interconnected objects that handle audio signals. The two networks can connect to each other, so that Max messages can control audio behavior, and audio signals can become Max messages.
While the Max message network is capable of running at the rate of about one message per millisecond, the MSP network runs exactly at the audio sampling rate, which is often 48000 times per second — 48 times faster than the Max message rate. Another difference between the two networks is that Max objects usually generate messages only when prompted. For example, makenote generates output only when it receives a pitch number in its left inlet. (An exception is metro, which emits bangs at a constant rate until you turn it off.) By contrast, audio flows constantly in the MSP network, even when you pull an audio fader all the way down. And you have to turn the Max audio network on and off explicitly (with the ezdac~ button, for example). Most audio objects have a tilde (~) after their names to suggest that they handle sound waves. Audio patch cords are thick dashed lines, so they look different from regular Max patch cords.
How to Do This Exercise
Working on the assignment is a two-stage process.
- Download Exercise 3 Max Tips. This folder of Max patches introduces you to synthesis using various oscillators. Open them in Max in order, reading the comments, operating, and changing the patches.
- Make a patch that creates a rich, low drone sound, with
multiple detuned oscillators.
Mix a little noise into your sound. Add the ability to envelope the sound to make it start and stop smoothly, without clicks.
Think of a way to encapsulate some of the code in your patch. (The last Max Tips patch explains this concept.)
See the Requirements and Suggestions section below for details. Otherwise, you won’t know some of the specific things we expect you to do in your patch.
Be sure you understand what each of these Max objects does:
- cycle~, saw~, tri~, rect~, sig~
- +~, *~
- noise~, pink~, rand~
- scope~, spectroscope~
- the p object (and the Edit & Encapsulate command)
- inlet, outlet (in subpatches)
Requirements and Suggestions
- Using at least three saw~ or rect~ oscillators, construct a rich sound by mixing the oscillators (adding their outputs together) and detuning all but one of them.
- Provide a single number box that lets us enter a MIDI
pitch that is the focus of the drone produced by all the
oscillators. Convert this pitch to a frequency value using
mtof, then pass that to a sig~ object to
turn it into an audio control signal.
We want a low-pitched drone, so use a low MIDI pitch. This will blend better with the noise we add.
- Compute detuning offsets from the converted frequency, using
+~ (and maybe -~) objects between the
sig~ and the oscillators.
Detuning is most effective when it is a small offset, on the order of 0.1 to 2 Hz.
- Add a little noise using a noise object, or two noise objects for a better stereo image (one for each channel). The pink~ and (especially) the rand~ objects will make the best blend with the low-pitched drone. Reduce the gain of the noise generator(s), scaling the output signal using *~ to make a nice blend with the drone. Try to add a little grit to the sound without the noise standing out too prominently.
- Make the two channels of your drone sound different in some way. You can do this by sending oscillators to different channels. (This is one reason to use lots of oscillators!) The different tuning of the oscillators will make the two channels sound different, creating a stereo effect.
- Create an amplitude envelope that scales the output from
the sum of all your oscillators and noise. Provide a toggle
button or some other control(s) that let us turn the sound
on and off.
If you’re feeling ambitious, arrange for a metro to trigger short notes played by the drone. Just don’t expect the notes to overlap in time — Max is inherently monophonic; you have do something special to make your synthesis algorithm play polyphonically.
- Include a preset object to capture the state of number boxes, live.gain~, etc.
- Be sure you satisfied the requirements listed above.
- Submit your Max patch in Canvas.
This exercise is graded pass/fail. You must submit the exercise by Thursday midnight to be eligible for a pass.
Your patch must
- operate correctly and
- implement the functionality described in the “How To Do This Exercise” section above.