tone.h Final Countdown melody

Hello,

Have anyone code to play melody from song Final Countdown by piezo?

Thanks

Maybe this program will help:

It contains:

tune_6:
'Final Countdown
tune piezo, 6,%00100000,($41,$6B,$01,$26,$2C,$42,$41,$42,$41,$2B,$2C,$42,$41,$02,$26,$2C,$6B,$69,$6B,$69,$68,$6B,$29,$41,$6B,$01,$26,$2C,$42,$41,$42,$41,$2B,$2C,$42,$41,$02,$26,$2C,$6B,$69,$6B,$69,$68,$6B,$29,$68,$69,$2B,$69,$6B,$41,$6B,$69,$68,$26,$02,$C1,$41,$42,$41,$6B,$81,$EC)
return

Unfortunately the ‘notes’ in Picaxe Basic are generated from RTTTL monophonic ringtones using a program called the “Tune Wizard”. The format of the note value does not seem to be documented.

Here is the tune in RTTTL format: http://www.freewebs.com/mgsb/finalcount.htm

I put this version of The Final Countdown together for something I was building.

//http://www.liutaiomottola.com/formulae/freqtab.htm
const int e=329;
const int f=349;
const int fS=369;
const int g=392;
const int a=440;
const int b=494;
const int c=523;
const int bPin = 8;

int Tempo=(60000/128)*4;

void beep(int note, int duration)
{
 tone(bPin, note,Tempo/duration);
 delay(Tempo/duration);
 noTone(bPin);
 delay(50);
}

void setup() {
 Serial.begin(115200);
 pinMode(bPin, OUTPUT);
}


   void loop()
   {
   firstLine();
   ScndLine();
   ThirdLine() ;
   ForthLine();
   FiftthLine();
   delay(3000);
   }
 


void firstLine()
{
 beep(g, 4);
 beep(b, 16);
 beep(a, 16);    
 beep(b, 4);
 beep(e, 4);
 //-----------------
 delay(Tempo/4);
 delay(Tempo/8);
 beep(c, 16); 
 beep(b, 16);
 beep(c, 8);
 beep(b, 8);
 beep(a, 4);
 //-----------------
 delay(Tempo/4);
 delay(Tempo/8);
 beep(c, 16);
 beep(b, 16);    
 beep(c, 4);
 beep(e, 4);
 //-----------------
 beep(fS, 4);
 delay(Tempo/4);
 beep(a, 16); 
 beep(g, 16);
 beep(a, 8);
 beep(g, 8);
 beep(fS, 8); //sharp
 beep(a, 8);
 //-----------------
 
}

void ScndLine() {

 
 beep(g, 4); 
 delay(Tempo/4);
 beep(b, 16);
 beep(a, 16);    
 beep(b, 4);
 beep(e, 4);
 //-----------------
 delay(Tempo/8);
 delay(Tempo/4);
 beep(c, 16); 
 beep(b, 16);
 beep(c, 8);
 beep(b, 8);
 beep(a, 4);
  //-----------------
 delay(Tempo/8);
 delay(Tempo/4);
 beep(b, 16);
 beep(a, 16);    
 beep(b, 4);
 beep(e, 4);
 //-----------------
 beep(fS, 4); //sharp
 delay(Tempo/4);
   beep(a, 16);
 beep(g, 16);    
 beep(a, 8);
 beep(g, 8);
 beep(fS, 8); //sharp
 beep(a, 8);  
}
 
void ThirdLine() {

 beep(g, 3);
 beep(fS, 16);  //sharp
 beep(g, 16);
 beep(a, 3);
 beep(g, 16);
 beep(a, 16);
//-----------------
   beep(b, 8);
 beep(a, 8);    
 beep(g, 8);
 beep(fS, 8); //sharp
 beep(e, 4);
 beep(b, 4);
 //-----------------
 beep(c, 1); 
 //-----------------
 //beep(c, 1);
 //-----------------
 beep(g, 4);
 delay(Tempo/4);
 beep(b, 16);
 beep(a, 16);
 beep(b, 4);    
 beep(e, 4); 
 //-----------------
 delay(Tempo/8);
 delay(Tempo/4);
 beep(c, 16); 
 beep(b, 16);
 beep(c, 8);
 beep(b, 8);
 beep(a, 8);
 //-----------------
}
 
void ForthLine() {
 delay(Tempo/8);
 delay(Tempo/4);
 beep(c, 16); 
 beep(b, 16);
 beep(c, 4);
 beep(e, 4);
 //-----------------
 beep(fS, 4);
 delay(Tempo/4);
 beep(a, 16); 
 beep(g, 16);
 beep(a, 8);
 beep(g, 8);
 beep(fS, 8); //sharp
 beep(a, 8);
 //-----------------
 beep(g, 4); 
 delay(Tempo/4);
 beep(b, 16);
 beep(a, 16);    
 beep(b, 4);
 beep(e, 4);
 //-----------------
 delay(Tempo/8);
 delay(Tempo/4);
 beep(c, 16); 
 beep(b, 16);
 beep(c, 8); 
 beep(b, 8);
 beep(a, 4);
 //-----------------
 delay(Tempo/8);
 delay(Tempo/4);
  beep(c, 16); 
 beep(b, 16);
   beep(c, 4); 
   beep(e, 4);
}

void FiftthLine() {
 beep(fS, 4);
 delay(Tempo/4);
 beep(a, 16); 
 beep(g, 16);
 beep(a, 8);
 beep(g, 8);
 beep(fS, 8); //sharp
 beep(a, 8);
 //-----------------
   beep(g, 3);
 beep(fS, 16);  //sharp
 beep(g, 16);
 beep(a, 3);
 beep(g, 16);
 beep(a, 16);
//-----------------
   beep(b, 8);
 beep(a, 8);    
 beep(g, 8);
 beep(fS, 8); //sharp
 beep(e, 4);
 beep(b, 4);
 //-----------------
 beep(c, 1); 
 //-----------------
}