I moded a Guitar Hero 3 wireless guitar so that I could attach an ARduino to it, and have the Arduino play a song.
1st I just moded that guitar so that all the buttons "wires" where accessible from outside the guitars, turns out that 8 wires where needed to controll all Freets buttons, the Strum and the BACK button.
So I used a standard DB9 connector and connected it to the outside of the guitar, near that "unused" special RJ-45 connector.
Then Using a relay board and the Arduino Diecimila, and creating a program with the notes for the Arduino. I was able to make it play
"TTFAF" on expert.
I later on modified the guitar again so that the relay board was inside the guitar, and added a connector flush with the guitar for the Arduino Nano. I also added a 9v battery inside the neck of the guitar to power the Nano to keep the guitar completly wireless.
Also added 2 button on the back of the neck, a Reset and a "start" for the Arduino application.
And Finaly I also created an application in Visual Basic .NET that uses a camera. It detect in tealtime the Notes and sends it to the Arduino to play it... It does miss a few notes, specialy doubles and triples notes, but still working on the applications.
As for the circuit... well I only have some "doodles"
and I did not take any pictures while I was making it....
But, if you're interested... I could clean up mu "doodles"
and make a nice version of the circuit... Would be hand drawn
because I don't have any app that I could use to make a circuit schematic.
#include <avr/pgmspace.h>
#include <GH3.h>
//#include <\\Buhric-PC\arduino\GH3\Songs\CultOfPersonality\CoP-00-Full-exp.txt>
#include <\\Buhric-PC\arduino\GH3\Songs\HolidayInCambodia\HiC-00-Full-Exp.txt>
//#include <\\Buhric-PC\arduino\GH3\Songs\WelcomeToTheJungle\WttJ-00-Full-Exp-937.txt>
//#include <\\Buhric-PC\arduino\GH3\Songs\TEST.txt>
#define pinG 4 //NANO
#define pinR 5
#define pinY 6
#define pinB 7
#define pinO 8
#define pinS 3
#define pinStP 2
#define pinOK 9
/*
#define pinG 6 //Decimila
#define pinR 7
#define pinY 8
#define pinB 9
#define pinO 10
#define pinS 11
#define pinStP 4
#define pinOK 5
*/
int i=0;
int note=0;
int ok=0;
float start=0;
unsigned long time=0;
unsigned long delta=0;
void setup(){
pinMode(pinG,OUTPUT);
pinMode(pinR,OUTPUT);
pinMode(pinY,OUTPUT);
pinMode(pinB,OUTPUT);
pinMode(pinO,OUTPUT);
pinMode(pinS,OUTPUT);
pinMode(pinStP,OUTPUT);
pinMode(pinOK,INPUT);
}
void loop(){
i=0;
note = pgm_read_word_near(fret + i);//reads the notes from the included file
ok = digitalRead(pinOK);
while ((i < cords) && ok){
delta = millis()-time;
if (delta >= start){
time = millis();
if ((note&G) == G) {digitalWrite(pinG,HIGH);} else {digitalWrite(pinG,LOW);}
if ((note&R) == R) {digitalWrite(pinR,HIGH);} else {digitalWrite(pinR,LOW);}
if ((note&Y) == Y) {digitalWrite(pinY,HIGH);} else {digitalWrite(pinY,LOW);}
if ((note&B) == B) {digitalWrite(pinB,HIGH);} else {digitalWrite(pinB,LOW);}
if ((note&O) == O) {digitalWrite(pinO,HIGH);} else {digitalWrite(pinO,LOW);}
if ((note&StP) == StP) {digitalWrite(pinStP,HIGH);} else {digitalWrite(pinStP,LOW);}
if ((note&S) == S) digitalWrite(pinS,HIGH);
delay(25);// if not at least 20 millis strum not detected
digitalWrite(pinS,LOW);
if (FrameBased){
start = ((note&0x00ff)*(1000/29.97))/timer;
}else{
start = (note&0x00ff)*timer;
}
i++;
note = pgm_read_word_near(fret + i);//reads the notes from the included file
}else{
delay(timer);
}
}
}
As you can see on my next post.... I was only limited to 8 bits for the delay... thats why there a bunch of the same notes at +250 delay....
I know the max is 255... but 250 seamed more practical.
I was watching your YouTube videos where you use the note identification (real-time) but on your latest video, you are not using them at all? Do you load the particular song onto the Nano and then manually start the sketch?
To insert an image, upload it to a free filehoster (ImageShack for example) and copy the link given. In here, click the image icon (left of the 'Insert email' icon and paste the link.
the "Welcome To the Jungle" video is the only one that I'm using real time detection.
TTFAF and Holiday in Cambodia and done using a Notes sequence + delay preloaded in the Arduino.... less fancy but more precise.. does not miss an notes
I get the notes sequence by filming the song in pratice mode, then
I load that AVI in the same application that does the real time note detection... and it goes through the same process, but theres a sort of "Notes error correction" so I get almost 100% of the notes correct
I just need to tweak the delay between each notes to get a perfect.
I have been fiddling with the cough Velleman cough K8055 USB experimental board to create something similar for PS3. I ended up ditching the relay board and connected the fret and strumlines to the K8055 directly (open collectors, sharing common GND) and having an application short the ports to GND to simulate a button press.
However, I had no option to create the songs in an easy way...
Now I am looking to do the same using an Arduino Duemilanove but as my nick comment is revealing - I'm a clueless newbie...
I am hoping to be able to hack something together that enables me to play the songs (in practice mode) and then record these 'pushes' to either the Arduino or a host-PC application. I don't know how I will solve the timings of the frets - some of them are pressed simultaneously and I guess the timings of such a chord would get different for each fret.
Buy the way you where discribing how you similated a button press.... it looks like you might have a CG (Common Ground) controller.
Means that all the buttons have an unique signal line and a common ground. In which case its fairly easy to detect button presses.
With the Arduino, monitor the signal lines... they should normaly be at "high" and will go to "low" when you press the button.
So just have the Arduino program scan all the signal lines
And once it detect one at "low" save it with the difference of milis between this note and the previous one.
You can either same the notes and delays to an array. or send them through serial to the computer.
Oracle,
I just created 5 ROI (Region of Interest), one for each fret button
then for every frame I look at the Average Color of each ROI.
then is the Euclidian distance of that Average Color is less then a certain amount, the note is detected. The time between each note is frame based... ie how many frames between each note....
That the base of the detectection. at the moment the difference between real time and the "delayed time" is that in "delayed time" i got a notes correction system.....
Suppose at frame 1 it detected a "R", and then at frame 2 a "G" and "R"... I could then correct the first "R" note to a "G|R"
Thats the current issue I have with Real time...
if it detectecs a "R" on a frame it plays it, then if a "G|R" is detected on the next frame... I can't unplay the "R".. the double note was already missed.... so Instead of replaying the "G|R" it just skips it.
However, I am looking to interface a Duemilanove with the Guitar Hero / Rock Band controllers.
Since my knowledge in electronics is somewhat (read: very) limited, it won't be as sophisticated
(automated) as your 'bot' or the DaveyBot.
I would love to build the one you are using though...