drum module > Roland Sonic Cell > spark fun MIDI shield >arduino>

Hi,

I am relatively new to this process, but was hoping someone could point me in the right direction.

I am looking for a sketch involving a drum module hooked up to a Roland Sonic cell synthesizer. From there a MIDI cable from the synthesizer to the spark fun MIDI shield (acting as a decoder board)connected to an arduino UNO. From there the Arduino would send a signal to both physical instruments (through a FET board) and also directly to the speaker from the Roland Sonic Cell synthesizer.

So far I have this sketch, but I need additional help with the rest (decoding the MIDI signal and sending it to the arduino).

Thanks,

Adam

//set gate time for each device in milliseconds
int crash=15;
int snare=20;
int smalltom=20;
int largetom=20;
int cowbell=20;

int gatetime [5] = {crash,snare,smalltom,largetom,cowbell};

unsigned long timenow [5];

void setup()
{
for (int i=8;i<15;i++)
{
pinMode(i, OUTPUT);
}
for (int i=2;i<8;i++)
{
pinMode (i, INPUT);
}
}

void loop()
{
if (digitalRead(7)==LOW)
{
digitalWrite(14, HIGH);
for (int i=0; i<5; i++)
{
digitalWrite(i+8,LOW);
}
}
else
{
digitalWrite (14, LOW);
for (int i=0;i<5;i++)
{
if (digitalRead(i+2)==HIGH)
{
timenow*=millis();*

  • digitalWrite(i+8, HIGH);*
  • }*
    if (millis() > timenow_+gatetime*)
    {
    digitalWrite (i+8,LOW);
    }
    }
    }
    }*_