expected constructor, destructor, or type conversion before '(' token

I’m having trouble with project 06 in the Genuino project.
Here is my code:
int sensorValue;
int sensorLow = 1023;
int sensorHigh = 0;

pinMode (ledPin, OUTPUT)
digitalWrite(ledPin, HIGH);
const int ledPin = 13;

while (millis() < 5000) {

sensorValue = analogRead(AO);
if (sensorValue > sensorHigh) {
sensorValue = sensorHigh;
}
if (sensorValue < sensorLow) {
sensorValue = sensorLow;
}
}
}

void setup() {
// put your setup code here, to run once:

digitalWrite(ledPin, LOW);
}

void loop() {
// put your main code here, to run repeatedly:
sensorValue = analogRead(AO);
int pitch =
map(sensorValue, sensorLow, sensorHigh, 50, 4000);

tone(8, pitch, 20);

delay(10);

}

I’ve moved some parts because other wise it would not communicate properly.

You have a number of statements that are not inside a function.

And in future, please use code tags when posting code

type
** **[code]** **

paste your code after that
type
** **[/code]** **

So it looks like

int sensorValue;
int sensorLow = 1023;
int sensorHigh = 0;


pinMode (ledPin, OUTPUT)
digitalWrite(ledPin, HIGH);
const int ledPin = 13;

while (millis() < 5000) {

  sensorValue = analogRead(AO);
  if (sensorValue > sensorHigh) {
    sensorValue = sensorHigh;
  }
  if (sensorValue < sensorLow) {
    sensorValue = sensorLow;
  }
}
}


void setup() {
  // put your setup code here, to run once:

  digitalWrite(ledPin, LOW);
}

void loop() {
  // put your main code here, to run repeatedly:
  sensorValue = analogRead(AO);
  int pitch =
    map(sensorValue, sensorLow, sensorHigh, 50, 4000);

  tone(8, pitch, 20);

  delay(10);

}

And if you place your mouse in the output window and scroll up, you will see a lot more info. Below all the orange lines as a result of the compile.

sketch_jul02a:6: error: expected constructor, destructor, or type conversion before '(' token

 pinMode (ledPin, OUTPUT)

         ^

sketch_jul02a:10: error: expected unqualified-id before 'while'

 while (millis() < 5000) {

 ^

exit status 1
expected constructor, destructor, or type conversion before '(' token
sketch_jul02a:6: error: expected constructor, destructor, or type conversion before '(' token
 pinMode (ledPin, OUTPUT)

You can’t put a pinMode() call (or any function call) there. Put it in setup().

sketch_jul02a:10: error: expected unqualified-id before 'while'
 while (millis() < 5000) {

More code that should be inside a function, like setup() or loop().