 #include <Process.h>
 
-String hashTags[] = {"PS", "BD", "SD", "KI", "SN", "CR", "I1", "I2"};
-//PS: play sample, BD: bass drum, SD: snare, KI: kick,SN: snare, CR: crash
+String hashTags[] = {"PS", "BD", "SD", "KI", "CB", "CR", "I1", "I2"};
+//PS: play sample, BD: bass drum, SD: snare, KI: kick,CB: cowbell, CR: crash
 //I1: instrument 1, I2: instrument 2
 // marker // TODO
 const int DRUMSSTART = 1;

// sequence-bits
int bs[] = {1, 2, 4, 8, 16, 32, 64, 128, 256};

int instrument_1_seq[8];
int instrument_2_seq[8];

const String sampleFolder = "/mnt/twitterOrchestra/samples/";

void setup() {
  Bridge.begin();
  Serial.begin(9600);
  while (!Serial);
  String msg = "#BD 10001000";
  parseMessage(msg);
  String msg2 = "#SD 01010101";
  parseMessage(msg2);
  String msg3 = "#KI 10001010";
  parseMessage(msg3);
  String msg4 = "#CR 01000000";
  parseMessage(msg4);

  nextBInc = MINUTE / bpm;
}


  unsigned long time = millis();
  if (time > nextB) {
    nextB += nextBInc;

    for (int i = DRUMSSTART; i <= DRUMSEND; i++) {
      if (patterns[i - 1] & bs[pos])
        Serial.print(hashTags[i]);
      else
        Serial.print("..");
      Serial.print("-");
    }
    Serial.print("  ");
    Serial.print(instrument_seq[0][pos]);
    Serial.print("-");
    Serial.print(instrument_seq[1][pos]);
    Serial.print("  ");
    Serial.println("");
    
    
    pos = (pos + 1) % patternL;
  }
}

void parseMessage(String msg) {
  int hashInd = msg.indexOf('#');
  if (hashInd == -1)
    return;
  int tag = 0;
  String s = msg.substring(hashInd + 1, hashInd + 3);
  boolean found;
  for (int i = 0; i < numIns; i++) {
    if (s == hashTags[i]) {
      tag = i;
      Serial.println(s);
      found = true;
      break;
    }
  }
  if (!found) {
    Serial.print("wrong tag ");
    Serial.println(s);
    return;
  }
  if (tag == 0)
    playSample(msg.substring(hashInd + 4));
