//Gijs Gieskes 2009 byte length = 100; boolean hold = false; byte wave[255]; unsigned long time = 0; int gpitch = 10; void setup() { //speed up PWM on pin 9 and 10: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1235060559 TCCR1B = TCCR1B & 0b11111000 | 0x01; pinMode(9, OUTPUT); } void loop() { rec(); //playback array for(byte i=0; i 20){ time = millis(); counter++; counter %= length; int a = constrain(analogRead(5), 0, 700); if(a > 10){ hold = false; }else{ hold = true; } //set the picth gpitch = a+1; //map for analogWrite and store in array a = map(a, 0, 700, 0, 255); wave[counter] = a; } }