I finally got the composition together, and recorded a video of the thing in action.
The video starts with the fireflies calibrating themselves to a dark room. Then they start blinking randomly and find a common rythm quite quickly. When I flick the lights on, they become confused (red flashes) because they are “used” to a darker ambient light level. Finally darkness falls upon the room again and the flies synchronize, this time with a quite nice melody.
After the episode with color tracking patches, I started working on a composition that would take video input from a webcam and detect flashes of light at certain predefined points in the picture. I wanted a different midi note to be assigned to each of the points. So that when a flash is detected the associated midi note would be sent out to a synth or sampler.
The only problem is that the midi patches that ship with QC are pretty lame, and didn’t allow me to do what I wanted. After searching around for a bit, I found the kineme project. Their midi patches are apparently quite beta, and you have to register on the site to be able to access them. I actually had to try a few different builds before I found one version where the Global Output Midi Note -patch wasn’t broken. Be sure to put the files in the right folder; the midi patches go in /Library/Graphics/Quartz Composer Patches, not -Plug-Ins.
When registered, the midi patches can be found through the link below: