-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInstrument.pde
More file actions
54 lines (44 loc) · 809 Bytes
/
Copy pathInstrument.pde
File metadata and controls
54 lines (44 loc) · 809 Bytes
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
import processing.sound.*;
Sound s;
Piano piano;
char[] keys = {'q','s','d','f','g','h','j','k','l','m','ù','*','w','x','c','v','b','n',',',';',':','!'};
void setup() {
background(0,0,0);
fullScreen();
//size(500,200);
piano = new Piano(0,300,width,height-600);
}
void draw() {
piano.Draw();
}
void keyTyped() {
int i = 0;
for(i=0; (i<22);i++)
{
if(keys[i]==key)
{
piano.Play(i);
}
}
}
void keyReleased() {
int i = 0;
/*
for(i=0; (i<12);i++)
{
if((keys[i]==key)&&(note_pressed[i]==true))
{
note_pressed[i] &= false;
note.get(i).stop();
}
}
*/
for(i=0; (i<22);i++)
{
if(keys[i]==key)
{
//env.play(note.get(i), attackTime, sustainTime, sustainLevel, releaseTime);
piano.Stop(i);
}
}
} //<>//