For my second project, I was inspired by the idea of using color as a means of producing music (or, at least, the illusion of music). Videos like Colored Virtual Piano (https://www.youtube.com/watch?v=8FcexZUTITc) encouraged me to examine the possibility of creating a program that could analyze the colors in front of it and create a soundscape based upon what it could interpret.
Originally, my plan was to create a functioning keyboard, where each note was associated with a single point on a grid, and the placement of a color would reproduce that note. However, while working on the project and discovering that MAX had the tendency to read all colors before it, rather than simply isolating colors in live feeds, I was inspired to alter my program to allow for a shifting soundscape, where moving colors produced a sequence of notes and chords based on horizontal position and variety of color.
As such, I was fortunate enough to discover a patcher designed by Matt Westerwick which could associate a table’s output with a distinct chord or piano note. With this asset, I could design the program to detect one of three colors (RGB), assign its position in the video to a set of coordinates which would be assigned to a unique position in a table, and then translate the tabular position to a shifting series of notes based on horizontal position.
The project heavily employs the findbounds function to detect (and then pack into a table) the coordinates of the colors (as mentioned above) relative to the left, right, top, and bottom of the video input. When experimentation proved that stagnant colors would quickly create unpleasant loops of sound, the change function was employed in order to filter out repetitions of input from said stagnant colors.
Upon final review of the project, I wish I had discovered a means of more clearly differentiating the sound output between Red and Blue; I wished for them both to be piano-based outputs, but sometimes this caused the sound output to lack unique qualities when comparing the colors. However, the soundscape is still an interesting canvas to explore with this project, and I am quite satisfied with the final result.
An screenshot of the project’s primary code is below, and the link to the google drive is as follows: https://drive.google.com/drive/u/1/folders/1L8qZdDVdyAyvA-vile3aCzIXV5FNDoZ5.