🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.sys.ibm.pc.programmer
9 messages
9 total messages Started by Chris Rende Mon, 05 Mar 1990 15:14
Need routine(s) to generate sound for MSC 5.1
#1450
Author: Chris Rende
Date: Mon, 05 Mar 1990 15:14
15 lines
936 bytes
I need a routine that generates sound from MSC 5.1: A beep, a tone/duration,
play a script, etc...

Please post or Email: I have not FTP or Aonon UUCP ability.

If there is interest and I receive some code I'll post a summary.

Thanks,

car.
-- 
Christopher A. Rende           Central Cartage (Nixdorf/Pyramid/SysVR2/BSD4.3)
uunet!edsews!rphroy!trux!car   Multics,DTSS,Unix,Shortwave,Scanners,StarTrek
 trux!car@uunet.uu.net         Minix 1.2,PC/XT,Mac+,TRS-80 Model I,1802 ELF
       "I don't ever remember forgetting anything." - Chris Rende
Re: Need routine(s) to generate sound for MSC 5.1
#1457
Author: Usenet file owner
Date: Tue, 06 Mar 1990 01:47
76 lines
3114 bytes
In article <365@trux.UUCP> car@trux.UUCP (Chris Rende) writes:
>I need a routine that generates sound from MSC 5.1: A beep, a tone/duration,
>play a script, etc...
>
>Please post or Email: I have not FTP or Aonon UUCP ability.
>
>If there is interest and I receive some code I'll post a summary.
>
>Thanks,
>
>car.
>-- 
>Christopher A. Rende           Central Cartage (Nixdorf/Pyramid/SysVR2/BSD4.3)
>uunet!edsews!rphroy!trux!car   Multics,DTSS,Unix,Shortwave,Scanners,StarTrek
> trux!car@uunet.uu.net         Minix 1.2,PC/XT,Mac+,TRS-80 Model I,1802 ELF
>       "I don't ever remember forgetting anything." - Chris Rende

Here's a little something. I can't remember what type of sound the main
routine generates, but I think it's some kind of laser blast. This code
will work under MSC 5.1 and Turbo C 1.5, which I have tested myself.

Patrick Draper

*********************************************************************** 

/* sound generation subroutine
   from Lee Adams' book :' high performance graphics in c '
   tab books                            */


#include <dos.h>        /* supports port manipulation */

#define outportb outp
#define inportb inp

void noise(int hertz,int duration);

/* subroutine: generate a sound

   enter with frequency, expressed as hert in the range
   40 to 4660. a comfortable frequency range for the human ear is 40 to 2400.
   enter with the duation, expressed as an
   integer to be used in a simple for... next loop.         */


main(){

   int reps=0;

   for(reps=0;reps<10000;reps+=20){
      noise(reps % 2000,5002);
   } /* for */
}

void noise(int hertz,int duration){
   int tl=1,high_byte=0,low_byte=0;
   short count=0;
   unsigned char old_port=0, new_port=0;


   if (hertz<40)
      return;     /* avoid math overflow for int count*/
   if (hertz >4660)
      return; /* avoid math underflow for low_byte*/
   count=1193180l/hertz;    /*        determine timer count     */
   high_byte=count/256;
   low_byte=count-(high_byte*256);
   outportb(0x43,0xb6);     /*prep the timer register            */
   outportb(0x42,low_byte);  /*  send the low_byte             */
   outportb(0x42,high_byte); /* send the high_byte             */
   old_port=inportb(0x61);    /* store the existing port value */
   new_port=( old_port| 0x03); /* use or to set bits0 and 1 to on*/
   outportb(0x61,new_port);  /* turn on the speaker           */
   for (tl=1;tl<duration; tl++);             /*wait           */
   outportb( 0x61,old_port ); /* turn off speaker         */
}
Re: Need routine(s) to generate sound for MSC 5.1
#1455
Author: walt dixon
Date: Tue, 06 Mar 1990 01:51
43 lines
2200 bytes
In a previous article Christopher A. Rende writes:

>I need a routine that generates sound from MSC 5.1: A beep, a tone/duration,
>play a script, etc...

>Please post or Email: I have not FTP or Aonon UUCP ability.

>If there is interest and I receive some code I'll post a summary.

The sample device driver I wrote for Chapter 11 of "The MS-DOS Papers"
will do what you want.  It recognizes a superset of the BASICA SOUND
statement as well as correcting some errors in the BASIC implementation.
Since this is a device driver,  one can open it and send characters
to it from any language.  The following C fragment

	fp=fopen("SOUND","w");
	fprints(fp,"%s","O3T100L8GFE-FGGGPFFF4");

plays "Mary Had a Little Lamb".  The complete source code for this driver
can be found at the end of the chapter.  If you don't feel like typing
it all in,  it is also available (from me) on a supplemental disk.  The
$10 fee I charge for each disk just covers reproduction,  materials,
and mailing costs.  All the code on this disk carries the following
notice:

	(c) W. V. Dixon.  All rights reserved.
	May be freely copied for personal, non profit use
	so long as this copyrite notice is retained and usage
	restrictions are observed.  This software may not be
	used in whole or in part in any program which is sold
	without prior written consent of the author.

This driver started out as a fairly simple example but grew into a
fairly sophisticated piece of code.

I hope this helps.

Walt Dixon		{arpa:		dixon@crd.ge.com	}
			{us mail:	ge crd			}
			{		po box 8		}
			{		schenectady, ny 12301	}
			{phone:		518-387-5798		}
Walt Dixon dixon@crd.ge.com
Re: Need routine(s) to generate sound for MSC 5.1
#1460
Author: Charles Hannum
Date: Tue, 06 Mar 1990 06:00
22 lines
1332 bytes
In article <5799@crdgw1.crd.ge.com>, dixon@sagittarius.crd.ge.com (walt dixon)
says:
>
>                                 The complete source code for this driver
>can be found at the end of the chapter.  If you don't feel like typing
>it all in,  it is also available (from me) on a supplemental disk.  The
>$10 fee I charge for each disk just covers reproduction,  materials,
>and mailing costs.  All the code on this disk carries the following
>notice:

If'n that's all ahd be payin' fer, how 'bout puttin' it on uh FTP site fer
uhs awl ta download?

[Aren't you glad people don't actually write the way they speak?  B-)]


Virtually,
- Charles Martin Hannum II       "Klein bottle for sale ... inquire within."
    (That's Charles to you!)     "To life immortal!"
  cmh117@psuvm.{bitnet,psu.edu}  "No noozzzz izzz netzzzsnoozzzzz..."
  c9h@psuecl.{bitnet,psu.edu}    "Mem'ry, all alone in the moonlight ..."
Re: Need routine(s) to generate sound for MSC 5.1
#1461
Author: walt dixon
Date: Tue, 06 Mar 1990 13:32
24 lines
1380 bytes
In a follow up to my original posting  Charles Martin Hannum II writes:

>In article <5799@crdgw1.crd.ge.com>, dixon@sagittarius.crd.ge.com (walt dixon)
>says:
[part of original message deleted]
>>The
>>$10 fee I charge for each disk just covers reproduction,  materials,
>>and mailing costs.  All the code on this disk carries the following
>>notice:

>If'n that's all ahd be payin' fer, how 'bout puttin' it on uh FTP site fer
>uhs awl ta download?

Sorry,  I can't do this.  The contract I signed with the publisher had
specific provisions about the way code can be distributed.  The publisher
cannot gather names for his mailing list if code gets posted to public
access BBS.

Walt Dixon		{arpa:		dixon@crd.ge.com	}
			{us mail:	ge crd			}
			{		po box 8		}
			{		schenectady, ny 12301	}
			{phone:		518-387-5798		}
Walt Dixon dixon@crd.ge.com
Re: Need routine(s) to generate sound for MSC 5.1
#1465
Author: Charles Hannum
Date: Tue, 06 Mar 1990 21:25
16 lines
1127 bytes
In article <5802@crdgw1.crd.ge.com>, dixon@ra.crd.ge.com (walt dixon) says:
>
>Sorry,  I can't do this.  The contract I signed with the publisher had
>specific provisions about the way code can be distributed.  The publisher
>cannot gather names for his mailing list if code gets posted to public
>access BBS.

Okay.  No problem.


Virtually,
- Charles Martin Hannum II       "Klein bottle for sale ... inquire within."
    (That's Charles to you!)     "To life immortal!"
  cmh117@psuvm.{bitnet,psu.edu}  "No noozzzz izzz netzzzsnoozzzzz..."
  c9h@psuecl.{bitnet,psu.edu}    "Mem'ry, all alone in the moonlight ..."
Re: Need routine(s) to generate sound for MSC 5.1
#1479
Author: John Wilber
Date: Wed, 07 Mar 1990 05:30
14 lines
1393 bytes
I don't have any code fragments or routines to show, but you can check
out The NEW Programmer's Guide to the IBM PC and PS/2, by Peter Norton
and Richard Wilton, Microsoft Press, 1988.  Specifically, see chapter 7,
clocks, timers, and sound generation.  This should probably tell you
what you want to know.  If you're getting paid for doing this program,
you might even be able to deduct the ~$23 for the book from your taxes
(but not until you file for 1990, unfortunately).

/***********************************************************************\
* John J. Wilber               * Vote for Socialism.  Vote Democratic   *
* wilber@nunki.usc.edu         * Vote for Conformity.  Vote Republican. *
* Student, partier, anarchist, * Vote for a free country.  Vote ....?   *
* and fun-loving guy.          *    Damn!  Nobody left to vote for!     *
\***********************************************************************/
Re: Problems installing Seagate's Hard Disk.
#1488
Author: fernando guzman
Date: Wed, 07 Mar 1990 16:27
27 lines
1661 bytes
Thank you to all the people who responded to my problem with a Seagate
ST277R-1  hard drive.  I did what most people suggested, and it worked
fine. Here is a summary:

1. Throw Ontrack's Disk Manager off the window. It is a worthless
piece of software (I am talking about version 4.0 from 1989).

2. Do a low level format with DEBUG.  Invoke DEBUG with no parameters,
and at the prompt type
-g=C800:5
Then follow the instructions.  You must have at hand the hard disk
specs.

3. Use FDISK to partition the disk and create logical drives (if you
create more than one partition).  Make the first partition the active
partition so the disk will be bootable.

4. Use FORMAT to format each logical drive.

5. Use SYS to install the system files in the first partition.

Even for those hard disks where DM works (I assume there may be some),
the above approach has the advantage of not requiring an additional
device driver, that would occupy precious RAM.

Fernando Guzman
NEC MULTISYNC 2A
#1498
Author: Dale Chun
Date: Wed, 07 Mar 1990 17:47
12 lines
1219 bytes
I have an NEC MultiSync 2A Super-VGA that I am trying to sell. It is
in mint condition and 3-weeks old. It comes with a full one year
warranty through NEC and this is not a gray/black market item. It
retails for $799, asking $475 or best offer. For more information,
finger my email address.
					...dale

------------------------------------------------------------------------------
 name: Dale C. Chun	   | * 2 + 2 = 5, for sufficiently large values of 2.
       Software Consultant | * ...a REAL hacker would rewrite the firmware in
email: dchun@alcor.usc.edu |   the terminal.
------------------------------------------------------------------------------
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads