[sdlsound] SDL_Sound or SDL_Mixer sound generation question...

Ryan C. Gordon icculus at clutteredmind.org
Sat Jul 20 07:21:37 EDT 2002


>    Someone on the JEDI-SDL mailing list was asking how they could use
> SDL_Mixer or SDL_Sound to create Commodore PET sounds. I am not much of
> a sound person I thought I would ask here.

Wow...this guy should be using the SDL audio callback directly.

It might be interesting to have a sound file format that basically
contains a list of instructions (bytes that say "play this tone at this
pitch for n milliseconds"), but we don't have such a beast.

Also, the BASIC code he listed uses poke (which writes to specific
addresses in memory) to control the PET sound chip. What he would do on a
modern OS is write those tones as PCM data instead (which is not very
hard, it just involves more memory bandwidth than the PET version does).
This PCM waveform is then fed to the sound card via the audio callback.

--ryan.





More information about the sdlsound mailing list