mersenneforum.org  

Go Back   mersenneforum.org > Extra Stuff > Programming

Reply
 
Thread Tools
Old 2013-02-22, 14:45   #1
davar55
 
davar55's Avatar
 
May 2004
New York City

3·17·83 Posts
Default tones from c programs

I wrote two programs about ten years ago, in C, w95, using c5.5.
One (TG) is a tone generator, generating random or patterned
tone sequences. The other (PIANO) turns the typewriter keyboard
into a primitive piano.

Now I can't get them to work on my new w8, using c5.5.1. The
old exes won't run, being x86, not x64, and the linker doesn't find the
code functions I used, namely sound(), delay(), and nosound().
They used to be in <dos.h>.

Should I be looking in another header file, or have the functions been
changed in name or arguments? Any suggestions would be appreciated.
davar55 is offline   Reply With Quote
Old 2013-02-22, 15:09   #2
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

203008 Posts
Default

Quote:
Originally Posted by davar55 View Post
I wrote two programs about ten years ago, in C, w95, using c5.5.
One (TG) is a tone generator, generating random or patterned
tone sequences. The other (PIANO) turns the typewriter keyboard
into a primitive piano.

Now I can't get them to work on my new w8, using c5.5.1. The
old exes won't run, being x86, not x64, and the linker doesn't find the
code functions I used, namely sound(), delay(), and nosound().
They used to be in <dos.h>.

Should I be looking in another header file, or have the functions been
changed in name or arguments? Any suggestions would be appreciated.
one suggestion I found in google searching is:

Sleep() for delay() and
Beep() for sound()+delay()+nosound()

as replacements,
science_man_88 is offline   Reply With Quote
Old 2013-02-22, 15:15   #3
davar55
 
davar55's Avatar
 
May 2004
New York City

3·17·83 Posts
Default

Quote:
Originally Posted by science_man_88 View Post
one suggestion I found in google searching is:

Sleep() for delay() and
Beep() for sound()+delay()+nosound()

as replacements,
Wow. Thanks. I had tried Google, but w/o success.
I will certainly try those out.
Thanks for the rapid assistance.
davar55 is offline   Reply With Quote
Old 2013-02-22, 16:01   #4
davar55
 
davar55's Avatar
 
May 2004
New York City

3·17·83 Posts
Default

Quote:
Originally Posted by davar55 View Post
Wow. Thanks. I had tried Google, but w/o success.
I will certainly try those out.
Thanks for the rapid assistance.
Well, I did a search thru my header files and couldn't
find any definition for beep. Did your search tell you
which header files were needed for beep?

I'll re-try google too.
davar55 is offline   Reply With Quote
Old 2013-02-22, 16:48   #5
henryzz
Just call me Henry
 
henryzz's Avatar
 
"David"
Sep 2007
Cambridge (GMT/BST)

133568 Posts
Default

Quote:
Originally Posted by davar55 View Post
Well, I did a search thru my header files and couldn't
find any definition for beep. Did your search tell you
which header files were needed for beep?

I'll re-try google too.
If it was dos.h, I would suggest looking in windows.h
henryzz is online now   Reply With Quote
Old 2013-02-22, 17:01   #6
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

838410 Posts
Default

Quote:
Originally Posted by davar55 View Post
Well, I did a search thru my header files and couldn't
find any definition for beep. Did your search tell you
which header files were needed for beep?

I'll re-try google too.

http://msdn.microsoft.com/en-us/libr...=vs.85%29.aspx

says WinBase.h (include Windows.h) for Beep
Sleep appears to be in kernel32.lib so not sure of the header since I haven't tried anything c related in a long while and was never very good. in fact it was mostly reading I think.

Last fiddled with by science_man_88 on 2013-02-22 at 17:09
science_man_88 is offline   Reply With Quote
Old 2013-02-22, 18:02   #7
ET_
Banned
 
ET_'s Avatar
 
"Luigi"
Aug 2002
Team Italia

10010110011102 Posts
Default

If you have to rebuild your programs, why not trying to link a sound library?

You could start with a beep, and then add more sophisticated souds...


Luigi
ET_ is offline   Reply With Quote
Old 2013-02-22, 19:55   #8
davar55
 
davar55's Avatar
 
May 2004
New York City

3×17×83 Posts
Default

Quote:
Originally Posted by henryzz View Post
If it was dos.h, I would suggest looking in windows.h
I've now looked for beep in windows.h, winapi.h, winbase.h,
winuser.h, and did a general disk scan (search).
I couldn't find function prototypes for beep (or sound).
davar55 is offline   Reply With Quote
Old 2013-02-22, 19:57   #9
davar55
 
davar55's Avatar
 
May 2004
New York City

102118 Posts
Default

Quote:
Originally Posted by ET_ View Post
If you have to rebuild your programs, why not trying to link a sound library?

You could start with a beep, and then add more sophisticated souds...
i
Sounds like a good project for the future. Thx.
davar55 is offline   Reply With Quote
Old 2013-02-22, 21:30   #10
davar55
 
davar55's Avatar
 
May 2004
New York City

3×17×83 Posts
Default

Quote:
Originally Posted by science_man_88 View Post
...
says WinBase.h (include Windows.h) for Beep
Sleep appears to be in kernel32.lib so not sure of the header since I haven't tried anything c related in a long while and was never very good. in fact it was mostly reading I think.
I tried using both .h files, and the compilation still failed to find
beep() to resolve the references in my code.
If I find beep() I won't need sleep() in the TG program,
so sleep() can remain on my tofind list.
davar55 is offline   Reply With Quote
Old 2013-02-22, 21:48   #11
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26·131 Posts
Default

Quote:
Originally Posted by davar55 View Post
I tried using both .h files, and the compilation still failed to find
beep() to resolve the references in my code.
If I find beep() I won't need sleep() in the TG program,
so sleep() can remain on my tofind list.
for short beeps I've seen \a or \7 being used. I'll keep looking.
science_man_88 is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Stand alone GPU programs? siegert81 GPU Computing 3 2017-04-20 09:46
GPU Testing programs nucleon GPU Computing 5 2011-08-21 04:24
nfsnet programs henryzz NFSNET Discussion 2 2007-11-06 14:59
factoring programs henryzz Factoring 6 2007-09-19 13:47
Two programs on same machine? Unregistered Software 14 2004-02-15 16:36

All times are UTC. The time now is 21:06.

Tue May 11 21:06:00 UTC 2021 up 33 days, 15:46, 0 users, load averages: 2.03, 2.17, 2.00

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.