Thursday, October 21, 2010

Audio Adventures and Lost Kittens

While putting the finishing touches on the little Memory War Cubes prototype I had to face, again, one of my biggest handicaps in this game hobby business: Audio.  It took me a while to find a suitable sound sample to play when you move the pieces or the cursor. What you hear in the prototype is an edited version of a free sound sample I found in the wonderful Open Game Art website.  For that simple modification, I used the free and open source Audacity audio editor, which I had used in the past to slow down guitar songs I wanted to transcribe.  The sample's description said that it was created using nothing but Audacity's generators: it was not recorded nor derived from a recorded sample.  When I read that, this terrible itch started and would not go away: how do you create sounds from nothing?  I have taught myself a lot of game programming skills, how to create 3D models in Blender or manipulate graphics in Photoshop.  I can create most of the things I need for a simple game myself, which is great.  Being able to do the same with sounds would be extremely valuable, I thought.

Audacity is a great free audio tool, and it comes bundled with Nyquist, a sound synthesis and composition language with Lisp syntax.  Lisp is an old and venerable programming language that is popular and powerful, but is mostly known, loved and hated by its pervasive use of parentheses.  Look at this sample plugin from the Audacity website:


(defun delays (s decay delay count)
    (if (= count 0) (cue s)
    (sim (cue s)
        (loud decay (at delay (delays s decay delay (- count 1)))))))
  (stretch-abs 1 (delays s (- 0 decay) delay count)) 
 
After learning quite a bit more about Audacity and Nyquist, I kept trolling the Internet looking for resources on creating sounds until I came across the book Designing Sound by Andy Farnell.  That is when trouble really started.  I got it from Amazon and have been absolutely under its spell ever since.  This book is exactly what I was looking for. It has a detailed overview of the background, theory and tools you need to create sounds from nothing for music composition, interactive shows, film, animation and game development.  The tool used in the book is the amazing free and open source Pure Data audio package.  Pure Data has a visual language of boxes and connections you can use to create any kind of sound processing or sound generating machine you can imagine. Here is an example visual program from Wikipedia:

It looks deceptively simple, but it is incredibly powerful and is as addictive as crack cocaine.  I have abandoned all other pursuits in life and neglected my family while learning this stuff.  Audio programming is fascinating!!  Quite some time will pass before my audio skills get to the point where I can create decent sound samples and effects for my games, but I think it will be worth it.  Here is a little video of me messing with Pure Data trying to filter a noise signal to extract a more pleasant, harmonic sound out of it:





The only event that has been able to snap me from this current audio obsession was the disappearance of our beloved little kitty Thisbe the day of my daughter's 7th birthday.  This was much worse than the last time something similar happened to us.  I spent the afternoon and much of that evening looking around the neighborhood and Franklin Park.  Our backyard leads to the park, and many animals who would love nothing more than a kitten snack live there, so the thought of our little one spending the night there was very troubling.  I did find her at around 10:30pm that night thanks to the food we left out on our back porch (a good tip from a neighbor), a big flashlight and lots of patience.  You can not imagine how hard that day was for the family, but happy endings are always welcome.  Below is a picture of that little rascal.  The first thing she did when I caught her was scratch my hand badly. Then she stole my pillow in the middle of the night and ruined my sleep.  Oh well.  All was forgiven very quickly.

2 comments:

  1. Anonymous2:23 PM

    how can you find them every time? unbelievable! you are so talented at finding lost things in the dark.

    ReplyDelete
  2. I know how you feel. I also have a young cat that sometimes dissapear and comes back next day.

    ReplyDelete