How the patch works - Gazwilde/The-Air-Guitar GitHub Wiki

The patch uses the input from two cameras.

The images are sent into Max with a JIT.Grab. The resolution set to 320 by 420. Using a pviv/input allows for camera selection when using one or more cameras, this allows you to select either web cam 1, 2, or the in built central cam on the Macbook Pro.

The 2 Video screens are split into sections, the right camera has six horizontal sections to represent the six strings of a guitar, with the left camera being split into twelve sections to represent the first twelve fret positions of a guitar.

Once the image has entered the software a sukacam is used to track the required colour. The suck cam analyses all the colours present in the video, pressing on a colour in the video area the suck cam locks into the colour using a swatch. Now as the colour is moved around the camera tracks the colour and turns it into a rectangle.

As these rectangles pass through the horizontal and vertical sections of the screen it triggers a bang which in turn, produces a number.

The right hand produces numbers one to six and the left hand produces numbers ten to one hundred and twenty. both these numbers are then added together.

In final sub patch, each possible number (72 possible combinations) then triggers another bang. In the sub patch each bang position represents a Midi Note number. When the bang occurs it sends the Midi Note number out via a outlet into the Make Note outlet.

The Make Note outlet is set to send IAC driver Midi information. This is then sent to the DAW instrument channel which triggers the midi note and produces the audio from the Midi note.

As the colours pass through different sections of each camera different Midi notes are produced allowing for different sounds to be triggered.