Newsgroups: comp.sys.apple2 Path: news.weeg.uiowa.edu!news.uiowa.edu!uunet!usc!sdd.hp.com!ux1.cso.uiuc.edu!news.iastate.edu!irsman From: irsman@iastate.edu (Ian Schmidt) Subject: Re: Sound Message-ID: <1992Sep5.230433.13319@news.iastate.edu> Sender: news@news.iastate.edu (USENET News System) Organization: Iowa State University, Ames, IA References: <1992Sep5.223747.17988@mnemosyne.cs.du.edu> Date: Sat, 5 Sep 1992 23:04:33 GMT Lines: 53 In article <1992Sep5.223747.17988@mnemosyne.cs.du.edu> cshepher@nyx.cs.du.edu (SSP Guy...) writes: > >Hello... > I'm writing a simple routine to play a sound, which happens to be >$4c00 bytes long, by using the DOC Registers in bank $00. The problem is, >it plays about 1 second of the sound, then stops. I know that the whole >sound is being uploaded to DOC RAM, so I suspect I'm not setting the >waveform register right. Any ideas? Ian? You've come to the right place ;) There are a couple of things that can cause this... 1) there may be a zero in the sound 2) you aren't setting the bankselect/tablesize/resolution register for the appropriate oscillator(s) high enough I'd guess your problem is #2. The BTR register, DOC registers $C0-$DF, selects the size of the sound, as well as the resolution of the DOC registers. For normal tuning, the size and resolution must be identical. These are the appropriate values: %000 = 256 bytes ($100) %001 = 512 bytes ($200) %010 = 1024 bytes ($400) %011 = 2048 bytes ($800) %100 = 4096 bytes ($1000) %101 = 8192 bytes ($2000) %110 =16384 bytes ($4000) %111 =32768 bytes ($8000) You use the smallest value greater than or equal to the size of the wave you play. For your example (a $4c00 length sound) you'd use the max value of %111. To make this into a normally valid BTR register, repeat the value twice and stick two 0 bits on the left to make it a byte... %00 xxx xxx In this case, %00111111 = hex $3F. Hope this helps (whew)! >| Chris Shepherd Starving Programmer | cd119@Cleveland.Freenet.Edu | >| Ask me about Impasse //gs | cshepher@nyx.cs.du.edu | -- _IanSchmidt(oINet+irsman@iastate.edu,oBITNET+twbv4@isuvax,$C000,Data) Data dc i'Apple IIgs,Rush,Tiny Toons,Dave Barry,David Letterman' "I will choose a path that's clear: I will choose free will" - Neil Peart