I'm a relative newbie to this, need help with some audio type stuffs

my idea is to make a fun musical instrument with potentiometers and a speaker (only need to play frequencies). the 4 potentiometers will change the: pitch; tempo; rhythm; and volume. How possible is it to do and can i get a bit of help with coding.

I've made a simple keyboard before, but i steered clear of bpm/tempo stuff because i'm scared of millis() and delay just doesn't cut it. my main concern is with adding a rhythm changer, mostly because of my inability to get my head around millis(). please help?

Blink without Delay is a nice example of how we use millis().. You can check it here http://arduino.cc/en/Tutorial/BlinkWithoutDelay

Cheers, i've been checking it out, i think i've found a way that uses delay to my advantage, i've done the first 2 potentiometers for pitch and tempo, with a 4 note bar, the tepo doubling each increment, but it doesn't seem to work, this is my code so far.

include "pitches.h"

int Buzzer1 = 7; int potPin1 = 0; int potPin2 = 1; int potPin3 = 2; int potPin4 = 3; int pitch; int note; int range; int val; int tempo;

void setup() { pinMode(Buzzer1, OUTPUT);

}

void loop(){ pitch = analogRead(potPin1); pitch = map(pitch, 0, 1023, 0, 7);

val = analogRead(potPin2); val = map(val, 0, 1023, 0, 5);

if (val == 0) { tempo = 1600; }

if (val == 1) { tempo = 800; }

if (val == 2) { tempo = 400; }

if (val == 3) { tempo = 200; }

if (val == 4) { tempo = 100; }

if (val == 5) { tempo = 50; }

if (pitch == 0) { note = NOTE_C4;

} if (pitch == 1) { note = NOTE_D4;

} if (pitch == 2) { note = NOTE_E4;

} if (pitch == 3) { note = NOTE_F4;

} if (pitch == 4) { note = NOTE_G4;

} if (pitch == 5) { note = NOTE_A4;

} if (pitch == 6) { note = NOTE_B4;

} if (pitch == 7) { note = NOTE_C5;

} tone(Buzzer1, note); delay(tempo); tone(Buzzer1, note); delay(tempo); tone(Buzzer1, note); delay(tempo); tone(Buzzer1, note); delay(tempo);

}