music

If you have questions about any aspect of QBasic programming, or would like to help fellow programmers solve their problems, check out this board!

Moderators: Pete, Mods

Post Reply
D.S
Coder
Posts: 38
Joined: Wed Sep 14, 2005 7:37 am

music

Post by D.S »

I've noticed that some games have a bass and melody line both being played with what seems to be the QB PLAY command. Let me put this another way. Is it possible to have a bass and melody line using only the PLAY command?
Steve

Post by Steve »

Sure, if you know your music.

Code: Select all


                 Play c4
                    ^     ^
  The command  Plays note C in eights

:wink:
Nodtveidt
Veteran
Posts: 826
Joined: Sun Jul 25, 2004 4:24 am
Location: Quebradillas, PR
Contact:

Post by Nodtveidt »

Using tone toggling (playing two notes in rapid succession) is how it's usually done with PLAY.
Mary

Music

Post by Mary »

can you give the code again? something doesn't work
User avatar
{Nathan}
Veteran
Posts: 1169
Joined: Thu Aug 19, 2004 6:08 pm
Location: The wetlands of central Ohio, USA
Contact:

Post by {Nathan} »

I am not sure what you mean, but just check QB's inline help, it really is pretty thourough. Also, mate, it needs to be in quotes cuz its a string.
Image
User avatar
matt2jones
Veteran
Posts: 80
Joined: Sat Feb 19, 2005 8:29 am
Location: elsewhere
Contact:

Post by matt2jones »

but just check QB's inline help, it really is pretty thourough.
It doesn't cover this.
Play "c4"
Plays the note C for 1/4 the length of time that PLAY "C" plays it for.

matt
Do not mistake Apathy for feeling Content.

http://www.disjointed.cjb.net - Short Storys
http://matt2jones.deviantart.com - Random Art
http://www.freewebs.com/matt2jones - WebComic
MARY

Looking for the bass

Post by MARY »

Yes but it gives only one sound and not as I understood the note and its bass?
Guest
Veteran
Posts: 128
Joined: Sun Aug 14, 2005 8:33 pm
Location: Forest Lake, MN
Contact:

Post by Guest »

The only way to do it is through tone toggling. The PC speaker has only one channel. You must learn to program the sound card in order to play both a bass line, and a melody, plus an additional amount of channels(that I coul not tell you because chances are my PC has a different sound card than yours...).
Guest

Post by Guest »

ok does anywhere know the actual note values or will i have to figure it out?
as in
sound 520, 50 is playing C from 2nd octave up from middle C for 50 miliseconts
now i need C# D D# and so on or will i have to figure them out myself
Post Reply