-
Notifications
You must be signed in to change notification settings - Fork 0
/
drumkit.cpp
79 lines (73 loc) · 1.52 KB
/
drumkit.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#include<iostream>
#include<Windows.h>
#include"MMSystem.h"
#include<conio.h>
using namespace std;
int main()
{
char c;
cout<<"*******VIRTUAL DRUM KIT*******"<<endl;
cout<<"Press the following keys to produce sounds of a drum kit"<<endl;
cout<<"a.Closed hihats"<<endl;
cout<<"s.Closed hihats with kick"<<endl;
cout<<"d.Open hihats"<<endl;
cout<<"b.Kick"<<endl;
cout<<"x.Snare"<<endl;
cout<<"p.Crash1"<<endl;
cout<<"o.crash2"<<endl;
cout<<"y.Drumroll"<<endl;
cout<<"e,r,t.Toms"<<endl;
cout<<"z.EXIT"<<endl;
while(c!='z')
{
c=getch();
if(c=='b')
{
PlaySound(TEXT("B.wav"), NULL, SND_SYNC);
}
if(c=='x')
{
PlaySound(TEXT("SNARE.wav"), NULL, SND_SYNC);
}
if(c=='a')
{
PlaySound(TEXT("HIHAT(CSD).wav"), NULL, SND_SYNC);
}
if(c=='s')
{
PlaySound(TEXT("HIHATnB.wav"), NULL, SND_SYNC);
}
if(c=='d')
{
PlaySound(TEXT("HIHATS(OPN).wav"), NULL, SND_SYNC);
}
if(c=='p')
{
PlaySound(TEXT("CRASH1.wav"), NULL, SND_SYNC);
}
if(c=='o')
{
PlaySound(TEXT("CRASH2.wav"), NULL, SND_SYNC);
}
if(c=='e')
{
PlaySound(TEXT("TOM1.wav"), NULL, SND_SYNC);
}
if(c=='r')
{
PlaySound(TEXT("TOM2.wav"), NULL, SND_SYNC);
}
if(c=='t')
{
PlaySound(TEXT("TOM3.wav"), NULL, SND_SYNC);
}
if(c=='y')
{
PlaySound(TEXT("TOM1.wav"), NULL, SND_SYNC);
PlaySound(TEXT("TOM2.wav"), NULL, SND_SYNC);
PlaySound(TEXT("TOM3.wav"), NULL, SND_SYNC);
PlaySound(TEXT("SNARE.wav"), NULL, SND_SYNC);
PlaySound(TEXT("CRASH2.wav"), NULL, SND_SYNC);
}
}
}