(maxmsp) midi poly and audio poly~

As indicated, this is a scaled-down post so that you have the demo patchers from class.

To use the PolyAudioDemo.maxpat you also need to download SimpleSynthKeith~.maxpat and place both patchers in the same folder.


The poly object

The poly object takes incoming noteon and noteoff messages (note number and velocity), tracks them so as to allocate across multiple voices, and makes sure that corresponding noteon and noteoff messages go to the same voice. The incoming note number and velocity messages are tagged and outputted with a voice allocation number. Output = 1 60 127, where 1 is voice number 1 in a polyphonic synth, 60 is the note number for middle C, and 127 is the velocity.

Voice allocated noteon and noteoff messages are sent to a poly~ object that has a synthesizer subpatcher.

poly must specify the number of polyphonic voices to track, and whether to institute voice stealing (non-zero third argument).

The poly~ object

The audio poly~ object requires a patcher that has been designed to accept incoming messages from a parent patcher. It also requires an argument to set the number of polyphonic voices to play, which should correspond to the same number in poly.

Note messages should be sent to a free voice by using the voice allocation number assigned by poly. The message target $1, $2 $3 says to route items 2 and 3 from an incoming list to the voice number (instance of subpatcher) specified as the first item in the list. The formatting of the message is very important — watch out for the comma.

Preset selection messages should go to all instances of the subpatchers (usually), so the message target 0, $1 is used. If the target is 0, the subsequent message is sent to all instances.

The audio subpatcher: SimpleSynthKeith~maxpat

SimpleSynthKeith~.maxpat, and any subpatcher you would load into poly~, must be saved in the either Max’s search path, or saved  in the same folder as the parent patcher. Rookie mistake: trying to load a subpatcher without first saving the parent patcher.

SimpleSynthKeith~ has two gates: one to toggle MIDI input on and off within itself, and one to turn on/off sending of audio output to the dac~. When loaded as a subpatcher of poly~ these gates should be turned off. MIDI input and audio output are handled in the parent patcher. When you open SimpleSynthKeith~ as a standalone patcher, turn on the gates so that you can play and hear the patcher. This feature is useful for trying out different parameters and saving them as presets in SimpleSynth. You can them recall them from the parent patcher.


Leave a Reply