user89202: // notes in the melody:
int melody[] = {

};

// note durations: 4 = quarter note, 8 = eighth note, etc.:
int noteDurations[] = {

  4, 8, 8, 4, 4, 4, 4, 4
};


//Constants:
const int ledPin = 2;   //pin 3 has PWM funtion
const int flexPin = A0; //pin A0 to read analog input
const int ledoth = 4;
const int flexPin2 = A1;


//Variables:
int value; //save analog value


void setup(){
  
  pinMode(ledPin, OUTPUT);  //Set pin 3 as 'output'
  Serial.begin(9600);       //Begin serial communication
  pinMode(ledoth, OUTPUT);
  Serial.begin(9600);

}

void loop(){
  
  value = analogRead(flexPin);         //Read and save analog value from potentiometer
  Serial.println(value);               //Print value
  value = analogRead(flexPin2);
  Serial.println(value);
  //Low Note(Red)
 // value = map(value, 400, 600, 0, 255);//Map value 0-1023 to 0-255 (PWM)
  
  if(value<767)
  {digitalWrite(ledoth,LOW);
    digitalWrite(ledPin,LOW);
  
     //analogWrite(ledPin, value);          //Send PWM value to led
      delay(100);  
    //Small delay
  }
  
  ***if ((flexPin)) value<910;))&& (value>767));***
  {digitalWrite(ledoth,LOW);
    digitalWrite(ledPin,HIGH);
  
     //analogWrite(ledPin, value);          //Send PWM value to led
     delay(100);   
    //Small delay
  }
  //High note(Blue)
 // value = map(value, 700, 900, 256, 1000);//Map value 0-1023 to 0-255 (PWM)
  
  if(value>910){
  digitalWrite(ledPin,LOW);
    digitalWrite(ledoth,HIGH);  {

  // iterate over the notes of the melody:

  for (int thisNote = 0; thisNote < 8; thisNote++) {

    // to calculate the note duration, take one second divided by the note type.

    //e.g. quarter note = 1000 / 4, eighth note = 1000/8, etc.

    int noteDuration = 1000 / noteDurations[thisNote];

    tone(4, melody[thisNote], noteDuration);

    // to distinguish the notes, set a minimum time between them.

    // the note's duration + 30% seems to work well:

    int pauseBetweenNotes = noteDuration * 1.30;

    delay(pauseBetweenNotes);

    // stop the tone playing:

    noTone(8);
    }

  }
  //analogWrite(ledoth, value);          //Send PWM value to led
    delay(100);    }                      //Small delay
}


user23841: That line doesn't make any sense at all. Just count opening and closing brackets and so on
if ((flexPin)) value<910;))&& (value>767));
{digitalWrite(ledoth,LOW); digitalWrite(ledPin,HIGH);

Lets analyze it:

if ((flexPin)) value<910; flex pin is non zero, so it's basically "if (true) compapare value is greater than 767 and do nothing with result ;"
)) && (value>767)) 4 closing brackets, one opening - absolute syntax error - like you've accidentally copypasted something to wrong place
; { misplaced semicolon results into if ((value < 910) && (value > 767)); { something; } do nothing and then unconditionaly do "something"

According to the code it should be like:
  if ((value < 910) && (value > 767)) { // for values between 767..910 exluding do:
    digitalWrite(ledoth,LOW);
    digitalWrite(ledPin,HIGH);
  
    //analogWrite(ledPin, value);   //Send PWM value to led
    delay(100);                     //Small delay
  }

Btw I've got no idea what that ((flexPin)) was supposed to mean there.

89202: <pre><code>// notes in the melody:
int melody[] = {

};

// note durations: 4 = quarter note, 8 = eighth note, etc.:
int noteDurations[] = {

  4, 8, 8, 4, 4, 4, 4, 4
};


//Constants:
const int ledPin = 2;   //pin 3 has PWM funtion
const int flexPin = A0; //pin A0 to read analog input
const int ledoth = 4;
const int flexPin2 = A1;


//Variables:
int value; //save analog value


void setup(){
  
  pinMode(ledPin, OUTPUT);  //Set pin 3 as 'output'
  Serial.begin(9600);       //Begin serial communication
  pinMode(ledoth, OUTPUT);
  Serial.begin(9600);

}

void loop(){
  
  value = analogRead(flexPin);         //Read and save analog value from potentiometer
  Serial.println(value);               //Print value
  value = analogRead(flexPin2);
  Serial.println(value);
  //Low Note(Red)
 // value = map(value, 400, 600, 0, 255);//Map value 0-1023 to 0-255 (PWM)
  
  if(value&lt;767)
  {digitalWrite(ledoth,LOW);
    digitalWrite(ledPin,LOW);
  
     //analogWrite(ledPin, value);          //Send PWM value to led
      delay(100);  
    //Small delay
  }
  
  ***if ((flexPin)) value&lt;910;))&amp;&amp; (value&gt;767));***
  {digitalWrite(ledoth,LOW);
    digitalWrite(ledPin,HIGH);
  
     //analogWrite(ledPin, value);          //Send PWM value to led
     delay(100);   
    //Small delay
  }
  //High note(Blue)
 // value = map(value, 700, 900, 256, 1000);//Map value 0-1023 to 0-255 (PWM)
  
  if(value&gt;910){
  digitalWrite(ledPin,LOW);
    digitalWrite(ledoth,HIGH);  {

  // iterate over the notes of the melody:

  for (int thisNote = 0; thisNote &lt; 8; thisNote++) {

    // to calculate the note duration, take one second divided by the note type.

    //e.g. quarter note = 1000 / 4, eighth note = 1000/8, etc.

    int noteDuration = 1000 / noteDurations[thisNote];

    tone(4, melody[thisNote], noteDuration);

    // to distinguish the notes, set a minimum time between them.

    // the note's duration + 30% seems to work well:

    int pauseBetweenNotes = noteDuration * 1.30;

    delay(pauseBetweenNotes);

    // stop the tone playing:

    noTone(8);
    }

  }
  //analogWrite(ledoth, value);          //Send PWM value to led
    delay(100);    }                      //Small delay
}
</code></pre>
 23841: <p>That line doesn't make any sense at all. Just count opening and closing brackets and so on</p>
<pre><code>if ((flexPin)) value&lt;910;))&amp;&amp; (value&gt;767));
{digitalWrite(ledoth,LOW); digitalWrite(ledPin,HIGH);
</code></pre>
<p>Lets analyze it:</p>
<ol>
<li><code>if ((flexPin)) value&lt;910;</code> flex pin is non zero, so it's basically &quot;if (true) compapare value is greater than 767 and do nothing with result ;&quot;</li>
<li><code>)) &amp;&amp; (value&gt;767))</code> 4 closing brackets, one opening - absolute syntax error - like you've accidentally copypasted something to wrong place</li>
<li><code>; {</code> misplaced semicolon results into <code>if ((value &lt; 910) &amp;&amp; (value &gt; 767)); { something; }</code> do nothing and then unconditionaly do &quot;something&quot;</li>
</ol>
<p>According to the code it should be like:</p>
<pre><code>  if ((value &lt; 910) &amp;&amp; (value &gt; 767)) { // for values between 767..910 exluding do:
    digitalWrite(ledoth,LOW);
    digitalWrite(ledPin,HIGH);
  
    //analogWrite(ledPin, value);   //Send PWM value to led
    delay(100);                     //Small delay
  }
</code></pre>
<p>Btw I've got no idea what that ((flexPin)) was supposed to mean there.</p>
