Help: different sounds 
Author Message
 Help: different sounds

can any tell me how to make the speaker do different pitches?...i can
make it beep with the ansi code (the plain old speaker beep).



Wed, 18 Jun 1902 08:00:00 GMT  
 Help: different sounds

Quote:
BaliztiC ??) writes:>can any tell me how to make the speaker do different

pitches?...i can>make it beep with the ansi code (the plain old speaker

Try something like this:

program whir;

uses
  crt;

const
  LEN = 5;

var
  freq : word;

begin
  for freq := 1000 to 10000 do
    begin
      sound (freq);
      delay (LEN);
    end;
  for freq := 10000 downto 1000 do
     begin
       sound (freq);
       delay (LEN);
     end;
  nosound;
end.

Cheesy but neat.  :-)

--
Scott F. Earnest           | We now return you to our regularly scheduled



Wed, 18 Jun 1902 08:00:00 GMT  
 Help: different sounds

Quote:

>can any tell me how to make the speaker do different pitches?...i can
>make it beep with the ansi code (the plain old speaker beep).


        Try the Sound, NoSound, and Delay functions.

--
___________________________________________________________________
              -->  J E F F   W E N T W O R T H <---                |

                                                                   |
  "For there is no anonymous giver, except perhaps the guy who     |
   knocks up your daughter."                                       |
                                                                   |
       -- Lenny Bruce, "How to Talk Dirty and Influence People."   |
___________________________________________________________________|



Wed, 18 Jun 1902 08:00:00 GMT  
 Help: different sounds

Quote:
>can any tell me how to make the speaker do different pitches?...i can
>make it beep with the ansi code (the plain old speaker beep).


Turbo Pascal provides the excelent procedures Sound and NoSound.
Sound initiates a sound on the speaker, it takes only one parameter:
the frequency in Hz.
NoSound stops the sound.
Sound may be called repeatedly with different frequencies whitout
intervening NoSound calls to produce interesting effects.




Wed, 18 Jun 1902 08:00:00 GMT  
 Help: different sounds

Quote:


>=20
> >can any tell me how to make the speaker do different pitches?...i can
> >make it beep with the ansi code (the plain old speaker beep).

>=20
> Turbo Pascal provides the excelent procedures Sound and NoSound.
> Sound initiates a sound on the speaker, it takes only one parameter:
> the frequency in Hz.
> NoSound stops the sound.
> Sound may be called repeatedly with different frequencies whitout
> intervening NoSound calls to produce interesting effects.
>=20

>=20
>=20

I am not too sure, but I think that Sound requires the USES CRT at the
beginning.=20

*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<*
{    /^\    ****    /^\                                      }
{   |   |**/____\**|   |                                     }
{  /                    \   In a world of constant change    }
{ |   (-)         (-)    |  Only one thing remains the same; }
{  \__                __/   Fortunately, it's not the fox.   }
{  ----\-*        *-/----                                    }

{          \____/                                            }
{            **                      F O X M A N             }
*<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*



Wed, 18 Jun 1902 08:00:00 GMT  
 Help: different sounds

Quote:

> can any tell me how to make the speaker do different pitches?...i can
> make it beep with the ansi code (the plain old speaker beep).


Try:

   uses crt;

and,

   sound(440);        { speaker on for note "A" }
   delay(duration);   { wait for a while }
   nosound;           { turn the noise off }

Bob.



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

 Relevant Pages 

1. Help: different sounds

2. Help: different sounds

3. Different sounds with the beep-function???

4. Different output on different printer ???

5. Joining 2 different InterBase Tables with 2 different Database

6. Joining 2 different InterBase Tables with 2 different Database

7. Interbase:Different Privileges for Different Users?

8. Sound through sound blaster!

9. Playing 16 bit stereo sound trought sound card

10. Playing 16 bit stereo sound trought sound card

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

12. Help needed with printing QReports to different printers.

 

 
Powered by phpBB® Forum Software