MUS271A (Max w1) – starting point

The focus in 271A will be sound generation with Max/MSP. In the first two weeks I will go over any concepts people are unfamiliar with, so there will be less standard material. However, here are some patches we will use as a jumping off point. The patches can be downloaded here 00-maxbasics.  I have also created a (somewhat similar) PD version of these examples, download here: 00-pdbasics.


Screen Shot 2018-03-15 at 3.10.30 PMHere is a patch showing a square -saw oscillator as an abstraction (a patch which shows up as an object within Max). Frequency is converted from MIDI note number with mtof, The toggle button selects the square or saw wave (this is not a true saw wave). live.gain~ is used as an output volume control and meter. ezdac~ is used to send the audio to the computer sound output. Finally scope~ is used to display the waveform. We will look at how to modify the scope~ display using the info panel (clicking the “i” in the right column.Screen Shot 2018-03-15 at 3.11.49 PM

The 02-squaresaw patch makes up the abstraction. The inlets and outlet are labelled “1”, “2” on the top and “1” on the bottom. Both signals and messages can pass through these ports. The rest of the patch is a simple combination of a rect~ generator and a cycle~ generator (making square and sine waves).


Screen Shot 2018-03-15 at 3.24.12 PMThis next patch shows the many MIDI messages and the objects which receive them. The simplest is probably bendin which receives pitch bend information. Pitch bend has a range from -64 to 63, with 0 in the center. I am dividing the lower range by 64 and the upper range by 63 so that bend up and down are symmetrical.

ctlin receives all other MIDI controllers (knobs, switches, sliders, pedals). The value (0-127) comes out the left outlet, and reflects the control parameter value. The center outlet is the controller number (also 0-127). Finally the right outlet is the MIDI channel. This allows a keyboard or other MIDI device to target 16 different MIDI destinations (typically different synthesizers).

notein receives both note down and note up messages. The left outlet is the note number (0-127, C4 = 60), the center outlet is the velocity or pressure (0-127), and again the right outlet is the MIDI channel. A velocity of 0 indicates a note up or release.

In this patch I am using poly to pack a voice number with the MIDI note and velocity. This voice number is used by route to direct the note and velocity to one of three sound generators. The outputs of the sound generators are all sent to “sum” with send~ and receive~.

Another patch in the class one zip archive shows how to use the computer keyboard to generate “note” messages.


Screen Shot 2018-03-15 at 3.47.26 PMThis patch is a simple use of metro. A BPM value is converted into milliseconds per beat by dividing 60000 by the BPM. metro then sends “bang” messages to two messages which control the amplitude and frequency of a sine wave (cycle~), which gives a sort of kick drum sound.


Screen Shot 2018-03-15 at 3.52.13 PMThis patch uses qlist as a sequencer.It will be explained more throughly in class. When metro is started, the time is incremented 10 ms at a time by counter. This time is used whenever one of the note messages (56, 55, 59, 58) is clicked. This information is collated into an append message and recorded by the qlist. A “bang” message causes the qlist to replay the note messages and send them to the simple synthesizer voice. qlist restarts playback after finishing by triggering another “bang” at the end.