programming sound on vic easier than on 64?
Moderator: Moderators
programming sound on vic easier than on 64?
last night i very briefly looked at the chapter on sound, in the basic book supplied with the 64c.
i know that the 64's sound capabilities are superior to the vic's, but perhaps due to the increased capability one also gets increased compexity in programming?
is programming sound on the 64 a pain compared to the vic?
chris
i know that the 64's sound capabilities are superior to the vic's, but perhaps due to the increased capability one also gets increased compexity in programming?
is programming sound on the 64 a pain compared to the vic?
chris
- Schema
- factor
- Posts: 1439
- Joined: Tue Mar 23, 2004 7:07 am
- Website: http://www.jammingsignal.com
- Location: Toronto, Ontario
It is definitely more complicated on the C64.
On the VIC, you set the master volume and the desired frequency for each of the four voices. Pretty simple.
On the C64, you have to set the master volume, setup the waveform (sine/sawtooth/pulse/noise), and define the attack-decay-sustain-release wave shape and pulse duty cycle. But there still won't be any sound, you still need to "trigger" the note. These steps need to be done for each voice independently too!
But the examples in the book are pretty good, it's not that bad once you get into the mindset.
On the VIC, you set the master volume and the desired frequency for each of the four voices. Pretty simple.
On the C64, you have to set the master volume, setup the waveform (sine/sawtooth/pulse/noise), and define the attack-decay-sustain-release wave shape and pulse duty cycle. But there still won't be any sound, you still need to "trigger" the note. These steps need to be done for each voice independently too!
But the examples in the book are pretty good, it's not that bad once you get into the mindset.
Actually, you define and trigger the waveform at the same time. Each voice has a frequency resolution of 16-bit (compared to 7 bits on the VIC), so you have to put two values into the frequency registers to get a nice note.
VIC-20 example:
POKE 36878,15
POKE 36876,200
FOR I=15 TO 0 STEP -1:POKE 36878,I:NEXT
POKE 36876,0
C64 example:
POKE 54296,15 : REM volume
POKE 54277,0:POKE 54278,249 : REM envelope (ADSR)
POKE 54272,0:POKE 54273,200 : REM frequency (low/high)
POKE 54276,33 : REM trigger note, sawtooth waveform
POKE 54276,32 : REM release note, still with sawtooth
If you require pulse waveform, two more registers have to be set to give the pulse width. Actually, different pulse width may be possible to simulate on the VIC-20 too, by careful timing and send the right values to the oscillator. This is something I still haven't tested.
There are more values to fill out, but things like pulse width and envelope only needs to be set once (per voice) unless you wish to constantly change it, like the advanced C64 music routines do. All the extra features, like individual envelope, waveforms, better frequency resolution, filter, various effects as ring modulation and synchronization and so on may be worth the extra amount of work if one is after a musical experience.
VIC-20 example:
POKE 36878,15
POKE 36876,200
FOR I=15 TO 0 STEP -1:POKE 36878,I:NEXT
POKE 36876,0
C64 example:
POKE 54296,15 : REM volume
POKE 54277,0:POKE 54278,249 : REM envelope (ADSR)
POKE 54272,0:POKE 54273,200 : REM frequency (low/high)
POKE 54276,33 : REM trigger note, sawtooth waveform
POKE 54276,32 : REM release note, still with sawtooth
If you require pulse waveform, two more registers have to be set to give the pulse width. Actually, different pulse width may be possible to simulate on the VIC-20 too, by careful timing and send the right values to the oscillator. This is something I still haven't tested.
There are more values to fill out, but things like pulse width and envelope only needs to be set once (per voice) unless you wish to constantly change it, like the advanced C64 music routines do. All the extra features, like individual envelope, waveforms, better frequency resolution, filter, various effects as ring modulation and synchronization and so on may be worth the extra amount of work if one is after a musical experience.
Anders Carlsson






- Schema
- factor
- Posts: 1439
- Joined: Tue Mar 23, 2004 7:07 am
- Website: http://www.jammingsignal.com
- Location: Toronto, Ontario
Vic sound is created from 6560/6561 (video chip).
I have found these that chips are a common point of failure in many Vic-20s.
6560 is no longer in production
and seem to be scarce.
As a hack, it would likely be better to build a cart based sound system than to try to add second 6560/6561 to existing main board.
I have found these that chips are a common point of failure in many Vic-20s.
6560 is no longer in production

As a hack, it would likely be better to build a cart based sound system than to try to add second 6560/6561 to existing main board.
Yes, you can get a square wave from the userport. It used to be a classic PET hack to get sound from it. Actually, I think the frequency resolution is better in that square wave than what the VIC-I chip can generate.
Aleksi Eeben just released a four channel sample player (no SID voices) for the 64. Apart from the memory requirements, I wonder how much more difficult it would be to port it to VIC.
The Battleships game I posted some time ago, seems to include support for a SID cartridge for the VIC-20. This is something I've almost never heard of, but clearly possible to achieve. If one was going to make a hardware sound expansion for the VIC, I suggest using a slightly better chip than the VIC-I once you are onto it. Either a SID, an AY, maybe a POKEY or even a SN76489.
http://www.answers.com/topic/sound-chip
Aleksi Eeben just released a four channel sample player (no SID voices) for the 64. Apart from the memory requirements, I wonder how much more difficult it would be to port it to VIC.
The Battleships game I posted some time ago, seems to include support for a SID cartridge for the VIC-20. This is something I've almost never heard of, but clearly possible to achieve. If one was going to make a hardware sound expansion for the VIC, I suggest using a slightly better chip than the VIC-I once you are onto it. Either a SID, an AY, maybe a POKEY or even a SN76489.
http://www.answers.com/topic/sound-chip
Anders Carlsson






An article to generate music from 6522 port appeared in 6502 Notes #16 (Kim Notes 1976). - www.bjlyons.com/kim/kimvol16.pdf
As a project hack, I have thought about porting this over to Vic-20 or a 6502SBC.
As a project hack, I have thought about porting this over to Vic-20 or a 6502SBC.
http://www.kolumbus.fi/aleksieeben/pollytracker/
As you can see, there is an ongoing compo for demo tunes to be included with the editor. About one week left to go, if anyone is interested.
As you can see, there is an ongoing compo for demo tunes to be included with the editor. About one week left to go, if anyone is interested.
Anders Carlsson





