Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > C64 Composing > Strange Pulse + Sawtooth Wave Behavior
2021-11-06 04:20
acrouzet

Registered: May 2020
Posts: 80
Strange Pulse + Sawtooth Wave Behavior

Thought you guys might find this interesting and perhaps useful.

I recently came across this SID benchmark test, and noticed that the saw+pulse waveforms sounded rather off on a lot of the 6581 recordings featured on the site, as well as on my friend’s 6581 (volume warning).

So I looked at some recordings in Audacity and noticed that the waveform varies in height between cycles. What’s more, is that the “short” wave cycles are an octave (2x) higher in pitch than they should be.




So, here’s my theory: When the SID generates a tri wave, it uses the most significant bit of the accumulator to invert the wave, thus not outputting it to the DAC. However, the remaining bits are left-shifted, making the tri wave the same amplitude as the other waves. But if the inversion and left-shift were to not happen, you’d get a saw wave that’s half the height and double the frequency of a normal saw.
What I think may be happening on the 6581 when it's combining pulse and saw is that the 6581 is intermittently not using the MSB of the accumulator for DAC output, as if about to create a tri but not taking the other steps, thus creating these “short” wave cycles.

If this has already been noticed and thoroughly analyzed, I apologize for bringing up old news :)
2021-11-06 10:43
spider-j

Registered: Oct 2004
Posts: 445
I'm not too deep into the technical details and haven't looked into the sourcecode, but it sounds to me like reSID is emulating this behaviour you describe – or at least something very similar to it.
2021-11-06 16:18
Jammer

Registered: Nov 2002
Posts: 1289
$31, $61 and $71 are generally not really advised on 6581 ;) But I've never read any analysis of this from circuitry standpoint.
2021-11-06 20:35
acrouzet

Registered: May 2020
Posts: 80
Quote: I'm not too deep into the technical details and haven't looked into the sourcecode, but it sounds to me like reSID is emulating this behaviour you describe – or at least something very similar to it.

You appear to be correct! (from ReSIDfp's WaveformGenerator.h)
        // In the 6581 the top bit of the accumulator may be driven low by combined waveforms
        // when the sawtooth is selected
        // FIXME doesn't seem to always happen
        if ((waveform & 2) && unlikely(waveform & 0xd) && is6581)
            accumulator &= (waveform_output << 12) | 0x7fffff;

However, the MSB always seems to be low in the emulation, whereas it varies unpredictably(?) on a real chip.
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
Thierry
Didi/Laxity
Guests online: 125
Top Demos
1 Next Level  (9.8)
2 Mojo  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 Comaland 100%  (9.6)
6 No Bounds  (9.6)
7 Uncensored  (9.6)
8 Wonderland XIV  (9.6)
9 Memento Mori  (9.6)
10 Bromance  (9.5)
Top onefile Demos
1 It's More Fun to Com..  (9.7)
2 Party Elk 2  (9.7)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.5)
5 TRSAC, Gabber & Pebe..  (9.5)
6 Rainbow Connection  (9.5)
7 Wafer Demo  (9.5)
8 Dawnfall V1.1  (9.5)
9 Quadrants  (9.5)
10 Daah, Those Acid Pil..  (9.5)
Top Groups
1 Nostalgia  (9.3)
2 Oxyron  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 Crest  (9.3)
Top NTSC-Fixers
1 Pudwerx  (10)
2 Booze  (9.7)
3 Stormbringer  (9.7)
4 Fungus  (9.6)
5 Grim Reaper  (9.3)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.034 sec.