Slightly musical board

Hey still learning the ropes of arduino so thought i'd see what you guys had to say. This is my second little build. I've been fiddling with some minor things which Helped me learn some stuff so i was able to build this.

It is a mini music making board (possibly make something to go in a box at some point but with more controls)

I'm using a little peizo speaker and two potentiometers. One potentiometer controls speed, while the other controls pitch. Originally i just had the one which controlled pitch. But dug out a second one for speed control.

Next up POV display methinks. Should be fun XD



/*Basic Synth
 *by CaptainCool
 *Super Basic music maker

int potPin = 2; // select the input pin for the potentiometer
int potPin2 = 3; // select the input pin for the 2nd potentiometer
int speakPin = 9;   // select the pin for the speaker
int val = 0;       // variable to store the value coming from the potentiometer1
int val2= 0;       // variable to store the value coming from the potentiometer the 2nd

void setup() {
  pinMode(speakPin, OUTPUT);  // declare the speakPin as an OUTPUT

void loop() {
  val = analogRead(potPin);   // read the value from the potentiometer
  val2 = analogRead(potPin2); // read the value from the second potentiometer
  tone (speakPin, val, val2); // make a tone of pitch val and length val 2
  int pauseBetweenNotes = val2 * 1.30; //takes val2 and multiplies it by 1.3
  delay(pauseBetweenNotes); // which gives you a nice delay between notes so they don't just blend

All feedback is welcome