Simple Sound Module


February 27, 2008

After half an hour i figured that i needed to use an ATMega AVR, because of its hardware multiplier. Without it, the ATTiny would be too slow, requiring several dozens of cycles for a software multiplier to do the same calculation.

So, the choice was the ATMega88, since i still had it on the breadboard, ready to be used. So far, the Atmel emulates 3 voices with TRIANGLE, SAWTOOTH, PULSE and NOISE waveforms. The waveforms are additive, just like in the original 6581 SID sound chip of the Commodore 64, meaning one voice can produce a combination of the 4 signals. Also, the 3 voices can be used independantly and are added up in the end, so one PWM channel is required for outputting the combined signal.




February 28, 2008

Triangle, sawtooth and pulse were relatively easy to implement, but it took me quite a while to get the noise right. After a couple hours i decided to delete the entire subroutine and write it again from scratch... turned out it was just some bug in the earlier version! It works fine now.

Ring modulation was also added to the emulation, making it officially 256 words long, including some testing code and the (almost empty) interupt vectors table. Hm.. this means IF an Atmel Tiny-AVR would have a hardware multiplier (OR if i can make a really fast software multiplier) it would be able to emulate the C64 SID so far.

Main volume control has already been added as well as preparations for ADSR envelope (during testing the SID emulator uses a fixed sustain level of 15). The next step will be to implement an ADSR envelope control subroutine and from there i'll have to see if voice synchronisation and filters are an option.




March 7, 2008

I've added some sound code to the main processor in the Mega32 Console. It will not be a full SID emulation, nor will it use the same addresses.
It is however able to produce simular sounds with the use of simular waveforms: So far i've been able to squeeze in control for 3 voices producing either triangle, sawtooth, pulse or noise waveforms. The waveforms of a single voice are NOT additive in my sound module, which i've dubbed "Simple Sound Module" (SSM). ADSR control has been prepared again. I can now add my ADSR routines that i've written for the Mega88 to my Console32 firmware making it have an embedded sound system. It won't be state-of-the-art and it will probably sound a bit different than Commodore SID sounds, it should still be a great sound engine for games.




Console 32 - BASIC