2004/C5/練習問題

#define mi  330
#define ra  440
#define si  494
#define Do  523
#define DO  554
#define Re  587
#define RE  622
#define Mi  659
#define Fa  698
#define FA  740
#define Sol 784
#define Ra  880
#define Si  988

#define X1  20
#define x1  25
#define X2  40
#define x2  50
#define X3  80
#define x3  100
#define X4  160
#define x4  200

task play_music()
{
   while (true)
   {
       PlayTone(mi,X2); Wait(x2);  
       PlayTone(ra,X2); Wait(x2);
       PlayTone(Do,X2); Wait(x2);
       PlayTone(Mi,X3); Wait(x3);
       PlayTone(Mi,X2); Wait(x2);
       PlayTone(Re,X2); Wait(x2);
PlayTone(Do,X2); Wait(x2);
PlayTone(si,X2); Wait(x2);
PlayTone(Do,X4); Wait(x4);
PlayTone(ra,X2); Wait(x2);
PlayTone(Do,X2); Wait(x2);
PlayTone(Mi,X2); Wait(x2);
PlayTone(Ra,X3); Wait(x3);
PlayTone(Ra,X2); Wait(x2);
PlayTone(Ra,X2); Wait(x2);
PlayTone(Sol,X2); Wait(x2);
PlayTone(Fa,X2); Wait(x2);
PlayTone(Sol,X4); Wait(x4);
PlayTone(Do,X2); Wait(x2);
PlayTone(Mi,X2); Wait(x2);
PlayTone(Sol,X2); Wait(x2);
PlayTone(Si,X3); Wait(x3);
PlayTone(Ra,X2); Wait(x2);
PlayTone(Sol,X2); Wait(x2);
PlayTone(FA,X2); Wait(x2);
PlayTone(Sol,X2); Wait(x2);
PlayTone(Ra,X3); Wait(x3);
PlayTone(Sol,X2); Wait(x2);
PlayTone(FA,X3); Wait(x3);
PlayTone(Mi,X2); Wait(x2);
PlayTone(Re,X2); Wait(x2);
PlayTone(Do,X2); Wait(x2);
PlayTone(Re,X2); Wait(x2);
PlayTone(Mi,X2); Wait(x2);
PlayTone(Re,X2); Wait(x2);
PlayTone(ra,X2); Wait(x2);
PlayTone(si,X4); Wait(x4);

       PlayTone(mi,X2); Wait(x2);  
       PlayTone(ra,X2); Wait(x2);
       PlayTone(Do,X2); Wait(x2);
       PlayTone(Mi,X3); Wait(x3);
       PlayTone(Mi,X2); Wait(x2);
       PlayTone(Re,X2); Wait(x2);
PlayTone(Do,X2); Wait(x2);
PlayTone(si,X2); Wait(x2);
PlayTone(Do,X4); Wait(x4);
PlayTone(ra,X2); Wait(x2);
PlayTone(Do,X2); Wait(x2);
PlayTone(Mi,X2); Wait(x2);
PlayTone(Ra,X3); Wait(x3);
PlayTone(Ra,X2); Wait(x2);
PlayTone(Ra,X2); Wait(x2);
PlayTone(Si,X2); Wait(x2);
PlayTone(Sol,X1); Wait(x1);
PlayTone(Fa,X1); Wait(x1);
PlayTone(Sol,X4); Wait(x4);
PlayTone(Do,X2); Wait(x2);
PlayTone(Mi,X2); Wait(x2);
PlayTone(Sol,X2); Wait(x2);
PlayTone(Si,X3); Wait(x3);
PlayTone(Ra,X2); Wait(x2);
Wait(45);
PlayTone(Sol,X1); Wait(x1);
PlayTone(FA,X1); Wait(x1);
PlayTone(Fa,X1); Wait(x1);
PlayTone(FA,X1); Wait(x1); 
PlayTone(Ra,X3); Wait(x3);
PlayTone(Sol,X2); Wait(x2);
Wait(45);
PlayTone(FA,X1); Wait(x1);
PlayTone(Mi,X1); Wait(x1);
PlayTone(RE,X1); Wait(x1);
PlayTone(Mi,X1); Wait(x1);
PlayTone(Mi,X3); Wait(x3);
PlayTone(Re,X1); Wait(x1);
PlayTone(Do,X1); Wait(x1);
PlayTone(si,X2); Wait(x2);
Wait(22);
PlayTone(DO,X1); Wait(x1);
PlayTone(RE,X2); Wait(x2);
PlayTone(Mi,X4); Wait(x4);
   }
}      
task main()
{start play_music ;  
}

トップ   編集 凍結 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2005-02-01 (火) 16:27:40