PERCOBAAN 8 MEMBUAT PIANO

    POLTEKAD KODIKLATAD
JURUSAN TELEKOMUNIKAS




MEMBUAT PROGRAM PIANO
MENGGUNAKAN DELPHI XE 8







Disusun Oleh :

Sertu Mohamad Andryan Prabowo               NIM 2023080-E



PROGRAM STUDI DIPLOMA 4 ANGKATAN VIII
TEKNIK TELEKOMUNIKASI MILITER
SEMESTER III
TAHUN 2024



Batu,               September  2024



PERCOBAAN 8
MEMBUAT PROGRAM PIANO
MENGGUNAKAN DELPHI XE 8




1. Tujuan : Agar Bamasis mampu membuat program piano menggunakan Delphi XE 8


2. Alat dan Bahan : 

a)    Laptop

b)    Aplikasi Delphi

c)    Tshape

d)    Tbutton

e)    Timage

       f)    Tedit

   

        3. Dasar Teori :

    a.    Tshape adalah salah satu komponen visual dalam Delphi yang digunakan untuk menggambar bentuk geometris sederhana seperti persegi panjang, lingkaran, elips, atau garis di dalam sebuah form atau container lainnya. TShape sangat berguna untuk membuat elemen visual yang sederhana.





b.    TButton digunakan untuk membuat tombol (button) di antarmuka pengguna. TButton memungkinkan pengguna untuk memicu suatu aksi atau perintah ketika tombol tersebut diklik. Tombol sangat berguna dalam aplikasi Delphi untuk menjalankan berbagai macam perintah.




c.          TImage merujuk pada komponen atau kontrol yang digunakan untuk menampilkan dan mengelola gambar dalam aplikasi.dengan format .jpg, .gif, .bmp dan sebagainya. Komponen Image terdapat pada Tab Additional.






d.             T Edit Dalam Delphi 8, fungsi t edit biasanya merujuk pada komponen TEdit, yang digunakan untuk membuat kontrol input teks di antarmuka pengguna. Komponen ini memungkinkan pengguna untuk mengetikkan teks atau memodifikasi teks yang sudah ada.





4. Langkah-langkah Percobaan

    a.    Flowchart




b.    Coding


unit Unit1;


interface


uses

  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,

  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, MMSystem, Vcl.ExtCtrls, Vcl.StdCtrls,

  Vcl.Imaging.jpeg;


type

  TForm1 = class(TForm)

    Button1: TButton;

    Button2: TButton;

    Button3: TButton;

    Button4: TButton;

    Button5: TButton;

    Button6: TButton;

    Button7: TButton;

    Button8: TButton;

    Button9: TButton;

    Button10: TButton;

    Button11: TButton;

    Button12: TButton;

    Button13: TButton;

    Button14: TButton;

    Button15: TButton;

    Label1: TLabel;

    Label2: TLabel;

    Shape1: TShape;

    Shape2: TShape;

    Shape3: TShape;

    Shape4: TShape;

    Shape5: TShape;

    Shape6: TShape;

    Shape7: TShape;

    Shape8: TShape;

    Shape9: TShape;

    Shape10: TShape;

    Shape11: TShape;

    Shape12: TShape;

    Shape13: TShape;

    Shape14: TShape;

    Shape15: TShape;

    Edit1: TEdit;

    Image1: TImage;

    Button16: TButton;

    Image2: TImage;

    Button17: TButton;

    Image3: TImage;

    Button18: TButton;

    Button19: TButton;

    Button20: TButton;

    Image4: TImage;

    Image5: TImage;

    Image6: TImage;

    Label3: TLabel;

    procedure Button1Click(Sender: TObject);

    procedure Button2Click(Sender: TObject);

    procedure Button3Click(Sender: TObject);

    procedure Button4Click(Sender: TObject);

    procedure Button5Click(Sender: TObject);

    procedure Button6Click(Sender: TObject);

    procedure Button7Click(Sender: TObject);

    procedure Button8Click(Sender: TObject);

    procedure Button9Click(Sender: TObject);

    procedure Button10Click(Sender: TObject);

    procedure Button11Click(Sender: TObject);

    procedure Button12Click(Sender: TObject);

    procedure Button13Click(Sender: TObject);

    procedure Button14Click(Sender: TObject);

    procedure Button15Click(Sender: TObject);

    procedure Edit1Change(Sender: TObject);

    procedure Button16Click(Sender: TObject);

    procedure Button17Click(Sender: TObject);

    procedure Button18Click(Sender: TObject);

    procedure Button19Click(Sender: TObject);

    procedure Button20Click(Sender: TObject);

  private

    { Private declarations }

  public

    { Public declarations }

  end;


var

  Form1: TForm1;


implementation


{$R *.dfm}


procedure TForm1.Button10Click(Sender: TObject);

begin

sndPlaysound('D:\BAMASIS POLTEKAD\POLTEKAD\POLTEKAD\TK 2\SEMESTER 3\DIRBINDIKJAR\KOM 8\PERCOBAAN 8 MEMBUAT APLIKASI PIANO\Percobaan 8\6.wav',SND_NODEFAULT OR SND_ASYNC);

shape1.Visible:=false;

shape2.Visible:=false;

shape3.Visible:=false;

shape4.Visible:=false;

shape5.Visible:=false;

shape6.Visible:=false;

shape7.Visible:=false;

shape8.Visible:=false;

shape9.Visible:=false;

shape10.Visible:=true;

shape11.Visible:=false;

shape12.Visible:=false;

shape13.Visible:=false;

shape14.Visible:=false;

shape15.Visible:=false;

end;


procedure TForm1.Button11Click(Sender: TObject);

begin

sndPlaysound('D:\BAMASIS POLTEKAD\POLTEKAD\POLTEKAD\TK 2\SEMESTER 3\DIRBINDIKJAR\KOM 8\PERCOBAAN 8 MEMBUAT APLIKASI PIANO\Percobaan 8\5.wav',SND_NODEFAULT OR SND_ASYNC);

shape1.Visible:=false;

shape2.Visible:=false;

shape3.Visible:=false;

shape4.Visible:=false;

shape5.Visible:=false;

shape6.Visible:=false;

shape7.Visible:=false;

shape8.Visible:=false;

shape9.Visible:=false;

shape10.Visible:=false;

shape11.Visible:=true;

shape12.Visible:=false;

shape13.Visible:=false;

shape14.Visible:=false;

shape15.Visible:=false;

end;


procedure TForm1.Button12Click(Sender: TObject);

begin

sndPlaysound('D:\BAMASIS POLTEKAD\POLTEKAD\POLTEKAD\TK 2\SEMESTER 3\DIRBINDIKJAR\KOM 8\PERCOBAAN 8 MEMBUAT APLIKASI PIANO\Percobaan 8\4.wav',SND_NODEFAULT OR SND_ASYNC);

shape1.Visible:=false;

shape2.Visible:=false;

shape3.Visible:=false;

shape4.Visible:=false;

shape5.Visible:=false;

shape6.Visible:=false;

shape7.Visible:=false;

shape8.Visible:=false;

shape9.Visible:=false;

shape10.Visible:=false;

shape11.Visible:=false;

shape12.Visible:=true;

shape13.Visible:=false;

shape14.Visible:=false;

shape15.Visible:=false;

end;


procedure TForm1.Button13Click(Sender: TObject);

begin

sndPlaysound('D:\BAMASIS POLTEKAD\POLTEKAD\POLTEKAD\TK 2\SEMESTER 3\DIRBINDIKJAR\KOM 8\PERCOBAAN 8 MEMBUAT APLIKASI PIANO\Percobaan 8\3.wav',SND_NODEFAULT OR SND_ASYNC);

shape1.Visible:=false;

shape2.Visible:=false;

shape3.Visible:=false;

shape4.Visible:=false;

shape5.Visible:=false;

shape6.Visible:=false;

shape7.Visible:=false;

shape8.Visible:=false;

shape9.Visible:=false;

shape10.Visible:=false;

shape11.Visible:=false;

shape12.Visible:=false;

shape13.Visible:=true;

shape14.Visible:=false;

shape15.Visible:=false;

end;


procedure TForm1.Button14Click(Sender: TObject);

begin

sndPlaysound('D:\BAMASIS POLTEKAD\POLTEKAD\POLTEKAD\TK 2\SEMESTER 3\DIRBINDIKJAR\KOM 8\PERCOBAAN 8 MEMBUAT APLIKASI PIANO\Percobaan 8\2.wav',SND_NODEFAULT OR SND_ASYNC);

shape1.Visible:=false;

shape2.Visible:=false;

shape3.Visible:=false;

shape4.Visible:=false;

shape5.Visible:=false;

shape6.Visible:=false;

shape7.Visible:=false;

shape8.Visible:=false;

shape9.Visible:=false;

shape10.Visible:=false;

shape11.Visible:=false;

shape12.Visible:=false;

shape13.Visible:=false;

shape14.Visible:=true;

shape15.Visible:=false;

end;


procedure TForm1.Button15Click(Sender: TObject);

begin

sndPlaysound('D:\BAMASIS POLTEKAD\POLTEKAD\POLTEKAD\TK 2\SEMESTER 3\DIRBINDIKJAR\KOM 8\PERCOBAAN 8 MEMBUAT APLIKASI PIANO\Percobaan 8\1.wav',SND_NODEFAULT OR SND_ASYNC);

shape1.Visible:=false;

shape2.Visible:=false;

shape3.Visible:=false;

shape4.Visible:=false;

shape5.Visible:=false;

shape6.Visible:=false;

shape7.Visible:=false;

shape8.Visible:=false;

shape9.Visible:=false;

shape10.Visible:=false;

shape11.Visible:=false;

shape12.Visible:=false;

shape13.Visible:=false;

shape14.Visible:=false;

shape15.Visible:=true;

end;


procedure TForm1.Button16Click(Sender: TObject);

begin

Image2.Visible:=true;

Image3.Visible:=false;

Image4.Visible:=false;

Image5.Visible:=false;

Image6.Visible:=false;

end;


procedure TForm1.Button17Click(Sender: TObject);

begin

Image2.Visible:=false;

Image3.Visible:=true;

Image4.Visible:=false;

Image5.Visible:=false;

Image6.Visible:=false;

end;


procedure TForm1.Button18Click(Sender: TObject);

begin

Image2.Visible:=false;

Image3.Visible:=false;

Image4.Visible:=true;

Image5.Visible:=false;

Image6.Visible:=false;

end;


procedure TForm1.Button19Click(Sender: TObject);

begin

Image2.Visible:=false;

Image3.Visible:=false;

Image4.Visible:=false;

Image5.Visible:=true;

Image6.Visible:=false;

end;


procedure TForm1.Button1Click(Sender: TObject);

begin

sndPlaysound('D:\BAMASIS POLTEKAD\POLTEKAD\POLTEKAD\TK 2\SEMESTER 3\DIRBINDIKJAR\KOM 8\PERCOBAAN 8 MEMBUAT APLIKASI PIANO\Percobaan 8\1.wav',SND_NODEFAULT OR SND_ASYNC);

shape1.Visible:=true;

shape2.Visible:=false;

shape3.Visible:=false;

shape4.Visible:=false;

shape5.Visible:=false;

shape6.Visible:=false;

shape7.Visible:=false;

shape8.Visible:=false;

shape9.Visible:=false;

shape10.Visible:=false;

shape11.Visible:=false;

shape12.Visible:=false;

shape13.Visible:=false;

shape14.Visible:=false;

shape15.Visible:=false;

end;


procedure TForm1.Button20Click(Sender: TObject);

begin

Image2.Visible:=false;

Image3.Visible:=false;

Image4.Visible:=false;

Image5.Visible:=false;

Image6.Visible:=true;

end;


procedure TForm1.Button2Click(Sender: TObject);

begin

sndPlaysound('D:\BAMASIS POLTEKAD\POLTEKAD\POLTEKAD\TK 2\SEMESTER 3\DIRBINDIKJAR\KOM 8\PERCOBAAN 8 MEMBUAT APLIKASI PIANO\Percobaan 8\2.wav',SND_NODEFAULT OR SND_ASYNC);

shape1.Visible:=false;

shape2.Visible:=true;

shape3.Visible:=false;

shape4.Visible:=false;

shape5.Visible:=false;

shape6.Visible:=false;

shape7.Visible:=false;

shape8.Visible:=false;

shape9.Visible:=false;

shape10.Visible:=false;

shape11.Visible:=false;

shape12.Visible:=false;

shape13.Visible:=false;

shape14.Visible:=false;

shape15.Visible:=false;

end;


procedure TForm1.Button3Click(Sender: TObject);

begin

sndPlaysound('D:\BAMASIS POLTEKAD\POLTEKAD\POLTEKAD\TK 2\SEMESTER 3\DIRBINDIKJAR\KOM 8\PERCOBAAN 8 MEMBUAT APLIKASI PIANO\Percobaan 8\3.wav',SND_NODEFAULT OR SND_ASYNC);

shape1.Visible:=false;

shape2.Visible:=false;

shape3.Visible:=true;

shape4.Visible:=false;

shape5.Visible:=false;

shape6.Visible:=false;

shape7.Visible:=false;

shape8.Visible:=false;

shape9.Visible:=false;

shape10.Visible:=false;

shape11.Visible:=false;

shape12.Visible:=false;

shape13.Visible:=false;

shape14.Visible:=false;

shape15.Visible:=false;

end;


procedure TForm1.Button4Click(Sender: TObject);

begin

sndPlaysound('D:\BAMASIS POLTEKAD\POLTEKAD\POLTEKAD\TK 2\SEMESTER 3\DIRBINDIKJAR\KOM 8\PERCOBAAN 8 MEMBUAT APLIKASI PIANO\Percobaan 8\4.wav',SND_NODEFAULT OR SND_ASYNC);

shape1.Visible:=false;

shape2.Visible:=false;

shape3.Visible:=false;

shape4.Visible:=true;

shape5.Visible:=false;

shape6.Visible:=false;

shape7.Visible:=false;

shape8.Visible:=false;

shape9.Visible:=false;

shape10.Visible:=false;

shape11.Visible:=false;

shape12.Visible:=false;

shape13.Visible:=false;

shape14.Visible:=false;

shape15.Visible:=false;

end;


procedure TForm1.Button5Click(Sender: TObject);

begin

sndPlaysound('D:\BAMASIS POLTEKAD\POLTEKAD\POLTEKAD\TK 2\SEMESTER 3\DIRBINDIKJAR\KOM 8\PERCOBAAN 8 MEMBUAT APLIKASI PIANO\Percobaan 8\5.wav',SND_NODEFAULT OR SND_ASYNC);

shape1.Visible:=false;

shape2.Visible:=false;

shape3.Visible:=false;

shape4.Visible:=false;

shape5.Visible:=true;

shape6.Visible:=false;

shape7.Visible:=false;

shape8.Visible:=false;

shape9.Visible:=false;

shape10.Visible:=false;

shape11.Visible:=false;

shape12.Visible:=false;

shape13.Visible:=false;

shape14.Visible:=false;

shape15.Visible:=false;

end;


procedure TForm1.Button6Click(Sender: TObject);

begin

sndPlaysound('D:\BAMASIS POLTEKAD\POLTEKAD\POLTEKAD\TK 2\SEMESTER 3\DIRBINDIKJAR\KOM 8\PERCOBAAN 8 MEMBUAT APLIKASI PIANO\Percobaan 8\6.wav',SND_NODEFAULT OR SND_ASYNC);

shape1.Visible:=false;

shape2.Visible:=false;

shape3.Visible:=false;

shape4.Visible:=false;

shape5.Visible:=false;

shape6.Visible:=true;

shape7.Visible:=false;

shape8.Visible:=false;

shape9.Visible:=false;

shape10.Visible:=false;

shape11.Visible:=false;

shape12.Visible:=false;

shape13.Visible:=false;

shape14.Visible:=false;

shape15.Visible:=false;

end;


procedure TForm1.Button7Click(Sender: TObject);

begin

sndPlaysound('D:\BAMASIS POLTEKAD\POLTEKAD\POLTEKAD\TK 2\SEMESTER 3\DIRBINDIKJAR\KOM 8\PERCOBAAN 8 MEMBUAT APLIKASI PIANO\Percobaan 8\7.wav',SND_NODEFAULT OR SND_ASYNC);

shape1.Visible:=false;

shape2.Visible:=false;

shape3.Visible:=false;

shape4.Visible:=false;

shape5.Visible:=false;

shape6.Visible:=false;

shape7.Visible:=true;

shape8.Visible:=false;

shape9.Visible:=false;

shape10.Visible:=false;

shape11.Visible:=false;

shape12.Visible:=false;

shape13.Visible:=false;

shape14.Visible:=false;

shape15.Visible:=false;

end;


procedure TForm1.Button8Click(Sender: TObject);

begin

sndPlaysound('D:\BAMASIS POLTEKAD\POLTEKAD\POLTEKAD\TK 2\SEMESTER 3\DIRBINDIKJAR\KOM 8\PERCOBAAN 8 MEMBUAT APLIKASI PIANO\Percobaan 8\8.wav',SND_NODEFAULT OR SND_ASYNC);

shape1.Visible:=false;

shape2.Visible:=false;

shape3.Visible:=false;

shape4.Visible:=false;

shape5.Visible:=false;

shape6.Visible:=false;

shape7.Visible:=false;

shape8.Visible:=true;

shape9.Visible:=false;

shape10.Visible:=false;

shape11.Visible:=false;

shape12.Visible:=false;

shape13.Visible:=false;

shape14.Visible:=false;

shape15.Visible:=false;

end;


procedure TForm1.Button9Click(Sender: TObject);

begin

sndPlaysound('D:\BAMASIS POLTEKAD\POLTEKAD\POLTEKAD\TK 2\SEMESTER 3\DIRBINDIKJAR\KOM 8\PERCOBAAN 8 MEMBUAT APLIKASI PIANO\Percobaan 8\7.wav',SND_NODEFAULT OR SND_ASYNC);

shape1.Visible:=false;

shape2.Visible:=false;

shape3.Visible:=false;

shape4.Visible:=false;

shape5.Visible:=false;

shape6.Visible:=false;

shape7.Visible:=false;

shape8.Visible:=false;

shape9.Visible:=true;

shape10.Visible:=false;

shape11.Visible:=false;

shape12.Visible:=false;

shape13.Visible:=false;

shape14.Visible:=false;

shape15.Visible:=false;

end;


procedure TForm1.Edit1Change(Sender: TObject);

begin

if edit1.Text='q' then

begin

sndPlaysound('D:\BAMASIS POLTEKAD\POLTEKAD\POLTEKAD\TK 2\SEMESTER 3\DIRBINDIKJAR\KOM 8\PERCOBAAN 8 MEMBUAT APLIKASI PIANO\Percobaan 8\1.wav',SND_NODEFAULT OR SND_ASYNC);

shape1.Visible:=true;

shape2.Visible:=false;

shape3.Visible:=false;

shape4.Visible:=false;

shape5.Visible:=false;

shape6.Visible:=false;

shape7.Visible:=false;

shape8.Visible:=false;

shape9.Visible:=false;

shape10.Visible:=false;

shape11.Visible:=false;

shape12.Visible:=false;

shape13.Visible:=false;

shape14.Visible:=false;

shape15.Visible:=false;

edit1.Text:='';

end;


if edit1.Text='w' then

begin

sndPlaysound('D:\BAMASIS POLTEKAD\POLTEKAD\POLTEKAD\TK 2\SEMESTER 3\DIRBINDIKJAR\KOM 8\PERCOBAAN 8 MEMBUAT APLIKASI PIANO\Percobaan 8\2.wav',SND_NODEFAULT OR SND_ASYNC);

shape1.Visible:=false;

shape2.Visible:=true;

shape3.Visible:=false;

shape4.Visible:=false;

shape5.Visible:=false;

shape6.Visible:=false;

shape7.Visible:=false;

shape8.Visible:=false;

shape9.Visible:=false;

shape10.Visible:=false;

shape11.Visible:=false;

shape12.Visible:=false;

shape13.Visible:=false;

shape14.Visible:=false;

shape15.Visible:=false;

edit1.Text:='';

end;


if edit1.Text='e' then

begin

sndPlaysound('D:\BAMASIS POLTEKAD\POLTEKAD\POLTEKAD\TK 2\SEMESTER 3\DIRBINDIKJAR\KOM 8\PERCOBAAN 8 MEMBUAT APLIKASI PIANO\Percobaan 8\3.wav',SND_NODEFAULT OR SND_ASYNC);

shape1.Visible:=false;

shape2.Visible:=false;

shape3.Visible:=true;

shape4.Visible:=false;

shape5.Visible:=false;

shape6.Visible:=false;

shape7.Visible:=false;

shape8.Visible:=false;

shape9.Visible:=false;

shape10.Visible:=false;

shape11.Visible:=false;

shape12.Visible:=false;

shape13.Visible:=false;

shape14.Visible:=false;

shape15.Visible:=false;

edit1.Text:='';

end;


if edit1.Text='r' then

begin

sndPlaysound('D:\BAMASIS POLTEKAD\POLTEKAD\POLTEKAD\TK 2\SEMESTER 3\DIRBINDIKJAR\KOM 8\PERCOBAAN 8 MEMBUAT APLIKASI PIANO\Percobaan 8\4.wav',SND_NODEFAULT OR SND_ASYNC);

shape1.Visible:=false;

shape2.Visible:=false;

shape3.Visible:=false;

shape4.Visible:=true;

shape5.Visible:=false;

shape6.Visible:=false;

shape7.Visible:=false;

shape8.Visible:=false;

shape9.Visible:=false;

shape10.Visible:=false;

shape11.Visible:=false;

shape12.Visible:=false;

shape13.Visible:=false;

shape14.Visible:=false;

shape15.Visible:=false;

edit1.Text:='';

end;


if edit1.Text='t' then

begin

sndPlaysound('D:\BAMASIS POLTEKAD\POLTEKAD\POLTEKAD\TK 2\SEMESTER 3\DIRBINDIKJAR\KOM 8\PERCOBAAN 8 MEMBUAT APLIKASI PIANO\Percobaan 8\5.wav',SND_NODEFAULT OR SND_ASYNC);

shape1.Visible:=false;

shape2.Visible:=false;

shape3.Visible:=false;

shape4.Visible:=false;

shape5.Visible:=true;

shape6.Visible:=false;

shape7.Visible:=false;

shape8.Visible:=false;

shape9.Visible:=false;

shape10.Visible:=false;

shape11.Visible:=false;

shape12.Visible:=false;

shape13.Visible:=false;

shape14.Visible:=false;

shape15.Visible:=false;

edit1.Text:='';

end;


if edit1.Text='y' then

begin

sndPlaysound('D:\BAMASIS POLTEKAD\POLTEKAD\POLTEKAD\TK 2\SEMESTER 3\DIRBINDIKJAR\KOM 8\PERCOBAAN 8 MEMBUAT APLIKASI PIANO\Percobaan 8\6.wav',SND_NODEFAULT OR SND_ASYNC);

shape1.Visible:=false;

shape2.Visible:=false;

shape3.Visible:=false;

shape4.Visible:=false;

shape5.Visible:=false;

shape6.Visible:=true;

shape7.Visible:=false;

shape8.Visible:=false;

shape9.Visible:=false;

shape10.Visible:=false;

shape11.Visible:=false;

shape12.Visible:=false;

shape13.Visible:=false;

shape14.Visible:=false;

shape15.Visible:=false;

edit1.Text:='';

end;


if edit1.Text='u' then

begin

sndPlaysound('D:\BAMASIS POLTEKAD\POLTEKAD\POLTEKAD\TK 2\SEMESTER 3\DIRBINDIKJAR\KOM 8\PERCOBAAN 8 MEMBUAT APLIKASI PIANO\Percobaan 8\7.wav',SND_NODEFAULT OR SND_ASYNC);

shape1.Visible:=false;

shape2.Visible:=false;

shape3.Visible:=false;

shape4.Visible:=false;

shape5.Visible:=false;

shape6.Visible:=false;

shape7.Visible:=true;

shape8.Visible:=false;

shape9.Visible:=false;

shape10.Visible:=false;

shape11.Visible:=false;

shape12.Visible:=false;

shape13.Visible:=false;

shape14.Visible:=false;

shape15.Visible:=false;

edit1.Text:='';

end;


if edit1.Text='i' then

begin

sndPlaysound('D:\BAMASIS POLTEKAD\POLTEKAD\POLTEKAD\TK 2\SEMESTER 3\DIRBINDIKJAR\KOM 8\PERCOBAAN 8 MEMBUAT APLIKASI PIANO\Percobaan 8\8.wav',SND_NODEFAULT OR SND_ASYNC);

shape1.Visible:=false;

shape2.Visible:=false;

shape3.Visible:=false;

shape4.Visible:=false;

shape5.Visible:=false;

shape6.Visible:=false;

shape7.Visible:=false;

shape8.Visible:=true;

shape9.Visible:=false;

shape10.Visible:=false;

shape11.Visible:=false;

shape12.Visible:=false;

shape13.Visible:=false;

shape14.Visible:=false;

shape15.Visible:=false;

edit1.Text:='';

end;


if edit1.Text='a' then

begin

sndPlaysound('D:\BAMASIS POLTEKAD\POLTEKAD\POLTEKAD\TK 2\SEMESTER 3\DIRBINDIKJAR\KOM 8\PERCOBAAN 8 MEMBUAT APLIKASI PIANO\Percobaan 8\7.wav',SND_NODEFAULT OR SND_ASYNC);

shape1.Visible:=false;

shape2.Visible:=false;

shape3.Visible:=false;

shape4.Visible:=false;

shape5.Visible:=false;

shape6.Visible:=false;

shape7.Visible:=false;

shape8.Visible:=false;

shape9.Visible:=true;

shape10.Visible:=false;

shape11.Visible:=false;

shape12.Visible:=false;

shape13.Visible:=false;

shape14.Visible:=false;

shape15.Visible:=false;

edit1.Text:='';

end;


if edit1.Text='s' then

begin

sndPlaysound('D:\BAMASIS POLTEKAD\POLTEKAD\POLTEKAD\TK 2\SEMESTER 3\DIRBINDIKJAR\KOM 8\PERCOBAAN 8 MEMBUAT APLIKASI PIANO\Percobaan 8\6.wav',SND_NODEFAULT OR SND_ASYNC);

shape1.Visible:=false;

shape2.Visible:=false;

shape3.Visible:=false;

shape4.Visible:=false;

shape5.Visible:=false;

shape6.Visible:=false;

shape7.Visible:=false;

shape8.Visible:=false;

shape9.Visible:=false;

shape10.Visible:=true;

shape11.Visible:=false;

shape12.Visible:=false;

shape13.Visible:=false;

shape14.Visible:=false;

shape15.Visible:=false;

edit1.Text:='';

end;


if edit1.Text='d' then

begin

sndPlaysound('D:\BAMASIS POLTEKAD\POLTEKAD\POLTEKAD\TK 2\SEMESTER 3\DIRBINDIKJAR\KOM 8\PERCOBAAN 8 MEMBUAT APLIKASI PIANO\Percobaan 8\5.wav',SND_NODEFAULT OR SND_ASYNC);

shape1.Visible:=false;

shape2.Visible:=false;

shape3.Visible:=false;

shape4.Visible:=false;

shape5.Visible:=false;

shape6.Visible:=false;

shape7.Visible:=false;

shape8.Visible:=false;

shape9.Visible:=false;

shape10.Visible:=false;

shape11.Visible:=true;

shape12.Visible:=false;

shape13.Visible:=false;

shape14.Visible:=false;

shape15.Visible:=false;

edit1.Text:='';

end;


if edit1.Text='f' then

begin

sndPlaysound('D:\BAMASIS POLTEKAD\POLTEKAD\POLTEKAD\TK 2\SEMESTER 3\DIRBINDIKJAR\KOM 8\PERCOBAAN 8 MEMBUAT APLIKASI PIANO\Percobaan 8\4.wav',SND_NODEFAULT OR SND_ASYNC);

shape1.Visible:=false;

shape2.Visible:=false;

shape3.Visible:=false;

shape4.Visible:=false;

shape5.Visible:=false;

shape6.Visible:=false;

shape7.Visible:=false;

shape8.Visible:=false;

shape9.Visible:=false;

shape10.Visible:=false;

shape11.Visible:=false;

shape12.Visible:=true;

shape13.Visible:=false;

shape14.Visible:=false;

shape15.Visible:=false;

edit1.Text:='';

end;


if edit1.Text='g' then

begin

sndPlaysound('D:\BAMASIS POLTEKAD\POLTEKAD\POLTEKAD\TK 2\SEMESTER 3\DIRBINDIKJAR\KOM 8\PERCOBAAN 8 MEMBUAT APLIKASI PIANO\Percobaan 8\3.wav',SND_NODEFAULT OR SND_ASYNC);

shape1.Visible:=false;

shape2.Visible:=false;

shape3.Visible:=false;

shape4.Visible:=false;

shape5.Visible:=false;

shape6.Visible:=false;

shape7.Visible:=false;

shape8.Visible:=false;

shape9.Visible:=false;

shape10.Visible:=false;

shape11.Visible:=false;

shape12.Visible:=false;

shape13.Visible:=true;

shape14.Visible:=false;

shape15.Visible:=false;

edit1.Text:='';

end;


if edit1.Text='h' then

begin

sndPlaysound('D:\BAMASIS POLTEKAD\POLTEKAD\POLTEKAD\TK 2\SEMESTER 3\DIRBINDIKJAR\KOM 8\PERCOBAAN 8 MEMBUAT APLIKASI PIANO\Percobaan 8\2.wav',SND_NODEFAULT OR SND_ASYNC);

shape1.Visible:=false;

shape2.Visible:=false;

shape3.Visible:=false;

shape4.Visible:=false;

shape5.Visible:=false;

shape6.Visible:=false;

shape7.Visible:=false;

shape8.Visible:=false;

shape9.Visible:=false;

shape10.Visible:=false;

shape11.Visible:=false;

shape12.Visible:=false;

shape13.Visible:=false;

shape14.Visible:=true;

shape15.Visible:=false;

edit1.Text:='';

end;


if edit1.Text='j' then

begin

sndPlaysound('D:\BAMASIS POLTEKAD\POLTEKAD\POLTEKAD\TK 2\SEMESTER 3\DIRBINDIKJAR\KOM 8\PERCOBAAN 8 MEMBUAT APLIKASI PIANO\Percobaan 8\1.wav',SND_NODEFAULT OR SND_ASYNC);

shape1.Visible:=false;

shape2.Visible:=false;

shape3.Visible:=false;

shape4.Visible:=false;

shape5.Visible:=false;

shape6.Visible:=false;

shape7.Visible:=false;

shape8.Visible:=false;

shape9.Visible:=false;

shape10.Visible:=false;

shape11.Visible:=false;

shape12.Visible:=false;

shape13.Visible:=false;

shape14.Visible:=false;

shape15.Visible:=true;

edit1.Text:='';

end;

end;


end.


5. Hasil dan Pembahasan

    a.    Hasil










b.       Pembahasan

 

1)               TImage adalah komponen visual yang digunakan untuk menampilkan gambar pada form. Komponen ini memungkinkan gambar dari berbagai format (seperti BMP, JPG, PNG, dan GIF) ditampilkan dalam aplikasi.

2)               Tshape adalah salah satu komponen visual dalam Delphi yang digunakan untuk menggambar bentuk geometris sederhana seperti persegi panjang, lingkaran, elips, atau garis di dalam sebuah form atau container lainnya. TShape sangat berguna untuk membuat elemen visual yang sederhana.

3)               TButton digunakan untuk membuat tombol (button) di antarmuka pengguna. TButton memungkinkan pengguna untuk memicu suatu aksi atau perintah ketika tombol tersebut diklik. Tombol sangat berguna dalam aplikasi Delphi untuk menjalankan berbagai macam perintah.

4)               T Edit Dalam Delphi 8, fungsi t edit biasanya merujuk pada komponen TEdit, yang digunakan untuk membuat kontrol input teks di antarmuka pengguna




 6. Kesimpulan

          Dengan menggunakan Timage, Shape, Button dan Edit dapat berfungsi sebagai pembuatan aplikasi piano sederhana sesuai dengan nada dasar piano atau chord sehingga dapat digunakan untuk memainkan musik