user52033: I have the following code that I use to try to play a melody on my Arduino, but there is no melody just a tapping noise. 
I am using the built in tone() function to play on a speaker/buzzer.
I know my hardware setup is correct because running sample code online plays a nice melody.
void setup() { }
void loop() {

    noTone(6);
  // C7 in eighth
    tone(6, 2093, 250); delay(250);
    noTone(6);
    //B7 in eighth
    tone(6, 3951, 250); delay(250);
    noTone(6);    
    //G7 in fourth
    tone(6, 3136, 500); delay(500);
    noTone(6);
    //G7 in eighth
    tone(6, 3136, 250); delay(250);
    noTone(6);
    //F7 in eighth
    tone(6, 2794, 250); delay(250);
    noTone(6);
    //E7 in eighth 
    tone(6, 2637, 250); delay(250);
    noTone(6);
    //E7 in fourth
    tone(6, 2637, 500); delay(500);
    noTone(6);
    //G7 in eighth
    tone(6, 3136, 250); delay(250);
    noTone(6);
    //G7 in halves
    tone(6, 3136, 1000); delay(1000);
    noTone(6);
    //C6 in fourth
    tone(6, 1047, 500); delay(500);
    noTone(6);
    //B6 in eighth
    tone(6, 1976, 250); delay(250);
    noTone(6);
    //G6 in eighth
    tone(6, 1566, 250); delay(250);
    noTone(6);
    //C6 in eighth
    tone(6, 1047, 250); delay(250);
    noTone(6);

}

This is supposed to be the melody for poker face using the tone() function

user41475: I just downloaded it, and it works for me.
Hmmm.   Try downloading the other examples again, just to make sure you haven't moved a jumper.
Another way to check this out is to cut down the program to one or two lines, and see if that does or doesn't work.

52033: <p>I have the following code that I use to try to play a melody on my Arduino, but there is no melody just a tapping noise. </p>

<p>I am using the built in <a href="https://www.arduino.cc/reference/en/language/functions/advanced-io/tone/" rel="nofollow noreferrer"><code>tone()</code></a> function to play on a speaker/buzzer.</p>

<p>I know my hardware setup is correct because running <a href="https://www.arduino.cc/en/Tutorial/ToneMelody?from=Tutorial.Tone" rel="nofollow noreferrer">sample code online</a> plays a nice melody.</p>

<pre><code>void setup() { }
void loop() {

    noTone(6);
  // C7 in eighth
    tone(6, 2093, 250); delay(250);
    noTone(6);
    //B7 in eighth
    tone(6, 3951, 250); delay(250);
    noTone(6);    
    //G7 in fourth
    tone(6, 3136, 500); delay(500);
    noTone(6);
    //G7 in eighth
    tone(6, 3136, 250); delay(250);
    noTone(6);
    //F7 in eighth
    tone(6, 2794, 250); delay(250);
    noTone(6);
    //E7 in eighth 
    tone(6, 2637, 250); delay(250);
    noTone(6);
    //E7 in fourth
    tone(6, 2637, 500); delay(500);
    noTone(6);
    //G7 in eighth
    tone(6, 3136, 250); delay(250);
    noTone(6);
    //G7 in halves
    tone(6, 3136, 1000); delay(1000);
    noTone(6);
    //C6 in fourth
    tone(6, 1047, 500); delay(500);
    noTone(6);
    //B6 in eighth
    tone(6, 1976, 250); delay(250);
    noTone(6);
    //G6 in eighth
    tone(6, 1566, 250); delay(250);
    noTone(6);
    //C6 in eighth
    tone(6, 1047, 250); delay(250);
    noTone(6);

}
</code></pre>

<p>This is supposed to be the melody for poker face using the tone() function</p>
 41475: <p>I just downloaded it, and it works for me.</p>

<p>Hmmm.   Try downloading the other examples again, just to make sure you haven't moved a jumper.</p>

<p>Another way to check this out is to cut down the program to one or two lines, and see if that does or doesn't work.</p>
