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: 100
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: 505
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: 1343
$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: 100
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
Sokrates
Lord Crucifier/SCS*TRC
Andy/AEG
metalux
iAN CooG/HVSC
Acidchild/Padua
Marco/DDM
Mason/Unicess
Rhythm/G★P
Guests online: 462
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Codeboys & Endians  (9.7)
4 Mojo  (9.6)
5 Coma Light 13  (9.6)
6 Edge of Disgrace  (9.6)
7 Signal Carnival  (9.6)
8 Wonderland XIV  (9.5)
9 Uncensored  (9.5)
10 Comaland 100%  (9.5)
Top onefile Demos
1 Nine  (9.7)
2 Layers  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.5)
6 Scan and Spin  (9.5)
7 Onscreen 5k  (9.5)
8 Grey  (9.5)
9 Dawnfall V1.1  (9.5)
10 Rainbow Connection  (9.5)
Top Groups
1 Artline Designs  (9.3)
2 Booze Design  (9.3)
3 Performers  (9.3)
4 Oxyron  (9.3)
5 Censor Design  (9.3)
Top NTSC-Fixers
1 Pudwerx  (10)
2 Stormbringer  (9.7)
3 Fungus  (9.6)
4 Booze  (9.5)
5 Grim Reaper  (9.3)

Home - Disclaimer
Copyright © No Name 2001-2025
Page generated in: 0.036 sec.