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.

Code Snippets / QBasic "play" command in DBP

Author
Message
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 16th Jul 2006 20:28 Edited at: 16th Jul 2006 20:29
It doesn't use the same syntax, but its the same basic concept.

L1 = whole note
L2 = half note
L4 = quarter note
L8 = 8th note
L16 = 16th note

The very first command must be tempo, "T" followed by a number.
T120 = tempo of 120bpm.

Next, comes the note data. Each note is preceeded by its length.

L2B4 = a half note of B4

Notes were matched with their frequencies using this page.
http://www.phys.unsw.edu.au/~jw/notes.html


Original code by Ric and a few others, post can be found here.
http://forum.thegamecreators.com/?m=forum_view&t=49008&b=6&p=0


What this code does exactly is writes all the notes to a single sound file. Until someone manages to figure out how to use different channels, only 1 note can be played at a time.


The song I put in for a demo is suppose to be moonlight sonata. But it doesn't sound like much without chords, since the intro is mostly the same 3 notes over and over with just a different bass note under it.




"Using Unix is the computing equivalent of listening only to music by David Cassidy" - Rob Pike
Hobgoblin Lord
19
Years of Service
User Offline
Joined: 29th Oct 2005
Location: Fall River, MA USA
Posted: 16th Jul 2006 21:33
Not the most stirring rendidtion I have heard but still very good work here, C64 had a set of code alot like this years ago, I still remember sitting and coding in Metallica's Four Hoursemen for days. Thank goodness for .wav, .mid, .mp3 and anything else now.

http://www.cafepress.com/blackarrowgames
Check out my great stuff here
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 16th Jul 2006 22:24
I did master of puppets back in QB4.5, it does take quite a bit of time.

"Using Unix is the computing equivalent of listening only to music by David Cassidy" - Rob Pike
The end is near
19
Years of Service
User Offline
Joined: 19th Jun 2005
Location: USA
Posted: 20th Jul 2006 00:46
hey, phaelax. It closes for me. why?
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 20th Jul 2006 05:25 Edited at: 20th Jul 2006 05:26
no idea. I'm using DB 5.8. Check your DB TEMP folder for a CrashOn_??? text log report.

"Using Unix is the computing equivalent of listening only to music by David Cassidy" - Rob Pike
sneaky smith12
18
Years of Service
User Offline
Joined: 30th Apr 2006
Location: Like id tell you, oh wait i just did
Posted: 25th Jul 2006 20:27
Great work you have here. I liked that silly old play command in Qb4.5.

I acctually programed a few songs on to QB.

Starwars Theme (it always messed up ending)
Empiral March (Worked the best, had to use stacotto the entire song)

Then forgot the name of the other song... lol i really should of put actual names on them other than song1 song2 and song 3.

Still got them and it took me forever to get them all to that. I used sheet music from a trumpet solo of all the songs (other hobbies include watching sci-fi movies and playing the trumpet).

If at first you dont succeed, LOWER YOUR STANDARDS.

Login to post a reply

Server time is: 2024-11-23 03:44:02
Your offset time is: 2024-11-23 03:44:02