I've been looking for a project that will help me become more familiar with using Processing for video capture and manipulation. The other day while my son was visiting, we were playing Rock Band, me on the guitar and him on the drums, when I proposed, "wouldn't it be cool if I hooked up an Arduino to a guitar controller and had it automatically play the Bass part?" This is when I decided it would be fun to try to have Processing capture usb camera video and determine when the different notes should be played.
I decided to start with the guitar controller interface. After tearing down the controller I could see that the fret buttons appeared to be a simple contact closure to ground. Also, from previous experience modding strum bars I knew that the magnetic sensor could also be replaced by a switch. After tracing the strum sensor wires to the guitar's controller board and performing some simple probing with a ground wire I found the pins (up and down strums use different sensors) that would trigger a strum by applying ground.
I soldered wires onto the guitar's controller board and had a successful test. One thing I did notice was, with the Arduino plugged in, the buttons and strum bar on the guitar controller no longer worked or worked intermittently. If I unplug the Arduino the guitar controller works fine.
For the Arduino interface I've pulled a ground line from the guitar controller and tied that to the Arduino's ground. I run each of the fret buttons and the up and down strum signals to digital I/O pins on the Arduino. See my sample code below.
#define FRET_GRN 2
#define FRET_RED 3
#define FRET_YEL 4
#define FRET_BLU 5
#define FRET_ORN 6
#define STRUM_DN 7
#define STRUM_UP 8
#define STRUM_MILLIS 200
#define BPM 500
void setup() {
pinMode(FRET_GRN, OUTPUT);
digitalWrite(FRET_GRN, HIGH);
pinMode(FRET_RED, OUTPUT);
digitalWrite(FRET_RED, HIGH);
pinMode(FRET_YEL, OUTPUT);
digitalWrite(FRET_YEL, HIGH);
pinMode(FRET_BLU, OUTPUT);
digitalWrite(FRET_BLU, HIGH);
pinMode(FRET_ORN, OUTPUT);
digitalWrite(FRET_ORN, HIGH);
pinMode(STRUM_DN, OUTPUT);
digitalWrite(STRUM_DN, HIGH);
pinMode(STRUM_UP, OUTPUT);
digitalWrite(STRUM_UP, HIGH);
}
void loop() {
strum(FRET_GRN, STRUM_DN);
delay (BPM);
strum(FRET_RED, STRUM_DN);
delay (BPM);
strum(FRET_YEL, STRUM_DN);
delay (BPM);
strum(FRET_BLU, STRUM_DN);
delay (BPM);
strum(FRET_ORN, STRUM_DN);
delay (BPM);
strum(FRET_ORN, STRUM_UP);
delay (BPM);
strum(FRET_BLU, STRUM_UP);
delay (BPM);
strum(FRET_YEL, STRUM_UP);
delay (BPM);
strum(FRET_RED, STRUM_UP);
delay (BPM);
strum(FRET_GRN, STRUM_UP);
delay (BPM);
}
void strum(uint8_t fret, uint8_t strum) {
digitalWrite(fret, LOW);
digitalWrite(strum, LOW);
delay(STRUM_MILLIS);
digitalWrite(strum, HIGH);
digitalWrite(fret, HIGH);
}
I'm soliciting suggestions on better ways to interface the button presses and strum bar that will be less likely to interfere with the guitar controller when a human player wishes to play. I would prefer something small of course. A relay board would not be a very good solution for this application. Since this is just for fun, cost should be kept as low as possible as well.
Thanks in advance for any discussion regarding this project. I'll come back and update this post when I have a prototype for the vision processing module.