Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Building a music game

Author
Message
vid1987
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Oklahoma
Posted: 6th Jan 2005 01:30
Hello i\'m vid and i\'m new to dark basic and i\'m trying to build a music game. I\'m trying to get the game to program my keyboard to play midi sounds by pressing keys on teh keyboard. It\'s going through without any errors but when i press the keys it wont play teh sounds. Someone please look at teh code below and tell me what i\'m doing wrong. I would really appreciate it if someone would give me a code i could use or tell me how to fix the 1 i have. Peace

Vid
vid1987
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Oklahoma
Posted: 6th Jan 2005 02:35
Sync On
Sync Rate 30
Backdrop on

load music "C:/1.mid",2

if leftkey()=1 then play music 2

Do

Sync
Loop

Vid
vid1987
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Oklahoma
Posted: 6th Jan 2005 02:43
it wont let me type in teh code

Vid
vid1987
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Oklahoma
Posted: 6th Jan 2005 02:43
wtf

Vid
demons breath
21
Years of Service
User Offline
Joined: 4th Oct 2003
Location: Surrey, UK
Posted: 6th Jan 2005 04:04
Put the source in the message using the 'code' button - the source button doesn't work.

Am I the only one here who's really confused?
http://db1games.topcities.com
(used to be demonsbreath)
vid1987
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Oklahoma
Posted: 6th Jan 2005 04:36
alright i got it working it has a few flaws.. like when you press a key you have to press the left key to stop a note. the notes wont work for anybody else because they're only saved on my computer but heres teh code anyways


Vid
vid1987
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Oklahoma
Posted: 7th Jan 2005 02:30
hello

Vid
Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 7th Jan 2005 09:39
Try this:





vid1987
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Oklahoma
Posted: 8th Jan 2005 02:09
Hey hey hey!! OMG it works thx buddy now i just need to add some media and maybe some graphics can you help me out there??

Vid
Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 8th Jan 2005 05:19
I think this will speed it up:



sync on : sync rate 0

load music "C:/p.mid",1
load music "C:/2.mid",2
load music "C:/3.mid",3
load music "C:/4.mid",4
load music "C:/5.mid",5
load music "C:/6.mid",6
load music "C:/7.mid",7
load music "C:/8.mid",8
load music "C:/9.mid",9
load music "C:/10.mid",10
load music "C:/11.mid",11
load music "C:/12.mid",12
load music "C:/13.mid",13

Do

If keystate(30) = 1 then play music 1 else stop music 1
If keystate(31) = 1 then play music 2 else stop music 2
If keystate(18) = 1 then play music 3 else stop music 3
If keystate(32) = 1 then play music 4 else stop music 4
If keystate(19) = 1 then play music 5 else stop music 5
If keystate(33) = 1 then play music 6 else stop music 6
If keystate(20) = 1 then play music 7 else stop music 7
If keystate(36) = 1 then play music 8 else stop music 8
If keystate(37) = 1 then play music 9 else stop music 9
If keystate(21) = 1 then play music 10 else stop music 10
If keystate(38) = 1 then play music 11 else stop music 11
If keystate(22) = 1 then play music 12 else stop music 12
If keystate(39) = 1 then play music 13 else stop music 13

sync
Loop

Login to post a reply

Server time is: 2024-11-27 18:36:46
Your offset time is: 2024-11-27 18:36:46