Multiple Buttons Change a Single Variable

I coded a simple synth where

Pitch = sensor value * 2

I want to have 4 toggle-able pushbuttons which change the "multiplier" of 2 with a variable multiplier.

This way, depending on which button was pressed last, the pitch is different from the others.

I sort of left the coding at a cliffhanger.

Any help or advice at all really is appreciated.

//declare variables:
int varPin = analogRead(A0);
int button0 = digitalRead(3);
int button1 = digitalRead(4); 
int button2 = digitalRead(5); 
int button3 = digitalRead(6); 
int buttonPins[] = {button0, button1, button2, button3};
int lastButtonPressed = 0;
int currentButton = 1;
int buttonState = 0;
int lastButtonState = 0;
void setup(){}  
void loop()
{
  currentButton = buttonPins[];
  {lastButtonPressed = currentButton;}    //Change it to new value
  int varPitch = map(varPin, 100, 1000, 50, 5000) * lastButtonPressed;
  //Pitch will equal sensor value times the "button multiplier".
  tone(7, varPitch); //Play it. 
}

Just some thoughts:

Start by moving the part you call variable setup into void loop, or the buttons won't be read, and just declare the button presses as type byte at the beginning instead (and even then 8 bits is overkill for a 0 or 1, but you can't really get smaller easily)

Then use pinMode in setup and declaring the button pins as inputs (for consistency if nothig else), then do digitalWrite(button, HIGH) to turn on the internal pullup resistors so a simple switch to ground can be used for button presses,

Then within loop call the Button press library to tell when a button was pressed, unless you plan to debounce the button presses by some other means,

tell us varpin is connected to and how it changes.
You're mapping your pitch to be 50 to 5000 * a number (1,2,3,4).
What's up with 0-99 and 1001-1023?
Is this supposed to end up in the audio range? I think when you get to 3,4 and the high end of your analog input you're not gonna be very audible for a lot of folks, except maybe the dogs.