Thursday, June 3, 2010

Saxomophoooooone....saxomophooooone...



Large version.

I've been playing with the microphone. This is the "rough" version of what I want to do, and I expect the final to be quite different. So, enjoy! Make sure you have your microphone on - Otherwise, this would be rather boring...

What we're doing here is having Flash interface with a microphone connected to the computer - it listens at the framerate (in this case, 31 frames per second) for external sounds. If it detects anything, it reads back a value greater than 0. By the way, -1 seems to be an inactive microphone, 0 is detecting no sound, and 1-100 is the sound level detected.

Every frame, if we DO hear a sound, a circle is added to the stage which fades at a rapid rate, leaving a glowing impression on a BitmapData field. Adding a little more to it, louder sounds (which return larger activityLevel values) will generate larger circles. If the sound is over 1, we also swap out the color of the glows.

So enjoy! Remember - turn your mic on!

1 comment:

  1. Cool idea, I wish I had a microphone to test this out with.

    ReplyDelete