You can download the source code from the Ireland’s Call demo here – obviously, this is provided completely free of any guarantees, and smells like code that was whipped together for a demo! Open the file Game.cs and read the notes at the top if you want to go exploring.
If you’re looking at the code, you’re probably interested in Guitar Hero X-Plorer integration or perhaps the HLSL shaders or maybe how I did the audio.
X-Plorer: This works just like a normal XBox360 controller. Do a seach for [XPLORER] in this file and you can find the relevant bits about how to manage the X-Plorer (including using the accelerometers to figure out if someone is tilting the guitar up to unleash “Star Power”!).
HLSL: I tweaked the High-Level Shader Language code found in the original Particle3DSample from the XNA Creators Club to also allow passing the colour of the fireworks as a parameter. OK, I know they look more like explosions than fireworks. Making them prettier is left as an exercise to someone who, unlike me, has more artistic ability than a slug.
Audio: I cut up the audio manually using an audio editing program called GoldWave. I now have immense respect for the folks who produced the real Guitar Hero audio – making it work is easy, making it sound GOOD and RESPONSIVE is really hard!! As a first approximation, what I did was very quickly fade in the start of each audio section, making sure it was cued so that you got an immediate, on-beat acoustic response.
The goal, of course, being that if you play with a steady rhythm, the song sounds fluid.
I had each audio section overlap a TINY bit: each audio clip plays a TINY portion of the next note before fading out, to make it a bit more forgiving on the timing. “Dead air” sounds awful between notes, as I am lacking a “background” track (i.e. all the other instruments in Guitar Hero.)
Hope you enjoy and don’t hesitate to contact me with comments, suggestions, feedback.