(maxmsp) drunk, urn, coll

Class demo patchers are up in iLocker. (w3d3a.maxpat, w3d3b.maxpat, and w3d3c.maxpat) My rounding patchers are also there now.


The drunk object output a random number confined to a given range and step size. The step size argument minus one sets the maximum size of the step. Zero steps are possible with any step size, and are the only possibility if the step size is 0 or 1. Negative step size arguments prevent steps of 0 size.

output = previous_output  +/-  current_random_step

The output cannot be more than the max range.

w3d3a.maxpat demonstrates a simple drunk patcher, where drunk output directly plays MIDI notes. The slider and the table object are included as means of visually tracking the output of drunk.

s and r objects stand for send and receive. Send and receive create internal (invisible) connections for data flow. Send and receive works across all open patcher windows.

w3d3b.maxpat shows the first drunk patcher modified so that drunk generates index numbers to send to the table object. The table object can store any pitch content that you want.

w3d3b also includes a section (on the right) that allows you to play notes in from a MIDI keyboard and store those notes in the table. The large toggle has to on for MIDI notes to be counted and stored. Turning the toggle on resets the counter so that new inputs are always stored starting at location 0 in the table. Drunk range is also set from the counter max (using s and r), so that drunk doesn’t go beyond the number of notes stored in the table for each input. The step size is still left to user control.

w3d3c is extensively commented. The high points include the coll object (a flexible storage object), urn (unrepeating random number), iter (breaks lists into individual messages), tab (a graphic multi-button object like umenu), and key (ascii codes for computer keyboard input).


Leave a Reply