Sunday, December 28, 2008

GrooveFlakes


I'm a big fan of SomaFM. In particular, their Groove Salad radio station. I'd been wanting to learn how to integrate audio into my Processing sketches via the Minim library. Originally, when I'd started my 'Perlin Particle' sketches (see three previous posts), they were spun out of the idea of making falling snowflakes. I wanted to have the snowflakes to "move" through the air with some randomness, and that's where the Perlin noise fit in. Once I solved that, I was able to move back to my snowflakes, and in particular, audio processing.

I got my "GrooveFlakes" sketch up and running. It streams in the GrooveSalad playlist, and samples the beats. When the kick, snare, or hat hits, the flakes will "pulse" to the music.
You can get the source, over on my Processing Wiki HERE. I still don't have a web site where I can upload the actual app yet... (lazy... maybe next year...).

Monday, December 22, 2008

Image Particle Path 01

Adblock
Adblock

imageParticlePath_movie1
Originally uploaded by warpcat
This code is modification of my Perlin Particle 02 sketch.
In perlinParticle02, it would generate three random images based on Perlin noise,and those three images would control the x, y, and speed of the particles. This version, doesn't use Perlin noise at all, but an image placed in the sketch folder.
When a particle is born, it grabs the color of the underlying image, then travels based on the RGB image data.
The first 10 seconds of the movie show the particle motion, and the last 10 seconds show the particle motion plus the source image (of my wonderful, and tolerant wife)
Source code can be found on my Processing Wiki HERE.
Other Processing imagery\videos on Flickr

Perlin Particle 03

Adblock
Adblock

perlinParticle03_movie01
Originally uploaded by warpcat
An update to my Perlin Particle 02 code: Now, rather than generating three buffer images for the x, y, and speed Perlin values, it calculates them on the fly. This has the added advantage of being able to animate time, which you can see in the above movie. However, it's also exponentially slower. This movie took about a second a frame, or ten minutes on my 5 year old laptop.
Find source code on my Processing Wiki HERE.
My other Processing imagery\video on Flickr

Sunday, December 21, 2008

Perlin Particle 02

Adblock
Adblock

perlinParticle02_movie04
Originally uploaded by warpcat
It's been a while since I've been in Processing, but it's good to be back. Lately, most of my time has been taken up learning the Harmonica ;)

I started out trying to make a particle system to render snow falling. And I actually had pretty good results (post on that later). But in the process I wanted to add a bit of "randomness" to the snowflakes, so I started investigating Perlin noise.

In this linked movie, you can see the background cycle through the different noise maps:
  • The first background (in color), is the combined map, which is the 'x-map' in the red channel, the 'y-map' in the green channel, and the 'z-map' (speed) in the blue channel.
  • The second background is the "x-map": Lighter values move particle the the right, darker values move particle to the left.
  • The third background is the "y-map": Lighter values move the particles up, and darker values move the particles down.
  • The fourth background is the 'speed map' Lighter values speed the particles up, darker values slow the particues down.
  • The fifth background is... no background at all.
  • And finally, it loops back to the first background.
When the sketch starts, it generates the x, y, & z maps (each based on random Perlin noise) and saves them to an off-screen buffer. Then as the sketch runs, the particle queries its position on each map, and modifies its position based on the above rules.

If I get a chance to advance the code, I'm going to try to have it calculate the noise on the fly (rather than pre-generating it and saving it as multiple maps) allowing me to animate the noise over time, giving it an even more varied look.

Find source code on my Processing Wiki
Find three other movies on Flickr

Wednesday, December 17, 2008

Learning Harmonica...

My grandfather could play the harmonica. And the accordion. In fact, I have his instruments, although they are in a bit of disrepair. I used to play harmonica with my old roomates back in LA, in the mid-90's. But that faded over time. Decided to finally get back into it.

Other than picking up a nice Lee Oscar Major Diatonic in the key of C, I found a swell instructional book that has both a CD, and a DVD. The DVD is great, since it visually shows the holes being played as the music is going on.

I personally like the concept of the harmonica being that it's such a small insturment: Easy to take with you, fun to play, and enjoyable to play with others. Only problem is it cuts into my other project time...

Progressive Beginner Harmonica @ www.learnToPlayMusic.com