Friday, February 15, 2013

Visualizing and Sonifying the Iterations of z=z^2+c

This video looks like an interesting point of departure for sonifying the Mandelbrot fractal. I've never been happy with graphical sonifications that map pitch to the y axis of a rendering, and time to the x axis, but mapping these patterns to sound seems like a very promising way to get interesting patterns out of the iterations of the z=^2+c formula. And it would also be something that could render in realtime, instead of rendering millions of points in advance and then putting that data through a sonification function. Here's a blog post on orbit traps. Just started experimenting with Mandelbrot sonifications this week. I'll have some demo's up in another post.

Saturday, January 12, 2013

New Album: A Sine of the Times

Sunday, January 6, 2013

Almost Anything in Ruby can be a Hash Key

This was a definite huh / aha moment - finding the idiomatic Ruby way to solve a typical problem, in this case, taking an array of objects, and grouping them in a hash so that each element in the hash was all of the objects belonging to a particular user. You could parse out some unique value from your user object (which was the brain-damaged PHP way I had been thinking of this problem) and use that has a hash key:
#ugly
slug = (post.user.name +" "+post.user.id.to_s).to_sym
posts_by_user[slug] << post
When it turns out that you can use objects themselves as hash keys in Ruby, and then use the Hash.keys method to grab those objects back when you need them. So if you had a Post, which belonged to User, and you wanted to get them all and group them by user (assuming that your ORM or whatever won't do it for you in this instance):
posts = Post.all
posts_by_user = Hash.new {|h,k| h[k]=[]}
posts.each do |post|
  #if there is no entry for this user, create one with an empty array
  posts_by_user[post.user] ||= []
  #shovel the post on to the group for that user
  posts_by_user[post.user] << post
end
Iterate through them like this -
posts_by_user.keys.each do |user|
  #the user object
  p user.inspect
  #referencing the hash with the user object as key
  posts_by_user[user].each do |post|
    #each post belonging to that user
    p post.inspect
  end
end

Thursday, October 11, 2012

Apache Benchmark Tips

Apache Benchmark (ab) is a great tool for doing quick load testing on websites. Here's a patched version that will let yourun apache benchmark against different pages on your site in the same batch (not just the homepage). Found via Rainbow Chard

Tuesday, July 24, 2012

Working with Node.js

Been working with node.js for the past week.  Going to start with some simple things like a Rock, Paper, Scissors game.  I'd like to try some music, using node to send OSC.  Here's an example (not mine) of using node.js with a monome:

Thursday, July 12, 2012

I Put an Album on Bandcamp

"Pythagorean Clouds" on Bandcamp

Because sometimes I do actually record "albums".  Used to alot more, back when I was doing more beat-oriented stuff with Buzz.  I might put some of those older things on Bandcamp too.  Since Bandcamp caps the song length for new users at 26 minutes (with some snark about jam bands and "Serious Ambient Composers" (ahem) on top of that) there's not that much that I've recorded in the last 5 years that I can post.  

Anyway, "Pythagorean Clouds" is a collection of shorter pieces I wrote last summer, inspired by seeing a Pendulum Video I had seen on BoingBoing.  That led to developing a new "instrument" based on stacking up tones with amplitude oscillators and playing cyclical sounds, as opposed to the very linear stuff I had been doing involving factors of integers.  There are some pieces in there too involving modulated sine waves that were inspired by trying to compose 140-character drones that I could fit into a Tweet.

I might post some other older stuff on Bandcamp, or some excerpts of newer stuff.