這是柏克萊大學 CNMAT 中心針對 max/msp 的使用教學文檔。
轉貼自 Peter Elsea 的 Max/MSP 教學文章片段。
Basic MSP Synthesis
Synthesis in MSP
Synthesis in MSP is similar to the use of the old modular synthesizers (or their on screen emulators, like Tassman.) We have an assortment of primitive functions that we must assemble to generate the sounds we want. MSP is not as advanced as the hard core computer music programs like Csound and ChucK, but the list of available functions is being augmented all the time.
Any modular synthesis scheme divides objects into three basic operation: generation, processing and control, and these are available in standard MSP objects. (Advanced techniques like granular synthesis and modeling are possible with third party external objects.)
Sound Generators
Oscillators
The cycle~ object is the basic oscillator. When audio is on it puts out a sine wave at he indicated frequency.
Phasor~
Phasor~ is the most primitive oscillator. Every digital oscillator is based on looking up values in a wave table , which is simply a chunk of memory containing a recording of one cycle of the waveform. To get different pitches, some math is required to step across entries of the wave table. The phasor~ is the object that does that math. What goes into phasor~ is a float (or signal) with the frequency. What comes out is a signal going from 0.0 to 1.0 that some other objects can convert into a wave.
Cos~ produces a cosine wave, triangle~ produces a triangle wave, and wave~ can have anything you want. Notice that listening to the phasor~ itself gives a sawtooth. The downside of listening to phasor~ (and to some extent triangle~) is that the sharp corners of the waveform imply harmonic content above the sampling rate. This produces aliasing.
Band Limited oscillators
To get away from the aliased sound, the objects saw~, rect~ and tri~ have waveforms that do not have Nyquist limit problems. They sound just like they ought to.
If you use these with phasor~, connect to the right inlet. The left inlet controls frequency like cycle~. Rect~ and tri~ have a center inlet for duty cycle.
Noise
The noise~ and pink~ objects are a constant source of white and pink noise.
White noise has equal power per Hz (on average) so, given that we hear in octaves and the top octave of our hearing has as many Hz as all the rest put together, we hear white noise as a high, hissy sound. Pink noise has equal power per octave, so we should hear something better balanced. Because math and our ears don't quite match, pink noise is usually heard as bass heavy.
Signal Processors
Amplitude
All of the MSP generators produce signals that swing from –1.0 to 1.0. This amplitude is easily adjusted by a *~ object. This multiplies every sample value by the argument.
An argument of 0 shuts the signal off. A float or signal applied to the right inlet will adjust the signal level. You can use a dbtoa object to calculate the appropriate multiplier for a desired dB change.
You don't need to remember 20logA/B anymore, but you do need to remember that a negative dB value specifies a reduction in gain.
A Taste of Filters
MSP 2 features several nice filters. The most useful is probably lores~, which is a lowpass filter similar to those found on our modular machines. You will also find svf~ very familiar. This is a state variable filter, the circuit that gives simultaneous high, low bandpass and notch functions.
My favorite filter is the fast fixed filter bank, the fffb~. This gives the sound of the old 1/3rd octave filter. Here's a patch that shows how to control the band amplitudes with multislider.
The arguments set the number of filters, the frequency of the first filter, the frequency ratio (here it's the cube root of 2), and the Q of the filters. Each filter has its own output, which you can sum as shown or use for independent processing. (The 2thru subpatch merely holds the outputs together so I don't have to draw 24 connections if I change the filter destination.)
There's a thorough discussion of the MSP filters in the essay MSP Filters.
Wave shaping
The phasor~ can use wave~ to play a buffer~ containing an arbitrary waveform. You can draw a simple shape into a buffer~ with this mechanism:
The drawing area is a multislider with 256 sliders. The peek~ object addresses a buffer~ as if it were a table, so ltotab will format the output of the multislider to fill the buffer.
With only 256 points in the waveform the sound will be a bit edgy. There are techniques available in jitter to support bigger tables, but that is seldom necessary. Drawing waveforms is a good source of interesting sounds, but wave~ is also a powerful processing tool. If we modify the output of cycle~ so that its output range is within 0 to1 we can use the shape drawn in the buffer to distort the output wave.
I've found it's best not to use the end values of the buffer, so multiplying by 0.49 and adding 0.5 works well. Figure 14 illustrates the effect. If the shape is a straight line nothing happens, except a slight change in amplitude.
If the shape is not straight, the wave is bent. In the middle drawing, all but the highest values of the cycle~ are unaffected, but at the right of the graph surprising low values are returned, giving a glitch similar to the old Moog oscillators. Messier shapes produce wild distortion. You can apply this process to any signal, not just sine waves.