     String pa = msg.substring(hashInd + 4, hashInd + 4 + patternL);
     drums(tag - DRUMSSTART, pa);
   } else if (tag >= INSTRUMENTSTART && tag <= INSTRUMENTEND) {
-    
+    String pa = msg.substring(hashInd + 4);
+    instrument(tag - INSTRUMENTSTART, pa);
   }
 }
 

#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
//I1: instrument 1, I2: instrument 2
// marker // TODO
const int DRUMSSTART = 1;

    return;
  }
  byte pattern = 0;
  //  Serial.println(patternS);
  for (int i = 0; i < patternL; i++) {
    pattern = pattern << 1;
    byte b = patternS.charAt(i) == '1' ? 1 : 0;
    pattern += b;
  }
  //  Serial.println(pattern);
  patterns[tag] = pattern;
}

void instrument(int tag, String pattern) {
  //  Serial.println(pattern);
  for (int i = 0; i < patternL; i++) {
    Serial.println(pattern.substring(0, 2));
    instrument_seq[tag][i] = pattern.substring(0, 2).toInt();
    pattern = pattern.substring(3);
  }
  for (int i = 0; i < patternL; i++)
    Serial.println(instrument_seq[tag][i]);
}

