Max Building Blocks (b.blocks) is a library of objects for the Max programming environment, dedicated to the prototyping of interactive multimedia systems.These objects are a set of around 30+ modules that provide a number of very common procedures for interactive systems, addressing image tracking and analysis, external controllers, video and sound.It was developed in 2009 as part of my Multimedia Masters thesis at the University of Porto (UP).

Download current version: 13.04.15.zip

see b.blocks on Cycling74 website:



The main idea behind b.blocks is the simplification of patch building and organization in the development of interactive multimedia systems in Max.
By creating a higher level structure, having pre-programmed, yet flexible, modules that address a number of commonly used functions, two main issues can be addressed:
– the difficulty and time and it takes to develop a patch can be greatly reduced when working with processes which are contemplated in b.blocks.
– the clutter of the patchcords and objects are greatly reduced, by eliminating the need of adding and connecting interface objects and messages for basic functions, which are already in the b.blocks graphic user interfaces.

Max addresses the use of multiple instantiation and encapsulated blocks of code with the use of externals, which are external patches programmed in C that show up in Max as normal object boxes, and abstractions, which are actual max patches, instantiated in other patches by the use of the patcher (p) object box, or the bpatcher object, which works like the patcher object, but creates a “window” that allows to see the subpatcher’s contents.

The b.blocks library are abstractions, meaning that each module is a max patcher, built with an interface designed to be instantiated inside bpatcher objects.



The b.blocks modules show up in Max inside b.patchers, as little grey boxes. Each one has its own interface, comprising a header region in the upper part and the body region, in the lower part.

In the header, the name of the module is displayed in the left. All b.blocks modules names start with “b.”.On the right, the button “h“ opens the help file for the module.:

The body region comprises all the specific user interface elements needed to use each module’s main features.

Using b.blocks in a new patcher
There are at least three ways to correctly instantiate a b.block module:
-create a bpatcher object, open it’s information window and use the patcher file field to write or select the b.block. Then write the apropriate scriptname;

  • creating a new object box with the b.block name (as an abstraction), then alt+clicking on it to open the corresponding help file, to copy-paste;
  • copy-pasting from one of the overview patches.

Alternatively, they can be used as regular abstractions, inside regular object boxes (the GUI can be acessed inside it’s object box.)


The b.blocks library objects are divided so far into four sets:

– b.brcosa: a simple wrapper for the jit.brcosa object;
– b.centroid: a wrapper for the cv.jit lib cv.jit.centroids object;
– b.chromakey: chromakey with the jit.chromakey object;
– b.colortrack: color filtering and tracking based on the jit.findbounds object;
– b.crop: crops an input matrix;
– b.features: image feature extraction. Outputs the cv.jit.features object data in a list format;
– b.framediff: outputs only the differences between sucessive frames (frame   subtraction);
– b.grab: a wrapper for the jit.grab object, with mirror and black and white function;
– b.hotspots: area collision detection for up to eight areas;
– b.movie: movie player based on the jit.movie object;
– b.negative: inverts the color of an input matrix;
– b.presence: background subtraction with auto-adaptation function;
– b.videomixer: a variable operator mixer for two video sources.
– b.window: a wrapper for the jit.window object.

– b.analyzer~: a wrapper for the analyzer~ object by Tristan Jehan
– b.brickwall~: an fft brickwall filter;
b.envelope~: an envelope generator with audio and control outputs;
b.freqsplit~: an fft frequency splitter with up to 3 splitpoints;
b.gain~: 2 channels linked or independent gain control;
b.oscillator~: an oscillator module with four basic waveforms;
b.pan~: a simple 2 channel panner knob interface;
b.play~: a soundfile player with waveform display and mouse selection;
b.ringmod~: ring modulator~;
b.transposer~: audio transposer based on the transposer Max example patch;

These objects are intended for the communication with external hardware and software.
b.hi: a simple wrapper for the hi (human interface) max object;
b.midiin: midi events sender;
b.midiout: midi event receiver;
b.wacom: wrapper for the wacom object by Jean-Michel Couturier (CNMAT);
b.wiiremote: communicates with Nintendo’s Wii controller using the Osculator software;
– b.kinect: grabs the input of the Kinect sensor using jit.freenect.grab object by Jean-Marc Pelletier

These objects include modules that are common to the whole library or not related to any specific area. The files inside the Kernel folder are not refered here.
– b.presets: preset manager with the pattr object family.




NOTE 1: The b.blocks library is by no means finished nor closed. It is under development and the documentation and some of the help files are incomplete. Any comments, suggestions or help are welcome.

NOTE 2: While most modules were programmed using only the Max/MSP/Jitter native objects, some modules use external libraries. The b.features module, for example, uses the cv.jit.features, of the (free) cv.jit library by Jean-Marc Pelletier.



email: ruidias74@gmail.com