2

From the comments on this question, the SAM on the Apple II seemed to use some proprietary hardware to produce the waveform. (I am not counting the option to produce a horrendous 1-bit PWM using the clicker).

But why not use the Mockingboard? That has an AY-3-8910 which has a master volume control just like the SID does. That means a only a little modification from the C64 version would be needed. And I suppose, that using hardware which was already widely available would have meant a cheaper product and/or a wider audience.

  • 1
    It optionally uses its own hardware, which is essentially the same sort of thing as e.g. the Covox — set a current output level, it persists until you set another. It can just use the built-in Apple II speaker. I've no idea about SAM versus the Mockingboard though. – Tommy Dec 18 '18 at 10:28
  • @Tommy that's the idea. Apparently the Apple II also had an internal speaker which SAM could use, and which sounded positively awful. – Wilson Dec 18 '18 at 10:30
  • Well, 'Aweful' isn't a real category. It wasn't worse than on other computers - the whole idea behind SAM was to let it be done in software. To follow that though, a real life comparison would be apropriate. – Raffzahn Dec 18 '18 at 12:42
  • 1
    @Wilson as output by my very own emulator (as usual, no hacks, no special cases, just the raw megahertz-ish audio resampled for output on current hardware) S.A.M. via the built-in speaker: youtu.be/IIejqWEV_8w ; it could have been a lot worse. – Tommy Dec 18 '18 at 15:01
  • @Tommy: How far have people managed to push "built-in speaker bit-bash" audio on the Apple II? I've seen some two-voice music functions, but have people gone beyond? I've been thinking of porting my Stella's Stocking 4-voice wave-table-based music driver from the Atari 2600 which uses 46 cycles out of 76 to generate audio data. I think it should be possible to achieve good sound if there are 32 copies of the main audio player which differ in the timing of their second `STA $C030. Have such things been done? – supercat Dec 18 '18 at 22:10
3

In addition to having a volume control, it's also necessary that an audio chip have a means of forcing a waveform generator to produce a DC output, it's necessary that setting the volume be quick, and it's necessary that the volume control be linear. On the SID chip, I think there's a "test" function that can be used for that, and if not I think setting a PWM width to maximum at a high frequency and passing that through a low-pass filter should yield something that's basically a DC level.

I don't know of any way to make the AY-3-8910 wave generators produce a solid "on" signal. The volume control is by design not linear. If one didn't mind limiting volume to 1/6 of maximum, it might be possible to program one of the channels for a maximum-frequency square wave (32,000Hz) and amplitude-modulate that, but the even if one used a translation table the non-symmetric distribution of output steps would likely make it impossible to get good results. Using multiple generators could improve overall volume, but would require storing four stores or six to the I/O port to select the first channel amplitude register, write a value to it, select the second channel output register, and write a value to that.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.