PROGRAM PIANO PASCAL

Ini sedikit aku kasih source code sederhana. Jadi program ini jika di run akan berfungsi seperti piano.

Sederhana sekali, so silahkan coba pada bahasa Pascal.

Program Piano;
Uses Crt, Graph3;
Const Escape = #27;
Var Tombol : Char;
Frek : Word;
Bunyi : Boolean;
Begin
Clrscr;
Gotoxy(30, 70);
Write(‘ Simulasi Piano ‘);
Gotoxy(30, 09); Write(‘ ‘);
Gotoxy(30, 10);
Write(‘ WE TYU ‘);
Gotoxy(30, 11);
Write(‘ A S F G H J K ‘);
Gotoxy(30, 12); Write(‘ ‘);

Repeat
Tombol : = Readkey;
Tombol : = Upcase(Tombol);
Bunyi : = True;
Case Tombol Of
‘A’ : Frek := 131;
‘W’ : Frek := 139;
‘S’ : Frek := 147;
‘E’ : Frek := 156;
‘F’ : Frek := 175;
‘T’ : Frek := 185;
‘G’ : Frek := 196;
‘Y’ : Frek := 208;
‘H’ : Frek := 220;
‘U’ : Frek := 233;
‘J’ : Frek := 247;
‘K’ : Frek := 262;
Else
Bunyi := False
End;

If Bunyi Then
Begin
Sound(Frek);
Delay(200);
No Sound;

End;
Until Tombol = Escape;
End.

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s