The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: ChillyWilly on February 26, 2010, 03:48:28 AM

Title: 32bit Tone Generation?
Post by: ChillyWilly on February 26, 2010, 03:48:28 AM
A little nostalgia here  :U
Is it possible to create different frequency tones in windows
there used to be old DOS,commodore tone generators from the old bbs days
I havent seen any examples on how to do this in Windows though
is there any examples kicking around anywhere to look into?
Title: Re: 32bit Tone Generation?
Post by: MichaelW on February 26, 2010, 06:33:48 AM
If it's supported on your system, you can use the Beep function:

http://msdn.microsoft.com/en-us/library/ms679277(VS.85).aspx


Title: Re: 32bit Tone Generation?
Post by: dedndave on February 26, 2010, 11:20:23 AM
direct i/o to the counter/timer probably requires ring 0 access privilege level
it might be easier to play it as a midi file
midi file format is fairly simple
Title: Re: 32bit Tone Generation?
Post by: PBrennick on February 26, 2010, 01:09:28 PM
I guess you will recall that this was done by sending commands to the DAC. If it is at all possible you may try googling "programming the DAC". (include the quotes)

Paul
Title: Re: 32bit Tone Generation?
Post by: BlackVortex on February 26, 2010, 05:24:21 PM
Yep, Vista and newer don't allow easy access to the PC speaker, forget that, better try some instrumentation (midi)

This is the awesomest library to play around with :
http://ufmod.sourceforge.net/

The features are unreal ! So is usability. It's written in freaking assembly  \m/
Title: Re: 32bit Tone Generation?
Post by: oex on February 26, 2010, 05:37:52 PM
 ::) Trojan found in dl.... Reportedly
Title: Re: 32bit Tone Generation?
Post by: BlackVortex on February 26, 2010, 06:08:40 PM
My magic powers tell me your antivirus sucks. Don't post things like that  :naughty:
Title: Re: 32bit Tone Generation?
Post by: ChillyWilly on February 27, 2010, 01:23:27 AM
yea what i did originally was program with it using PLAYSOUND and have the .wavs in the .rc
that was a nice program on the winasm forums that allows you to inject a fake .wav header on an .mp3 and still play it as a .wav

so that allowed me to use smaller mp3's in my app and keep the file size down

but was looking for a better way to create the tones programatically
Title: Re: 32bit Tone Generation?
Post by: dedndave on February 27, 2010, 03:06:27 AM
if you just want tones, midi is the way to go - the files are much smaller than a wav or mp3 to make the same notes
midi has it's limitations - it can't reproduce a soundtrack, for example
but for simple tones - it is a breeze
entries can specify the frequency and the duration - no need to carry all the DAC audio information
Title: Re: 32bit Tone Generation?
Post by: shill on March 07, 2010, 06:22:42 AM
Quote from: BlackVortex on February 26, 2010, 05:24:21 PM
Yep, Vista and newer don't allow easy access to the PC speaker, forget that, better try some instrumentation (midi)

This is the awesomest library to play around with :
http://ufmod.sourceforge.net/

The features are unreal ! So is usability. It's written in freaking assembly  \m/

I love XM format. It gives you more freedom than MIDI, but it's still smaller than MP3.

You may also be interested in CSound (http://csound.sourceforge.net).