Heres a keyboard program I just made;
SYNC ON:SYNC RATE 0:AUTOCAM OFF
LOAD DLL "Kernel32",3
FOR x = 1 TO 10
MAKE OBJECT BOX x,10,5,50
POSITION OBJECT x,-75+((x-1)*15),0,0
NEXT x
MAKE OBJECT BOX 11,170,5,70
POSITION OBJECT 11,0,-2.5,15
COLOR OBJECT 11,RGB(000,000,000)
POSITION CAMERA 0,200,0
POINT CAMERA 0,0,0
TYPE songStat
freq
ENDTYPE
DIM song(200) AS songStat
currentKey = 1
keyHit = 0
key# = 0
DO
click = MOUSECLICK()
IF click
IF click = 1
PICK SCREEN MOUSEX(),MOUSEY(),500
mx# = CAMERA POSITION X()+GET PICK VECTOR X()
my# = CAMERA POSITION Y()+GET PICK VECTOR Y()
mz# = CAMERA POSITION Z()+GET PICK VECTOR Z()
FOR x = 1 TO 10
key# = INTERSECT OBJECT(x,0,200,0,mx#,my#,mz#)
IF key#
keyHit = x
EXIT
ENDIF
NEXT x
IF keyHit
CALL DLL 3,"Beep",keyHit*100,200
song(currentKey).freq = keyhit*100
INC currentKey
keyHit = 0
ENDIF
ENDIF
IF click = 2
FOR x = 1 TO currentKey
song(x).freq = 0
NEXT x
currentKey = 1
ENDIF
ENDIF
IF SPACEKEY() THEN playSong = 1
IF playSong
FOR x = 1 TO currentKey
CALL DLL 3,"Beep",song(x).freq,200
NEXT x
playSong = 0
ENDIF
TEXT 0,0,"Click the keys. Press space to replay your song. Rightclick to start over."
TEXT 0,15,"Current Note: "+STR$(currentKey)+"/ 200"
SYNC
LOOP
Its sloppy, but it works. It lets you hit the keys to make different sounds, and then press space to play back what you've recorded. The only thing its really missing is a counter to record the time delay between each key hit, but I got bored.
I never knew using the internal beeps was that easy
.