Show HN: I built a Guitar Hero robot [video]
youtube.com
youtube.com
The video explains some of the technical details but I'll highlight a few other key points.
- My first attempt at note recognition was looking for specific pixels on the screen. The thought was that I would be able to detect if a pixel changed color and, depending on the color, it would know which note it was. The game outputs at 30 fps and on faster songs, it would miss nearly 30% of notes.
- The note recognition was eventually built using computer vision from OpenCV and specifically blob detection. It took a fair amount of effort to hone in the perfect filtering to make note recognition was highly accurate.
- Implementing the solenoids threw me for a loop. I ended up burning through a lot of them since I'm new to robotics and didn't understand the relationship between power, volts, and current. At one point I was giving these solenoids 4x the power it was expecting. Needless to say, they burnt out quickly. I eventually talked with a robotics guy and he gave me a 30 min crash course which straightened me out.
- The whole project, from idea to the YouTube video I linked in the post, took 2 months. It probably cost nearly $1,000 for everything (raspberry pi, pvc, solenoids, AC/DC power converter, relay modules, paint, stickers, etc). That might seem high, but like I said, I was learning about volts/current and part of that learning process was destroying many solenoids (oops).
Giving away my PS2 and Guitar Hero is one of the only things I regret by the way. If someone created a Guitar Hero that ran on Linux I would gladly pay.
Netplay, multi format support. Etc. All previous game charts are available in formats compatible with Phase Shift.
Phase Shift also unfortunately plays like complete ass, especially on guitar.
The entire Guitar Hero community has pretty much shifted to Clone Hero, with a few diehard fans who still mod GH2/RB
His channel has skyrockted from a few thousand subs less than a year ago to a few million now, and growing VERY fast.
That 30fps is interlaced though, so there is 60Hz motion. All of the PS2 GH/RB games I know run at 60fps internally.
Some of the songs on Beat Saber, on Expert Plus, are effectively impossible for any existing 7 axis serial robot arms to actuate fast enough to equal the best human players if you strapped VR controllers to where the end effectors are. Maybe some sort of parallel robot (like a SCARA) robot could do it.
Two robot arms with 7 degrees of freedom (the extra degree to allow them to avoid colliding with each other), plus the camera has to also move to avoid obstacles. It'd be really tough to beat the best human players, from a mechanical point of view. You'd need custom robots.
I looked into building a robot arm which could cook breakfast. It's almost ludicrous just speccing out the torque requirements to pick up a skillet.
You end up having to pick harmonic drives and less speed but more stiffness, or hydraulics, which are lighter, but messy, less stiff (can be both good and bad) and less reproducible.
Was that a limitation of the AI software or was that by design to keep the strumming part easier to make?
Maybe I missed it, but it looks like there are 3d printed parts.
They aren’t what makes jbj’s brain work, but they might be worth going over the models (even if crude) as part of a follow up video.
If you posted that to /r/3dprinting it would be another audience to pull in.
Anyway it looks awesome!
For debugging missed notes, do you replay the video to the bot? You could capture clips by detecting when the score multiplier drops.
Either the game is slow enough to reason about in real time (certainly, a sweep like 4-3-2-1-2-3-4 as seen in the video wouldn't trip up any seasoned player) or the player resorts to memorizing finger positions (2+3 [2nd button held down at the same time as 3rd], 3+4, 1+4, etc) as well as sequences (1,1,1, 2+3, 1,1,1, 2+3). Hopefully one can pause at a certain segment and redo it as much as needed (like with real instruments), instead of starting from the beginning of the song each time.
But I must say it bears more than a passing resemblence to the version below, first uploaded to YouTube in 2009. Including the specific appearance of the robot and the graphic design of its eyes: https://www.youtube.com/watch?v=0mWHVvKb1hM
Perhaps worth acknowledging that prior effort? (I have no relationship, just feels like that effort--with 2009 technology--deserves some credit.)
> Yes! I didn't realize this other robot existed until I was partially through the project and was doing more research. I loved their form factor so I used it for Jon Bot Jovi. IIRC, they struggled to beat TTFATF (they got 60-70%?) because their note detection software struggled to decipher long blocks of notes tightly together
Working on it was amazing. My job was remixing music for a video game and turning it into gameplay so what was not to love! I prototyped some of the earliest mixes in the game so helped to get the project through it's earliest milestones. I met a lot of famous people and got to remix Daft Punk, DJ Shadow and a few other heroes of mine. My favorite moment was opening the Ableton project sent to us by Daft Punk containing their stems. The music nerd / fanboy in me couldn't believe I got to play around with these stems that very few people ever had access to. They basically don't work with anyone as a rule so the fact that they collaborated on our project was insane. We had their likenesses in the game and the big pyramid stage. Was surreal!
It was a great gig and I feel we produced a cult classic game that stood the test of time. The financials just didn't stack up.
What are you up to now? Still in the music/tech space?
Music is back to being a hobby again. Was just a 3-4 year thing that I went into it professionally.
You put together a lot of fun hours in my childhood
[*] And I would have 1000/1000 achievement points except for the one mix (Beats & Pieces) I was never able to five-star on Expert difficulty :argh:
Maybe an easier target would be BeatMania IIDX. It is actually a ridiculously hard game when played by a human, but the screen is very clean and you just have to press 7 button and move the turntable back and forth (or use the auto-scratch if that's a problem).
Agree that Beatmania would be amazing as a challenge and could build on the Jon Bot Jovi design!
Mine was not mechanical like this. Instead I spliced into the guitar with a microcontroller that I controlled via serial port from my laptop. I wrote software that analyzed recordings of the note chart, saved them to a file, and could play them back over the serial port by telling my microcontroller program what buttons to press.
I don't have any pictures of the thing any more, but some of the YouTube videos live on: https://www.youtube.com/watch?v=n1YE8Wwo2rs
One nitpick on presentation--I am a youtube addict and the first thing I notice on any vlog-style video is mic quality. I don't have words to describe the audiology of it all but I instantly know when someone sounds 'pro' vs. 'amateur'. This video and the others you've posted recently, have narration that sounds 'amateur' to my youtube addled mind. I don't know anything about microphones and stuff, but if you can tackle that I think it will noticeably elevate your videos! Cheers.
Good call on the microphone. I'm still testing some things out so will keep that in mind as I produce the next few videos.
Thanks for subscribing and looking forward to hearing what you think of the next video!
One thing was a bit unclear: is Raspberry Pi doing the blob detection, or is it running on the Macbook?
Also, why only 97%?
the second one is probably easy to fix by spreading the notes out a bit (hyperspeed mode) but the first one is a bit more annoying to program, probably
In terms of 97% and why not 100%:
> There wasn't any limitation from the mechanical perspective. The AI did a nearly perfect job of recognizing notes. I don't know exactly why it missed some notes, but my hypothesis is that it was the speed of notes in quick succession. If I do a follow up video with Jon Bot Jovi, I'll dig into it more!
`if y < prevValue or prevValue is None:`
should be
`if prevValue is None or y < prevValue:`
because the first one will make a comparison for `y < None`, while the second one won't. `y < None` will always return `False` while `prevValue is None` will then always return `True`, making the entire statement `True` if `prevValue` is `None`.
It is not a bug but it's something which I would correct. In the second one `y < prevValue` would not get evaluated if `prevValue` is `None` and it's not really clear what `y < None` means.
--
Great work which reminded me of the Ace of Spades-Robots. It also shows how insanely good humans can be at playing guitars.
Also was not aware of the Ace of Spades robots. Just watched the video and it's epic!
It's really impressive what he archived there, not only the image recognition, considering the high speed of certain parts of the video, but also the hardware implementation.
It was my mistake to only focus so much on the code-thing. Thanks for pointing it out.
I think the biggest improvement for score would be implementing logic to hold down long notes and then implement star power at the ideal time. That would make a dramatic difference!
It’s similarly disconcerting how bad I am (and other humans) at spotting people crossing the street at night if they’re wearing dark clothes. I gotta imagine there are analogous corner cases for machine vision, and a sensor fusion approach should help solve that.
Also you may be overestimating human vision. I doubt normal drivers have 97% accuracy spotting all hazards on the road. We get by mostly on the fact that we keep hazards off the road whenever possible.
Through The Fire And The Flames Is still in my playlist to this day and reminds me about how cool was to play my PS2 back then.
What an absolutely fantastic project you made for yourself!
The latency wasn't an issue though. Even on expert mode on TTFATF, I still had to program a delay to time everything up. But that's great to know for future projects if I need a super low-latency solution.
But if you don’t need the response time or longivity then relays are probably much simpler to set up so a good choice.
Keep it ul!
Whats the tech behind the image recognition?