Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rochester!pt.cs.cmu.edu!zog.cs.cmu.edu!tgl From: tgl@zog.cs.cmu.edu (Tom Lane) Newsgroups: comp.sys.hp Subject: Re: Guts of the tone generator on the 320 system Message-ID: <1024@zog.cs.cmu.edu> Date: Wed, 22-Apr-87 19:47:14 EST Article-I.D.: zog.1024 Posted: Wed Apr 22 19:47:14 1987 Date-Received: Fri, 24-Apr-87 05:37:04 EST References: <1365@ucbcad.berkeley.edu> Reply-To: tgl@zog.cs.cmu.edu (Tom Lane) Distribution: na Organization: Carnegie-Mellon University, CS/RI Lines: 56 Keywords: bobcats tones In <1365@ucbcad.berkeley.edu> chris@ic.uucp (Chris Guthrie) writes: >We spent last night playing with the tone generator on our 320s. >Although we were able to get a number of unique and interesting >noises out of them, we couldn't figure out the layout of the >four bytes in the EFTSBP ioctl command (other than the volume and >timer bits). Can anyone post the layout of these bytes. Thanks! This may not be too accurate 'cuz its based on old documentation (pre-Series 300) for a different operating system (HP Pascal), but it's worth a try. What you have is a TI SN76494 4-voice sound generator; it can make 3 independent square waves plus a noise source. To control one of the square wave voices, the format of the 4 bytes is: byte 1: 1 v1 v0 0 f3 f2 f1 f0 byte 2: 0 0 f9 f8 f7 f6 f5 f4 byte 3: 1 v1 v0 1 a3 a2 a1 a0 byte 4: d7 d6 d5 d4 d3 d2 d1 d0 where v1-v0 is the voice number (00,01, or 10); f9..f0 is a 10-bit value defining the frequency; a3..a0 is a 4-bit value defining the attenuation (volume); d7..d0 is an 8-bit value defining the duration of the tone. Note that the voice number must be given in two places. The f9..f0 value should be 83333 / (desired freq. in Hz); the a3..a0 value is 0 (maximum volume) to 15 (off), in steps of about 2 dB; the d7..d0 value is duration in 10-msec units, or 0 to sound until a countermanding command is given. For the noise source, the command format is: byte 1: 1 1 1 0 0 fb n1 n0 byte 2: 1 1 1 0 0 fb n1 n0 (i.e. same as byte 1) byte 3: 1 1 1 1 a3 a2 a1 a0 byte 4: d7 d6 d5 d4 d3 d2 d1 d0 (thus, the voice number is "11") where: fb is 0 for "periodic" noise and 1 for white noise; n1-n0 control the "noise generator shift rate" as follows: 00 333333/64 Hz 01 333333/128 Hz 10 333333/256 Hz 11 Use voice "10"'s output (don't ask me what any of that means). The attenuation and duration are the same as for the other sources. Somebody please check this out and let the net know if it's OK... I don't run HP/UX. tom lane ----- ARPA: lane@ZOG.CS.CMU.EDU UUCP: ...!seismo!zog.cs.cmu.edu!lane BITNET: lane%zog.cs.cmu.edu@cmuccvma