Wednesday, January 28, 2009

It works!

A lot has happened since my last post.
I got an Arduino, and a relay board.
The arduino is overkill, i could have gotten a parallel port driven relay board and been done with it, but I wanted to be able to use it for other things in the future. Same with the relay board. It's complete overkill. Relay's can handle 120V at 15amp, I only need something like 3V and a few mili-amps. I might want to use this for other things in the future though.

So, here's what I've got:
Custom C# code to analyze pictures from the webcam, and send the notes out over a Serial Connection.
Arduino, programmed to read from the Serial port, and output that to the relay board, turning on and off the relays.
Relay board wired up to the buttons in the Guitar Hero controller.

While testing it out on the super easy mode, I noticed that the code is faster than the screen, so it would triple play each note. I made some adjustments so that it will ignore a note if it's the same as the last note. This seems to work so far on easy mode, since the notes come so slow.

For the past 2 days, I've been letting it run on easy mode. It's awesome! It seems to do about 3 stars on every song, at around 80% accuracy!

The reason it's not at 100% is due to the webcam. I'm not sure if it's my code, or the webcam, but The framerate drops very low every couple of seconds. This may be my code slowing down, possibly some garbage collection or bad drivers. I don't know yet, but when it happens, it's very likely that it'll miss a note.

Since I changed the code to ignore notes that are the same as the last note, it's become an expert at holding notes. It won't let go of a note until it sees a new one. It's also fairly good at playing double notes.

It just got 75%, 16 note streak, 3 stars on Cherub Rock.

Right now, it's unable to beat the Guitar Battle challenges because of how the camera is setup. The screen moves when you play battle mode, and I haven't adjusted the position of the camera so it can see the notes. Also, since there is no attack, I'd have to manually tell it to send the attack. I beat them myself and left it to play all the songs in between. I should have all of the easy mode finished soon.

More pictures coming on how the relay's are wired up, and hopefully a YouTube video of the action.

No comments:

Post a Comment