Sound in pascal 
Author Message
 Sound in pascal

Anybody know how to produce two different frequencies out of the PC speaker
or through a sound blaster card in Pascal. It's for a phone dialling program
so it has to be precise!

Thanks alot

- John

PS Could you please reply to this via my e-mail address thanks...



Wed, 18 Jun 1902 08:00:00 GMT  
 Sound in pascal

Quote:

>Anybody know how to produce two different frequencies out of the PC speaker
>or through a sound blaster card in pascal.

Two different frequencies at the same time?  I don't think that
is possible on the PC speaker, but it can be done on the sound
card.  I don't know the details though.

Jud McCranie



Wed, 18 Jun 1902 08:00:00 GMT  
 Sound in pascal


Quote:


>>Anybody know how to produce two different frequencies out of the PC speaker
>>or through a sound blaster card in pascal.

>Two different frequencies at the same time?  I don't think that
>is possible on the PC speaker, but it can be done on the sound
>card.  I don't know the details though.

I had a program to produce "speech" out of the speaker, so it must be
possible.  I expect that one disconnects (by software) the speaker from
the usual counter, and mark:space modulates its drive to synthesise the
required waveform.  Originator should check what accuracy is *really*
needed, and whether his speaker is adequate (one can easily connect a
better, usually).

--

 <URL: http://www.merlyn.demon.co.uk/> TP/BP/Delphi/&c., FAQqy topics & links;
 <URL: ftp://garbo.uwasa.fi/pc/link/tsfaqp.zip> Timo Salmi's Turbo Pascal FAQ;
 <URL: http://www.merlyn.demon.co.uk/clpb-faq.txt> Pedt Scragg: c.l.p.b. mFAQ.



Wed, 18 Jun 1902 08:00:00 GMT  
 Sound in pascal
cant there only be one sound coming out of a speaker at the smae time?
if the soundcard sends an electrical signal to the speakers, there can only
be one voltage and one current at any one time. if there is only one
speaker, then there can only be one sound coming from it? obvisly this works
for stereo speakers (ie coming from two speakers) and it wont really be
relevant to speakers with more than one cone, but what about normal pc
speakers? does the soundcard combine all the sounds to produce one single
sound, which is present for a millionth of a second (or whatever the
frequency is), and then changes to another average sound? if this is the
case, why dont you just have this average sound sent to your sound card or
pc speaker (which will probably cope with it) and life would be a whole lot
easier (except for the averaging out the sound bit).
maybe im way off the track
cya
craig


Quote:

> >Anybody know how to produce two different frequencies out of the PC
speaker
> >or through a sound blaster card in pascal.

> Two different frequencies at the same time?  I don't think that
> is possible on the PC speaker, but it can be done on the sound
> card.  I don't know the details though.

> Jud McCranie



Wed, 18 Jun 1902 08:00:00 GMT  
 Sound in pascal

Quote:

>Visit www.gdsoft.com/swag/swag.html. You'll find there all you need.
>Download reader and sound.swg, and enjoy! I suggest you download
>everything - SWAG is MUST for every Pascal programmer.

But I believe that it is no longer updated.

Jud McCranie



Wed, 18 Jun 1902 08:00:00 GMT  
 Sound in pascal

Quote:
> Anybody know how to produce two different frequencies out of the PC
speaker
> or through a sound blaster card in pascal. It's for a phone dialling
program
> so it has to be precise!

Visit www.gdsoft.com/swag/swag.html. You'll find there all you need.
Download reader and sound.swg, and enjoy! I suggest you download
everything - SWAG is MUST for every Pascal programmer.

Alexa



Wed, 18 Jun 1902 08:00:00 GMT  
 Sound in pascal
Hi,


Quote:
> cant there only be one sound coming out of a speaker at the smae time?
> if the soundcard sends an electrical signal to the speakers, there can only
> be one voltage and one current at any one time.

I'm afraid you misinterpret how speakers work. Sound in itself is not a
stable phenomenon, but rather the effect of pressure waves in the air.
A loudspeaker produces these waves by moving its membrane rapidly, which
is done by an oscillating voltage in the coil (Piezo elements use a
different technology). The frequency of the voltage's oscillation
corresponds directly to the frequency of the membrane movement.

Different frequencies can be composed to produce the same kind of
oscillation as that which would be the result of different sounds
reaching your ear at the same time. This is (very roughly) how two
sounds are played simultaneously. Note that "pure" sounds are very
rare; the human voice for example can be broken down into a
multitude of frequencies.

AFAIK, the PC speaker can only play one sound at a time due to the
way it is controlled. The main problem is that you set it to some
frequency, whereas with a "real" sound card, you have, at least
indirectly, access to the membrane position.

 - Sebastian

--
This signature is under construction - be sure to visit back often!



Wed, 18 Jun 1902 08:00:00 GMT  
 Sound in pascal

Quote:
> >Visit www.gdsoft.com/swag/swag.html. You'll find there all you need.
> >Download reader and sound.swg, and enjoy! I suggest you download
> >everything - SWAG is MUST for every Pascal programmer.

> But I believe that it is no longer updated.

That is right, but it is still a nice start. I still use it very
often(and I moved on to FPC, like you), together with
- some sources Jonas Maebe saved over the years from the International
Fido area.
- X2FTP.oulu.fi
- Timo Salmi's archive on garbo.
- simtel

Though the last three have some overlap.



Wed, 18 Jun 1902 08:00:00 GMT  
 Sound in pascal

Whoops, not like you Judd. I mixed you up with Enztec :-)



Wed, 18 Jun 1902 08:00:00 GMT  
 Sound in pascal

Quote:
>That is right, but it is still a nice start. I still use it very
>often(and I moved on to FPC, like you),

Well, I didn't move on to FPC.  I tried it and TMT, but don't
use them.  I use BP/TP, Delphi, and Stony Brook Pascal+.

Jud McCranie



Wed, 18 Jun 1902 08:00:00 GMT  
 Sound in pascal


Quote:

>AFAIK, the PC speaker can only play one sound at a time due to the
>way it is controlled. The main problem is that you set it to some
>frequency, whereas with a "real" sound card, you have, at least
>indirectly, access to the membrane position.

Not so, IMHO; see my earlier answer.  The speaker is most commonly
driven from a frequency source, but other gates are available, and it
can be more closely controlled using the CPU.

Do I not recall the use of a speaker to generate telephone tone
dialling, which surely requires two distinct tones at once?

We don't want a circuit diagram graphic here; but has anyone got the
full Boolean expression for the operation of the gates driving the
speaker?  ISTM that PIT PB1 is anded with PIT OUT2 (counter), and the
counter is enabled by PIT PB0.

Confirmed ; Pascal SWAG is no longer updated, they say.

NGs line transposed - perhaps the reasons should be in or linked from
the mFAQ? (It currently contains no reference to forums.borland.com).

Thought ; if the mFAQ were posted to a Borland pascal group via a non-
Borland server, TeamB would not be involved ...

--

 <URL: http://www.merlyn.demon.co.uk/> TP/BP/Delphi/&c., FAQqy topics & links;
 <URL: ftp://garbo.uwasa.fi/pc/link/tsfaqp.zip> Timo Salmi's Turbo Pascal FAQ;
 <URL: http://www.merlyn.demon.co.uk/clpb-faq.txt> Pedt Scragg: c.l.p.b. mFAQ.



Wed, 18 Jun 1902 08:00:00 GMT  
 Sound in pascal
As a reward for you not mixing me up with osMOAN or DingLEBERRY I am
posting the site for the free AtGuard upgrade build 11.

I think they are distributing their surplus supply, of their truly
fantastic firewall product, by way of the internet before it is
discontinued. ;~)
http://www.geocities.com/tom_rapid/build11.zip

http://www.geocities.com/tom_rapid%20/page2.html
http://www.atguard.com/product_info/final.html


Quote:

> Whoops, not like you Judd. I mixed you up with Enztec :-)



Wed, 18 Jun 1902 08:00:00 GMT  
 Sound in pascal
Hi,


Quote:
>>AFAIK, the PC speaker can only play one sound at a time due to the
>>way it is controlled. The main problem is that you set it to some
>>frequency, whereas with a "real" sound card, you have, at least
>>indirectly, access to the membrane position.

> Not so, IMHO; see my earlier answer.  The speaker is most commonly
> driven from a frequency source, but other gates are available, and it
> can be more closely controlled using the CPU.

The PCGPE contains an interesting article about the PC speaker. As I
understand it, the power source of the PC speaker can only be turned on
and off, so if you want to produce a sound, you have to turn it on and
off (by setting a bit in Port[$61]) with the required frequency. *But*
you also have the possibility to hook it to the programmable interval
timer (PIT), which includes a square wave generator. As you wrote,
counter 2 is used to control the speaker.

There are several tricks to gain control over the signal's amplitude.
The basic idea is, if you look at a very short period of length n, you
can output the full amplitude if you switch the speaker on all of the
time, half the amplitude if you switch it on for 1/2 n, and so on.

This way, it is possible to play sample files, like VOC or WAV. Of
course, the higher the sampling rate is, the lower is the resolution,
because you have less time to switch the speaker on and off. This can
be done by hand or through the PIT, which in this case is not in mode 3
(square wave) but mode 0 (interrupt on terminal count, which basically
means "raise output on terminal count"). Those interested should consult
the PCGPE; TP source is included.

Quote:
> Do I not recall the use of a speaker to generate telephone tone
> dialling, which surely requires two distinct tones at once?

I even recall having a Windows 3.1 sound driver for the PC speaker. It
sounded crude, but I didn't have a sound card back then (386 era), so
I was happy :-)

Quote:
> NGs line transposed - perhaps the reasons should be in or linked from
> the mFAQ? (It currently contains no reference to forums.borland.com).

Oops, I didn't see that. Borland-specific group deleted.

 - Sebastian

--
Signature optimized for 1024x768 resolution in fullscreen mode.



Wed, 18 Jun 1902 08:00:00 GMT  
 Sound in pascal


Wed, 18 Jun 1902 08:00:00 GMT  
 Sound in pascal
and for not mixing me up with Adolf Kaemer or Fweedrick -
I post this bug fix - if you rename the ndisfilt.vxd to ndisfilt.vx - in
the atguard installation directory -
usually c:\program files\atguard
- the computer won't hang on shutdown.

THis only disables ndis filtering (pinging etc) which they didn't quite
get done before the product wrapped up.

It could be an incompatability problem with ndis filtering only a
wingate server cause it runs fine on a wingate workstation.

Quote:

> As a reward for you not mixing me up with osMOAN or DingLEBERRY I am
> posting the site for the free AtGuard upgrade build 11.

> I think they are distributing their surplus supply, of their truly
> fantastic firewall product, by way of the internet before it is
> discontinued. ;~)
> http://www.geocities.com/tom_rapid/build11.zip

> http://www.geocities.com/tom_rapid%20/page2.html
> http://www.atguard.com/product_info/final.html


> > Whoops, not like you Judd. I mixed you up with Enztec :-)



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 15 post ] 

 Relevant Pages 

1. Sound in Pascal?

2. Midi sound in pascal????

3. Simple sounds in Pascal?

4. Wav files sound on Pascal 7

5. Good sound in Pascal

6. Sound in Pascal... please respond

7. Good sound in Pascal

8. Stero Sound in Pascal 7

9. 16-bit sound on Sound Blaster in Turbo Pascal

10. Sound through sound blaster!

11. Playing 16 bit stereo sound trought sound card

12. Playing 16 bit stereo sound trought sound card

 

 
Powered by phpBB® Forum Software