Showing posts with label wii. Show all posts
Showing posts with label wii. Show all posts

Sunday, March 02, 2008

How to use the Wii Guitar Hero III guitar on Guitar Hero III for the PC

Right! I'm going to explain to you how to get the Les Paul from Guitar Hero III: Legends of Rock for the Nintendo Wii to work with Guitar Hero III: Legends of Rock for the PC. I took a lot of this from the Wiihacks post on using your Wiimote as a mouse in Windows so if something isn't clear enough, go read that first.


*UPDATE* March 6: the GlovePIE script is now DONE. I just added the correct keybinding to the + key (Backspace instead of Escape) and changed the whammy code to use the mouse for whammying. It's not as smooth as I'd like, but it's the best you can get.
*UPDATE* March 5: updated the script to be three times shorter, and added support for Star Power activation by tilting the guitar. The Wiimote will also rumble for a second when you do this, somewhat like it does in GH3 for the Wii. Yay!


Why?

Because GH3 for the PC has better graphics and STEREO SOUND, and I wanted to see if it could be done. These guys got most of it working and I've had some tips from them. You've all seen the videos of people using the Wiimote as a mouse, and some of you probably have seen some of Johnny Chung Lee's videos where he uses the Wiimote as cheap implementations of head tracking solutions and multi-touch whiteboard screens.
I got the whole thing working in about an hour, on Windows XP. The GlovePIE script (which is completely my own) took about three days work off and on.


What do I need?

You're going to need the following things:

  • A Nintendo Wii controller and a Wii Les Paul guitar controller, obviously.

  • Guitar Hero III: Legends of Rock for the PC

  • A bluetooth adapter or USB dongle - If your computer doesn't already have one (look in the Device Manager to check this), you can get a cheap one that plugs into your USB port from eBay. I got one for $1 and it works fine.

  • BlueTooth drivers - If your computer doesn't have them already (Windows Vista should) and the above bluetooth adapter/dongle didn't have a driver CD included, get the free BlueSoleil drivers.

  • GlovePIE 0.30 or newer - this interprets the signals from the Wiimote and can map them to key presses. Version 0.30 added support for the Wii guitar.

  • A bit of persistence to get the GlovePIE script to work right :-)

Connect the Wiimote to your PC via Bluetooth

This should be the easiest part. Plug the Bluetooth dongle in if you have one, then install the BlueSoleil drivers. The Microsoft Bluetooth stack will NOT work, unless have a Bluetooth device that is in the list of compatible devices on the WiiBrew wiki.


Once the Bluetooth part is setup, put the Wiimote in discovery mode by pressing 1+2, then let your Bluetooth device on the PC discover it. It should find something like Nintendo RVL-CNT-01, which offers a Human Interface Device (HDI) service. If the Wiimote LEDs stop flashing, press them again until your PC finds the Wiimote and the service. When that's done, connect to the HID service.


Setup GlovePIE to use the Wiimote

Now that the Wiimote is connected to your PC, open up GlovePIE. Go to File > Open and open the script called TestWiimote.PIE in the OldScripts folder. Now click RUN and wave around your Wiimote. There should be numbers changing in the debug window in response to your waving. If they don't change, either your Wiimote is not connected properly, or your Bluetooth stack is incompatible with the Wiimote.


If you got GlovePIE working, you can try this mouse script from the Wii Hacks blog and fiddle around with it. Tilting your Wiimote should control the mouse cursor, and it should make the Wiimote vibrate when you hit the screen. A and B control the mouse buttons.


Setup GlovePIE to use the Wii guitar controller

Now for the hard part. You'll need a custom script to interpret the signals from the Wii guitar and map them to keys on your keyboard. The script I wrote to do this is below, you can copy and paste it into GlovePIE (don't forget to save it) and change it to your liking.



Key.Ctrl = False
Key.LeftShift = False
Key.LeftAlt = False
Key.RightAlt = False

debug = 'whammy=' + wiimote.Guitar.WhammyBar + ', pitch=' + RemoveUnits(Wiimote.Pitch)

//change these to your liking (use debug info)
var.whammythreshold = 0.55
var.starpowerangle = 50

//bind frets to V-C-X-Z etc
Keyboard.V = Wiimote.Guitar.Fret1
Keyboard.C = Wiimote.Guitar.Fret2
Keyboard.X = Wiimote.Guitar.Fret3
Keyboard.Z = Wiimote.Guitar.Fret4
Keyboard.A = Wiimote.Guitar.Fret5
//make the 4 wiimote leds light up with the first 4 frets
Wiimote.Led1 = Wiimote.Guitar.Fret1
Wiimote.Led2 = Wiimote.Guitar.Fret2
Wiimote.Led3 = Wiimote.Guitar.Fret3
Wiimote.Led4 = Wiimote.Guitar.Fret4
//other mappings
Keyboard.Space = Wiimote.Guitar.Minus
Keyboard.W = Wiimote.Guitar.StrumDown
Keyboard.E = Wiimote.Guitar.StrumUp
Keyboard.Backspace = Wiimote.Guitar.Plus

//make whammy when whammy is pushed
If Wiimote.Guitar.WhammyBar > var.whammythreshold
   Mouse.x = Wiimote.Guitar.WhammyBar
EndIf
//push star power button when guitar is tilted
If RemoveUnits(Wiimote.Pitch) > var.starpowerangle
   Key.Space = True
   Wiimote.Rumble = True
   Wait 1000 ms
   Key.Space = False
   Wiimote.Rumble = False
EndIf

A few things to note on this script:

It maps most of the Wii guitar controls to the default mappings of GH3 for the PC. E.g. the frets G-R-Y-B-O are mapped to V, C, X, Z and A. Look around in the script, it's really easy to do.


To configure the whammy, run the script and look at the debug value for the whammy bar. My guitar gave a value of 0.55 for the whammy bar in rest, so you'll only want GlovePIE to send it to GH3 when a value greater than 0.55 is registered (or it'll be constantly whammying). Change the line 'var.whammythreshold = ...' so that it has the value there that your whammy bar sends while in rest.


If you tilt the guitar higher than 50 degrees, Star Power is activated. If you like it better when it's at 30 degrees, or 90 degrees, change the var.starpowerangle value. Use the debug value to find your best angle.


Whichever mappings you use in the script doesn't really matter, as long as you configure GH3 for the PC to use the same mappings. So if you have the script setup to send 'Q' when you press the orange fret, setup GH3 for PC so that the 'Q' presses the orange fret.


Other stuff you can do


Besides accomplishing this great feat, you can:

  • Plug your bigass flatscreen into the PC, set it as the primary screen and rock out in an even higher resolution!

  • Add new songs to GH3! This is possible in the PC version only (at least with minimal effort). See this thread on the ScoreHero forums. I've already added a few songs, and it turns out to work best when you have FretsOnFire songs to be imported - those already have separate channels for song/rhythm/guitar sounds, though it is also possible with normal mp3 files.

That's it!

Using this setup, I got my Wii guitar working great with GH3 for the PC. You might not be able to get the same scores since the Bluetooth connection sometimes seems to drop things or lag a bit, but it's great for getting that extra graphics quality boost that you won't get on the Wii. :-) Have fun!