Fisheye lens photo without a fisheye lens
Today I experimented with a program called hugin to create a fisheye lens effect by stitching together seven separate photos. Here’s a picture of my music studio. That’s Chico on the lower right.
Today I experimented with a program called hugin to create a fisheye lens effect by stitching together seven separate photos. Here’s a picture of my music studio. That’s Chico on the lower right.
A known number of equally valued gems are stolen from a vault. A week later an accomplice is captured. A math savvy detective interrogates the thief as follows:
D: How many accomplices were there?
T: I will not answer that.
D: What happened to the gems?
T: We split them evenly.
D: You must be lying.
T: I admit, to avoid a fight in the getaway car I took a share valued 20% above each of the others’.
D: Thank you. You just gave me the answer to my first question.
How many gems were stolen?
By popular demand I released a pared down version of VROOM for Linux under the GPL so people can study and modify it. The internet scores part has been stripped out because that would make it way too easy to cheat. I’ve been meaning to enhance it to use a fixed time step as described here. If someone succeeds at this before I get around to it please let me know.
This version includes a new feature. The engine sound revs much more smoothly. I made a couple of tweaks to the SDL_mixer and Pygame code to make this work. I’ll try to cover the details soon.
To run, you’ll need to set an environment variable so Pygame will pick up the new SDL_mixer library:
% tar -xzvf vroomDemo.tar.gz % cd vroomDemo % setenv LD_LIBRARY_PATH ./sdl_mixer % python vroomDemo.py
If the setenv LD_LIBRARY_PATH trick doesn’t solve the “undefined symbol” error, you can try patching, compiling, and installing SDL_mixer. Here are the patch files for SDL_mixer-1.2.4:
For SDL_mixer-1.2.7 you’ll need these:
Enjoy.
Here’s something I whipped up late one night. It’s a simple drum machine in Python. The script reads formatted text that describes drum patterns then invokes CSound to create the track. Check out the script.
Below is the score to the first few measures of a Zigzags song called Icecream Sandwich. (Full score is here.) The first section defines the patterns named p0, p1, p2, and p3. The second section puts the patterns together to form the song. The numbers in the pattern tell the program to play a drum at a particular volume (1 softest to 0 loudest). A period tells the program to sustain the note for a specific length of time (otherwise the note will sustain until the sample is finished). The vertical ‘|’ character is ignored and can be used as a visual aid to separate ticks into measures. The character string “b222 t4″ tells the program that the succeeding section is 222 beats per minute, with 4 ticks (i.e. dashes) per beat.
p0 stick 8---|6---|4---|2--- p1 kick 9---|--8-|--7-|---- snare ----|6---|----|6--- chh ----|7---|7---|7--- crash 7---|----|----|---- p2 kick 9---|--8-|--7-|---- snare ----|6---|----|6-4- chh 7---|7---|7---|7--- crash ----|----|----|---- p3 kick --8-|--8-|--8-|--8- snare 6---|6---|6---|6--- ohh 6...|6...|6...|6... end ##################### b222 t4 p0 p1 p2 p1 p2 p1 p2 p1 p3
Here’s a very lo-fi recording of Icecream Sandwich (minus the bass guitar) which uses a drum track created with this program:
(Don’t know why my computer mic squeals like that but my punk rock side doesn’t care.)
Since writing the drum machine code I’ve enhanced the sound code in VROOM and realized I could easily extend the drum machine code to use the Pygame mixer module instead of CSound. One advantage to using CSound, though, is that it’s pretty straight forward to do additional processing. For example, check out the file foo.orc, the CSound orchestra file that I used.
; Initialize the global variables. sr = 44100 kr = 4410 ksmps = 10 nchnls = 1 ; Instrument #1. instr 1 kamp = 200*p5 ; If you don't know the frequency of your audio file, ; set both the kcps and ibas parameters equal to 1. kcps = 1 ; ifn = 1 ifn = p4 ibas = 1 a1 loscil kamp, kcps, ifn, ibas a2 lowres a1, 5*p5^1.5, 0.2 out a2 endin
It applies a low pass filter to the sampled waveforms, with a volume-dependent cutoff frequency. This results in a more realistic sound since drums have more high-end when struck harder. Of course, nothing can replace real drums. I wrote this code mostly for tempo practice and sketch recordings.

I wrote this game in my spare time in 2003 on a IBM T23 laptop running Linux. I used the Python language because it’s fun, and I wanted to see if it would perform well. It did, especially after enlisting the help of Psyco and Pyrex.
Too often game developers emphasize visuals like texture maps and high polygon count at the expense of gameplay. I took the contrarian approach using the minimalist style of old school vector graphic games to let the gameplay stand on its own.
To approximate the effect of vector graphics I used the antialiased line drawing algorithm found on Hugo Elias’s website. I fixed a minor bug that caused some uneveness to lines arranged head to tail and sent the code to the Pygame folks. Writing this game was much easier thanks to the PyGame library and the library upon which it is built, SDL.
Besides writing the antialiased line functions, challenges included designing code for compiling bi-space partitioning (BSP) trees from an SVG representation of the track, modeling car dynamics with physics routines, and figuring out how to package everything into a windows installer. For kicks I added a mode where you can play the game in 3D using red & blue glasses.
These are actual user comments:
“an addicting game”
“I like the track designs. Physics are very fun, power oversteer at will. Playing in Virtual Boy mode brought back some memories of…what was it… Red Alarm.”
“that game is awesome..but my fingers hurt now.”
“cool game. very addicting…and frustrating at the same time (when i hit a wall)”
“Damn that’s fun!”
“Simplicity at its finest!”
“OK….I’m addicted”
“My eyes burn”
“Most addictive game…evar.”