Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!pasteur!ames!elroy!peregrine!ccicpg!cci632!rit!ritcv!dgr0093 From: dgr0093%ritcv@cs.rit.edu (340 Ok) Newsgroups: comp.lang.pascal Subject: Re: Any TurboPascal Sound Libraries Summary: Weall, here's one.. Message-ID: <1049@cs.rit.edu> Date: 13 Apr 89 02:29:15 GMT References: <19093@adm.BRL.MIL> Sender: news@cs.rit.edu Reply-To: dgr0093%ritcv@cs.rit.edu (Michelangelo H. Jones) Followup-To: comp.lang.pascal Distribution: usa Organization: Rochester Institute of Technology, Rochester, NY Lines: 73 In article <19093@adm.BRL.MIL> elder@wpafb-info2.arpa writes: >I am working on a war game written in Turbo Pascal 5.0. Does anyone know of >any sound libraries for Turbo-Pascal, or books with code for making various >sounds on IBM-PC compatible machines. Here's a good demo from my archives. I didn't write it, but I like it for certain applications. Yours sounds like it could use this. I think this was originally from PC Magazine, but I couldn't tell you which one. PROGRAM demo_for_noise; uses crt; var n: byte; procedure noise (start, {starting freq} stop, {ending freq} step, {step size} del, {times per step} times, {repeats of whole sound} pause {pause between repeats} : integer); var a, diff, z: integer; begin a:= start; diff := 0; z:= 0; for z:= 1 to times do begin sound(a); delay(del); nosound; repeat if start > stop then begin dec (a, step); diff := a-stop end else begin inc (a, step); diff := stop-a end; sound(a); delay(del); nosound until diff<0; a:= start; delay(pause) end end; begin clrscr; writeln ('NOISE.PAS By E. Kasey Kasemodel'); write ('01 '); noise (100, 50, 1, 15, 5, 100); delay(1000); write ('02 '); noise (100, 250, 10, 50, 3, 100); delay(1000); write ('03 '); noise (2000, 250, 50, 5, 2, 100); delay(1000); write ('04 '); noise (50, 2500, 50, 5, 4, 50); delay(1000); write ('05 '); noise (4000, 1000, 150, 3, 3, 50); noise (1000, 4000, 150, 3, 3, 50); delay(1000); write ('06 '); noise (1000, 6000, 100, 3, 5, 50); noise (4000, 250, 80, 3, 2, 75); noise (50, 5500, 133, 4, 2, 25); noise (2000, 1000, 60, 3, 3, 50); delay(1000); write ('07 '); noise (2000, 2400, 2, 2, 2, 50); delay(1000); write ('08 '); for n:=1 to 8 do begin noise (1000, 2000, 15, 2, 1, 0); noise (2000, 1000, 15, 2, 1, 0) end; delay(1000); write ('09 '); noise (1000, 2000, 500, 2, 200, 0) end. Good luck with your program! Michelangelo Jones.