//ARDUINO GATE SEQUENCER //Bubzy 2012 int steps = 31; //this is desired steps-1 to compensate for 0 in array int steplength = 99; //this is the step delay in milliseconds (there is an additional 1ms delay to aid turning notes "off") //int noteCV[16] = {10,20,40,20,60,70,10,20,30,40,100,120,100,80,90,130}; // 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 int gateCV[32] = {1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0};//hat int gate2CV[32] ={0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 0};//hat sust int gate3CV[32] ={1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0};//bass int gate4CV[32] ={0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1};//snare void setup() { pinMode(2,OUTPUT); } void loop() { for (int looper = 0; looper<=steps; looper++) { digitalWrite(2,gateCV[looper]); digitalWrite(3,gate2CV[looper]); digitalWrite(4,gate3CV[looper]); digitalWrite(5,gate4CV[looper]); delay(1); digitalWrite(2,LOW); // digitalWrite(3,LOW); //this was taken out as it stopped my drum machine (cynare) from sustaining notes digitalWrite(4,LOW); digitalWrite(5,LOW); delay(steplength); } }