SHOW:
|
|
- or go back to the newest paste.
1 | print("ari's piano - use qwerty to play (:") | |
2 | speaker = peripheral.find("speaker") | |
3 | while true do | |
4 | local event, key, isHeld = os.pullEvent("key") | |
5 | ||
6 | - | if key == keys.q then |
6 | + | if key == keys.q then |
7 | print ("G") | |
8 | - | elseif key == keys.two then |
8 | + | |
9 | elseif key == keys.two then | |
10 | - | elseif key == keys.w then |
10 | + | print ("G#") |
11 | speaker.playSound("minecraft:block.note_block.harp",2,.572) | |
12 | - | elseif key == keys.three then |
12 | + | elseif key == keys.w then |
13 | print ("A") | |
14 | speaker.playSound("minecraft:block.note_block.harp",2,.595) | |
15 | elseif key == keys.three then | |
16 | - | elseif key == keys.r |
16 | + | print ("A#") |
17 | - | then speaker.playSound("minecraft:block.note_block.harp",2,.71) |
17 | + | |
18 | - | elseif key == keys.five |
18 | + | |
19 | - | then speaker.playSound("minecraft:block.note_block.harp",2,.75) |
19 | + | print ("B") |
20 | - | elseif key == keys.t |
20 | + | |
21 | - | then speaker.playSound("minecraft:block.note_block.harp",2,.795) |
21 | + | elseif key == keys.r then |
22 | - | elseif key == keys.six |
22 | + | print ("C") |
23 | - | then speaker.playSound("minecraft:block.note_block.harp",2,.84) |
23 | + | speaker.playSound("minecraft:block.note_block.harp",2,.71) |
24 | - | elseif key == keys.y |
24 | + | elseif key == keys.five then |
25 | - | then speaker.playSound("minecraft:block.note_block.harp",2,.89) |
25 | + | print ("C#") |
26 | - | elseif key == keys.u |
26 | + | speaker.playSound("minecraft:block.note_block.harp",2,.75) |
27 | - | then speaker.playSound("minecraft:block.note_block.harp",2,.945) |
27 | + | elseif key == keys.t then |
28 | - | elseif key == keys.i |
28 | + | print ("D") |
29 | - | then speaker.playSound("minecraft:block.note_block.harp",2,1.0625) |
29 | + | speaker.playSound("minecraft:block.note_block.harp",2,.795) |
30 | elseif key == keys.six then | |
31 | print ("D#") | |
32 | speaker.playSound("minecraft:block.note_block.harp",2,.84) | |
33 | elseif key == keys.y then | |
34 | print ("E") | |
35 | speaker.playSound("minecraft:block.note_block.harp",2,.89) | |
36 | elseif key == keys.u then | |
37 | print ("F") | |
38 | speaker.playSound("minecraft:block.note_block.harp",2,.945) | |
39 | elseif key == keys.i then | |
40 | print ("F#") | |
41 | speaker.playSound("minecraft:block.note_block.harp",2,1.0625) | |
42 | ||
43 | end | |
44 | end |