Subject: Re: Help: Apple II Sound Trick Path: lobby!newstf02.news.aol.com!portc01.blue.aol.com!news-peer.gip.net!news.gsl.net!gip.net!sunqbc.risq.qc.ca!news3.bellglobal.com!news1.bellglobal.com!news21.bellglobal.com.POSTED!not-for-mail From: "boots" Newsgroups: comp.sys.apple2 References: <36B20475.C2C@novadesign.com> <19990130042321.08437.00001587@ng109.aol.com> <36B3C754.126F@novadesign.com> Lines: 57 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.0810.800 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.0810.800 Message-ID: <%%et2.6002$r%4.12051@news21.bellglobal.com> Date: Mon, 1 Feb 1999 05:11:04 -0500 NNTP-Posting-Host: 209.226.67.253 X-Trace: news21.bellglobal.com 917863547 209.226.67.253 (Mon, 01 Feb 1999 05:05:47 EDT) NNTP-Posting-Date: Mon, 01 Feb 1999 05:05:47 EDT Organization: Bell Solutions Kermit, I wrote some software back in the day that did just what you are refering to--it played multiple voices on my good 'ol ][+. I had it rigged so that each paddle (or the x and y of the joystick) each played a note while a third note could be selected on the keyboard. I've just recently got my hands on my original ][+ (got it from my parents just a few weeks ago) but it has a burnt out Disk ][ controller that I haven't been able to replace yet. Anyway, I probably have still have the code on a disk in the stack that was saved. If I remember correctly, the principle was pretty straightforward. Since the speaker was a single bit device, you generated tones by tweeking the speaker at the correct frequency. For a single tone, you simply had a timing loop which divided the CPU frequency by the desired output frequency and you tweaked the speaker once per interval. For multiple tones, you set up a loop that counted ticks. If the tick count was a multiple of one of the desired frequencies, you tweaked the speaker. It was as little bit more sophisticated than that because volume is affected by how close together the tweaks are. If multiple frequencies superimposed on a single tick count, that could obviously not be produced directly on a 1 bit device. Instead, the speaker would be tweaked for two successive ticks. I think that increasing the volume had something to do with increasing the number of times in a row that the speaker would be tweaked for each note. ie. instead of tweaking the speaker once each interval (eg. at 10hz, it would be tweaked for approx. 1 microsecond, 10 times a second) you would tweek it say 2, 5 or 10 times in a row (2, 5 or 10 microseconds) each interval. I don't remember exactly what the maximum switching speed of the speaker was--I'm just assuming it was about the same as the CPU frequency. Something like that. If I get things back and running, maybe I'll be able to tell you. xo boots Kermit Woodall wrote in message news:36B3C754.126F@novadesign.com... >Supertimer wrote: >> >> I think this was how certain Apple II sound programs can pull up to >> 3 voices out of the internal speaker (remember, this was before >> the Apple IIGS and the Ensoniq and 32 channel sound). One of >> these was the Music Construction Set. > >Well, actually there's another trick for that, but the trick I'm looking >for was much more elementary. A friend said the same thing is used for >DTMF - Dual Tone Multi-Frequency. You generate two tones that you >rapidly alternate between to generate a harmonic note. > >My quest for this article continues... >-- >-------------------------------------------------------------------- >Kermit Woodall Live Faust >Nova Design, Inc. Die Jung >http://www.novadesign.com Leave it to Beaver >--------------------------------------------------------------------