Jump to content

Simple way to play a sound at a certain wavelength


Recommended Posts

Back in the old days of the TI-99/4A and the Commodore 16, there were simple ways to play the sounds of certain notes....something like play(440,2 sec) (I know that is not exact). Maybe it was in Basic. Have we lost these simple ways completely? All I can find are these complex scripts to write midi files or translate text to midi.

Link to comment
Share on other sites

If you don't find anything better, here is a C program that you can compile with gcc:

 

http://www.lns.com/papers/tonegen/

 

I just compiled it so I know it works. Only edit I had to make was to change the reference for soundcard.h from

 

#include <machine/soundcard.h>

 

to

 

#include <sys/soundcard.h>

 

Compile command:

 

gcc -lm -o tonegen tonegen.c

 

There were a couple of compiler warnings but it compiled and ran ok.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...