Posts: 3,288
Threads: 167
Joined: Nov 2001
Hey guys, a bunch of college students wanted to know if you can play music using TurboC++?
They say its kinda like our "Play" statement. :*)
BTW, They also need a "Calendar" proggie. :*)
Posts: 6,419
Threads: 74
Joined: Mar 2002
You have to code it yourself, I mean, you have to communicate with the speaker in low level and write the parser for the "PLAY - alike" notation.
Posts: 3,616
Threads: 287
Joined: Jan 2003
Hm...I believe one of Turbo's non-ANSI library functions plays a note for a specified duration and frequency...so you could use that and just tinker, find out which frequencies turn out to be A, B, etc.
f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.
Posts: 1,752
Threads: 21
Joined: Jun 2002
You can use sound(
frequency), delay(milliseconds) and nosound() to play notes in TC/BC. (They're in DOS.H)
Posts: 3,616
Threads: 287
Joined: Jan 2003
I knew it! I knew it!
hifty:
f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.
Posts: 4,307
Threads: 63
Joined: May 2003
Zack: meh
You could use the table provided by Plasma to write a function which accepts a string and then parses it to play the 'music'.
Posts: 3,616
Threads: 287
Joined: Jan 2003
Just trying to show off my nerdiness, no other braggadocio implied...
f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.
Posts: 4,307
Threads: 63
Joined: May 2003
Posts: 3,288
Threads: 167
Joined: Nov 2001
Quote:You can use sound(frequency), delay(milliseconds) and nosound() to play notes in TC/BC. (They're in DOS.H)
Okay, I don't have TurboC++ But would QuickC suffice?
I mean the calling procedures look different.
I'll try to find a book an learn C to see what I can do.
Just yesterday, I help another bunch of students with their turbo pascal proggie. A baking proggie, not really hard as I had lil experience in Turbo pascal already. :*)
But C? I have 0 knowledge. :*(
I just want to help these students seeing how they persevere to know stuff. :*)
Posts: 6,419
Threads: 74
Joined: Mar 2002
I suggested to bear directly with hardware 'cause these functions only work in BorlandC. BorlandC can be evil: it features tons and tons of non portable functions, so it is very usual that BorlandC code doesn't work anywhere else.