Piezo Buzzer - Win and Fail Sound

Hey, i am searching for two sound examples for my piezo buzzer.
Currently i am using the piezo with the example from arduino

int melody[] = {
  262, 196,196, 220, 196,0, 247, 262};

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

 for (int thisNote = 0; thisNote < 8; thisNote++) {
    int noteDuration = 1000/noteDurations[thisNote];
    tone(12, melody[thisNote],noteDuration);
    int pauseBetweenNotes = noteDuration * 1.30;
    delay(pauseBetweenNotes);
    noTone(12);
    }

But i am searching for a sound that underlines whether the user won or lost. But i can't find any examples for arduino/piezo sounds. So maybe you have some hints for me where i can find sounds like that for my arduino, or maybe you composed sounds like that by yourself :slight_smile: ?!

Thanks

Hi,

I use two low notes - duh, duuhh to indicate fail and two fast arpeggios of higher notes for winning, you can hear them here, its not going to win any grammies, but you know whether you got a good lap or not.

Duane B

rcarduino.blogspot.com

Hey, first of all great project ! I like the sounds very much. Do you think you could send me the melody and noteDurations array for these two sounds ?

Its inline in the code like so, converting to an array would be better but I was experimenting with tunes this way -

Build your own lap timer here -

if(lapTime == bestLapTime)
       {
         for(uint8_t nLoop = 0;nLoop < 2;nLoop ++)
         {
           tone(sAudioPin,NOTE_A5);
           delay(NOTE_SUSTAIN);
           tone(sAudioPin,NOTE_B5);
           delay(NOTE_SUSTAIN);
           tone(sAudioPin,NOTE_C5);
           delay(NOTE_SUSTAIN);
           tone(sAudioPin,NOTE_B5);
           delay(NOTE_SUSTAIN);
           tone(sAudioPin,NOTE_C5);
           delay(NOTE_SUSTAIN);
           tone(sAudioPin,NOTE_D5);
           delay(NOTE_SUSTAIN);
           tone(sAudioPin,NOTE_C5);
           delay(NOTE_SUSTAIN);
           tone(sAudioPin,NOTE_D5);
           delay(NOTE_SUSTAIN);
           tone(sAudioPin,NOTE_E5);
           delay(NOTE_SUSTAIN);
           tone(sAudioPin,NOTE_D5);
           delay(NOTE_SUSTAIN);
           tone(sAudioPin,NOTE_E5);
           delay(NOTE_SUSTAIN);
           tone(sAudioPin,NOTE_E5);
           delay(NOTE_SUSTAIN);
         }
         noTone(sAudioPin);
       }
       else
       {
           tone(sAudioPin,NOTE_G4);
           delay(250);
           tone(sAudioPin,NOTE_C4);
           delay(500);
           noTone(sAudioPin);
       }

thanks a lot :slight_smile:

If you Piezo still sounds a bit underwhelming you can try using a simple amplifier and a speaker for better quality sound -

Duane B

rcarduino.blogspot.com