Multi-Scale Keyboard

I am currently designing a circuit which uses a potentiometer to change the scale of a keyboard if it goes past a certain point. However, I’m a bit baffled on hiw to design the rest. To give it more of a keyboard feel, I was thinking of using tin foil as its conductive but was unsure how to connect to the arduino and how to connect all the keys to ground.

Here is my code:

#include <Tone.h>
Tone tone1;

int scalePot = A0;
int C_note = 2;
int D_note = 3;
int E_note = 4;
int F_note = 5;
int G_note = 6;

void setup() {
  // put your setup code here, to run once:
  pinMode (scalePot, INPUT);
  pinMode (C_note, OUTPUT);
  pinMode (D_note, OUTPUT);
  pinMode (E_note, OUTPUT);
  pinMode (F_note, OUTPUT);
  pinMode (G_note, OUTPUT);

  Serial.begin(9600);


}

void loop() {
  // put your main code here, to run repeatedly:
  int Potval = analogRead(scalePot);
  Serial.println(Potval);

  while (Potval > 511.5)

    if (C_note = 1)

      tone1.begin(13);
  tone1.play(261, 1000);

  if (D_note = 1)

    tone1.begin(13);
  tone1.play(294, 1000);

  if (E_note = 1)

    tone1.begin(13);
  tone1.play(329, 1000);

  if (F_note = 1)

    tone1.begin(13);
  tone1.play(349, 1000);

  if (G_note = 1)

    tone1.begin(13);
  tone1.play(392, 1000);

  while (Potval < 511.5)

    if (C_note = 1)

      tone1.begin(13);
  tone1.play(523, 1000);

  if (D_note = 1)

    tone1.begin(13);
  tone1.play(587, 1000);

  if (E_note = 1)

    tone1.begin(13);
  tone1.play(659, 1000);

  if (F_note = 1)

    tone1.begin(13);
  tone1.play(698, 1000);

  if (G_note = 1)

    tone1.begin(13);
  tone1.play(784, 1000);

}

Would you be able to help me design a circuit, preferably using Fritzing and tell me if i need to change my code in any way?

Thank you in advance!

EDIT: I know there isn’t a speaker pin declared but they are in tone1.begin on pin 13!

  while (Potval > 511.5)

    if (C_note = 1)

Potval is an integer - comparing it to floating point is silly.

You "if" will always be true. This was pointed out yesterday.

What's more, even if you correct you "if"s (yes, all of them) NONE of them will be true, because

int C_note = 2;
int D_note = 3;
int E_note = 4;
int F_note = 5;
int G_note = 6;

I think you're missing some "digitalRead"s

Ok would you be able to help with the circuit. i want to use tin foil to look like piano keys!

Don't you think you need to spend more time on the software? Like making the input pins inputs with pullups, and then actually reading them? Like only calling "begin" once and sorting out your while loops?