💾 Archived View for mirrors.apple2.org.za › archive › apple.cabi.net › Music.and.Sound › SIX.BIT.DAC… captured on 2024-06-16 at 14:08:06.
⬅️ Previous capture (2023-01-29)
-=-=-=-=-=-=-
Six-Bit DAC, A 6-bit audio DAC for any Apple II by Greg Templeman Copyright (c) 1993 FREEWARE INSTRUCTIONS Run the SOUND.EDITOR.6 program to play sounds. If you have an accelerated Apple (faster than 1 MHz), you will have to slow the speed down to 1 MHz ("Normal" on a GS) to have the sounds play properly. SIX.BIT.DAC implements a 6-bit DAC in software, with a sample rate of 11 kHz. It uses ALL of the $300-$3CF space. You can use it separately to play back sound files in your own programs, but you should note that it DOES NOT use the same entry points as M. Mahon's 5-bit DAC, SOFT.SOUND. Also included by permission is a modified version of Mahon's SOUND.EDITOR Version 1.1/6, changed only to use my 6-bit DAC instead of the previous 5-bit player. Contrary to previous belief, 5-bit sound is not the best your "stock" Apple II can play: 6-bits is the TRUE limit. No one can make a 1MHz Apple II play 11kHz sounds with any more bit-resolution than this one (i.e. this is as good as it gets!) INFORMATION For an informative an interesting history of sound on the Apple II, see Michael Mahon's documentation for his 5-bit DAC. I am indebted to Mr. Mahon's clear explanation of how multi-bit sound is produced on a "stock" Apple II. Please note that SIX.BIT.DAC is a totally different program than the 5-bit SOFT.SOUND. Mr. Mahon believed that 6-bit sound could not be done, and it was only by using a timing technique radically different than his that I have been able to produce a 6-bit sound player. Previous 3- and 4-bit sound players for the Apple II cannot compare in quality to SIX.BIT.DAC. The amount of distortion in the sound is noticeable compared to the 6-bit. Mr. Mahon's 5-bit comes close, but doesn't have constant digital "steps" in the waveform (because of limitations of his timing approach). Thus, SIX.BIT.DAC reduces sound noise by more than the 50% one would expect from adding an additional bit of resolution. This means noise should now be about 1%. Note, however, that the 11kHz "carrier" tone is a given of this method of sound reproduction; if you don't have some external means of filtering it out, you may not be able to hear the improvement in the 6-bit player. By using synthesized sine waves, I was able to hear the difference between 5-bit and 6-bit players even with the carrier noise. Whether or not you notice the sound improvement with the sounds you play, however, you will still get the other advantage of increased bit-resolution: a greater dynamic range than other sound players, even with smaller digital steps. That is, my 6-bit DAC plays sounds louder than 5-bit (or fewer) players. TECHNICAL INFO My software DAC loads at $300 (and takes all the space from $300 to $3CF), and is called at $32E after setting up the start and end addresses at 6/7 and 8/9, respectively. Note that, although the start and end are set up the same as Mahon's player, THE ENTRY POINT IS DIFFERENT. Thus, if you are converting programs over to run with my sound player, you will need to change your call address to $32E (814). Also, if you are toggling the speaker/cassette outputs, you will need to use different addresses than those in the 5-bit; I have 4 sound switch toggles instead of Mahon's 2. See the code for specifics or send me mail. Also, my sound player has the same requirement as Mahon's, that the sound sample end with a $00 byte. This is because, as in his program, there is not enough time in the loop to check if the end address has been reached for every address. You can include 0's in the sound, as the program won't stop before the end even if a sound is encountered. FOR MORE INFORMATION Download Michael Mahon's 5-bit sound player for comprehensive background, theory, and documentation of Apple II DAC's, as well as the editor docs. Get in touch with me for more information: Greg Templeman 833 Hawthorne Drive Walnut Creek, CA 94596 America Online: Barnabas InterNet: barnabas@aol.com