Max/MSP Patch

The final step in integrating all the parts together is the Max/MSP patch that interprets the data from the box, plays the sounds and activates the LEDs.

This is the front end of the patch which contains the graphical user interface for the maxuino object. From here the mode for each pin can be set (digital I/O, analogue in, PWM, etc.). A subpatch has been created so that by simply pressing the button near the top left will set the correct pin modes for the purpose of my project. In the centre at the top is a Umenu object; when the relevant song is selected it activates certain subpatches so that the right samples, lighting system and bpm are selected. To the upper right are the sample and lighting subpatches which contain audio material and lighting sequences for each song.

Frontend

This is a look inside the sub patch which sets the correct pin mode:

inputselect

This sub patch translates a BPM value into milliseconds which is used for both the delay effect utilised by the Leap Motion and the lighting systems:

bpm

This sub patch details how when the buttons are pressed the values are routed to select certain samples:

routeThis sub patch demonstrates how each sample is turned on and off. As the digital pins (the buttons on the controllers) are constantly streaming data, a switch has to be employed so that when a ‘1’ is received (meaning that a button has been pressed) it immediately switches off the flow of data for 400 milliseconds so that no more ‘1’s are received. If this system is not set up and a toggle is simply used the sample switches on multiple times when the button is pressed. It also shows how audio is transmitted to lighting patches that require audio data to light the LEDs.

buttonNext is the sub patch that deals with LEDs that turn on and off in a random sequence. At first the ‘random’ object was used but this yielded results that were too unpredictable; for example a light could switch itself on and off multiple times due to the fact the values are random. By using the ‘urn’ object it generates a sequence of numbers that, while random, are non repeating.

arpeggio

Next is a sub patch that translates the audio volume of a sample into a value that the maxuino object can interpret and fade an LED in accordance. By using the ‘function’ object you can create custom ramps so that if for example a sample is too quiet you can have the LED be fully bright (a value of 1) if the volume only ever reaches 0.5.

audio

Finally is the delay/filter sub patch that interprets data from the Leap Motion controller into an effect. The two effects can be engaged separately or together and the length of the delay (which is in time with the bpm) may be selected for each channel independently. The values from the Leap Motion (such as palm rotation, hand position in x/y/z space) are scaled and used to create a dry/wet signal with regards to the delay or cut-off frequency for the filter.

leap

Leave a comment