|
最近用NXC写了一首《樱花开》的曲子供大家娱乐,选这首曲子是因为它比较短又为人熟知。本人非音乐专业,不到之处请大家指正。代码献上:
// yinhuakai樱花开音乐 20140407shi
void yinhuakai() //yinhuakai樱花开音乐
{
int a1=1397;
int a2=1568;
int a3=1760;
int a4=1975;
int a5=2093;
int a6=2349;
int a7=2637;
int w1=400;
int w2=480;
int w3=800;
int w4=1280;
PlayTone(a6,w1);
Wait(w2);
PlayTone(a6,w1);
Wait(w2);
PlayTone(a7,w3);
Wait(w3);
PlayTone(a6,w1);
Wait(w2);
PlayTone(a6,w1);
Wait(w2);
PlayTone(a7,w3);
Wait(w3);
PlayTone(a6,w1);
Wait(w2);
PlayTone(a7,w1);
Wait(w2);
PlayTone(a1,w1);
Wait(w2);
PlayTone(a7,w1);
Wait(w2);
PlayTone(a6,w1);
Wait(w2);
PlayTone(a7,w1);
Wait(w1);
PlayTone(a6,w1);
Wait(w2);
PlayTone(a4,w3); //6764-
Wait(w3);
PlayTone(a3,w3);
Wait(w2);
PlayTone(a1,w1);
Wait(w2);
PlayTone(a3,w1);
Wait(w2);
PlayTone(a4,w1); //3134
Wait(w2);
PlayTone(a3,w1);
Wait(w2);
PlayTone(a3,w1);
Wait(w1);
PlayTone(a1,w1);
Wait(w2);
PlayTone(a7,w3);
Wait(w3);
PlayTone(a6,w3);
Wait(w2);
PlayTone(a7,w1);
Wait(w2);
PlayTone(a1,w1);
Wait(w2);
PlayTone(a7,w1);
Wait(w2);
PlayTone(a6,w1);
Wait(w2);
PlayTone(a7,w1);
Wait(w1);
PlayTone(a6,w1);
Wait(w2);
PlayTone(a4,w3); //6764--
Wait(w3);
PlayTone(a3,w3);
Wait(w2);
PlayTone(a1,w1);
Wait(w2);
PlayTone(a3,w1);
Wait(w2);
PlayTone(a4,w1); //3134
Wait(w2);
PlayTone(a3,w1);
Wait(w2);
PlayTone(a3,w1);
Wait(280);
PlayTone(a1,w1);
Wait(w2);
PlayTone(a7,w3);
Wait(w3);
PlayTone(a6,w1);
Wait(w2);
PlayTone(a6,w1);
Wait(w2);
PlayTone(a7,w3);
Wait(w3);
PlayTone(a6,w3);
Wait(w2);
PlayTone(a6,w1);
Wait(w2);
PlayTone(a7,w3); //667-
Wait(w3);
PlayTone(a3,w3);
Wait(w2);
PlayTone(a4,w1);
Wait(w2);
PlayTone(a7,w1);
Wait(w1);
PlayTone(a6,w1);
Wait(w2);
PlayTone(a4,w3);
Wait(w3);
PlayTone(a3,1200);
Wait(w4);
}
task main()
{
yinhuakai() ; //yinhuakai樱花开音乐
}
|
|