Monday, September 08, 2008

Wii-mote Controller for Google Earth

A really simple controller for Google Earth using the Wii-mote. Simply maps a few buttons and actions to keyboard keys using GlovePIE. This was one of the first youtube videos I ever uploaded... somehow forgot about it...

Saturday, April 05, 2008

Wii-mote Force-feedback Joystick

What do you get when you combine a Wii-mote, a force-feedback joystick and a few lines of GlovePIE script?


code for part 1:

var.Y = MapRange(wiimote2.Pitch, -90, 90, 1, -1)
var.X = MapRange(wiimote2.Roll, -90, 90, 1, -1)
var.S = 0.8

joystick3.Vibration1 = var.X*var.S
joystick3.Vibration2 = var.Y*var.S
code for part 2:
var.xRot = Wiimote2.RelAccX
var.yRot = Wiimote2.RelAccY

joystick3.Vibration1 = MapRange(var.xRot, -50, 50, -1, 1)
joystick3.Vibration2 = MapRange(var.yRot, -50, 50, -1, 1)


note the joystick/wiimote numbers. your mileage may vary.

Friday, April 04, 2008

Time Lapse

Nothing to do with the wii-mote here. A simple time-lapse video of a trip to the Van Dusen Botanical Gardens in the heart of Vancouver.




I've wanted to do this for some time now, but never got around to it. Finally, on a sunny spring day, between writing a big project report and working on the presentation for said project, I finally managed to get it done. I had my camera set on the lowest resolution (640x480), and lowest compression settings (the icon that looks like stairs on Canon cameras :p). The entire video contained about 400something shots, taken at roughly 4~5-step intervals (I used steps instead of time to try and create a perceived constant motion). There are some skips here and there, since I wasn't being totally meticulous about the shooting intervals...



The pictures were imported into Windows Movie Maker, essentially creating a slideshow 'movie'. I set the image/fade durations to give it the accelerated motion feel (about .3 second for each image). And thats it... more or less. Nothing fancy...

Saturday, January 12, 2008

A 'full' Wii-Drum kit

So I've been playing with the wii-motes on the PC for a while now, on and off. Karl Kenner's GlovePIE makes it very easy to fiddle around with the various input and output parameters of the device. One of the demos that come with GlovePIE include a simple 'drumming' script that was based on the work done by Bob Somers. This script continuously measures the force values of the wii-mote, and if it is beyond a certain level, a midi drum note is triggered depending on the buttons that are being pressed at the time.

A snippet of the code appears as follows:
var.yRot = Wiimote1.RelAccY
...
...
if var.yRot > 25 then
var.S = Wiimote1.A and ...[combination of buttons]
....
endif
else
var.S = false
endif

Midi.AcousticSnare = var.S
...

If you duplicate the code for a second wii-mote, then you could have two drum 'sticks'. However, another major component of a 'real' drum kit is missing: the foot pedals. Since you can attach a nunchuk controller to each wii-mote, and the connecting cord is long enough to reach from your hands to feet (when sitting down), it seemed like a good idea to emulate the foot pedals with nunchuk controllers. And thats what I did. The result is here:




I simply added another variable that's hooked up to the nunchuk's force values, and an additional if loop that triggers the bass drum, and hi-hat on the two different nunchuks, respectively. An 'open' high hat is also added by looking at the pitch of the hi-hat nunchuk. So if you have your foot up, and hit a normal hi-hat with the 'stick' (wii-mote in hand), it will generate the open hi-hat sound.

Here is the code. If you have any questions feel free to ask me.

And by replacing the midi note triggers with keyboard inputs that correspond to the ones used in the DTXMania simulator, I was able to do this: (sorry about the song, which apparently not a lot of people like ;)