Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
 Welcome to our latest new user maak ! (Registered 2024-04-18) You are not logged in - nap
CSDb User Forums


Forums > C64 Composing > 6581 vs 8580, unfiltered drum
2012-10-29 05:21
ChristopherJam

Registered: Aug 2004
Posts: 1370
6581 vs 8580, unfiltered drum

I'm currently building a drum sound out of an unfiltered swept triangle wave. It's sounding good on my 8580 equipped c64c, and sounds nigh identical under reSID-fp emulating the same.

However, if I switch reSID over to 6581 it sounds very different indeed - there's a twangy/swirly overtone that distracts from the punchiness.

I thought the main differences between them were related to filters and digi-playback, neither of which I'm going anywhere near; what am I missing?
 
... 10 posts hidden. Click here to view all posts....
 
2012-12-05 09:59
ChristopherJam

Registered: Aug 2004
Posts: 1370
Jammer, I mean a short attack to maximum sustain, only decaying at end of note.

Test bit only affects the oscillator, not the envelope, so far as I'm aware?

Sounds like booker is correct; triangle wave is just not as 'triangular' on old SID. Nonlinearities in the DAC, perhaps?

Anyway, there's some minimal test code at https://dl.dropbox.com/u/62734159/fish/play.tar

(.prg, player, and frequency tables)

2012-12-05 13:59
Frantic

Registered: Mar 2003
Posts: 1627
...but if I understand correctly, that bass drum doesn't just sound different on 8580 and 6581, but on 6581 it also sounds slightly different each time it is trigged (the twirling stuff), right? If so, then I don't see how slightly different waveforms on the two chip models would explain anything per se when it comes to slightly different character of the sound each time it is trigged (on 6581 but not on 8580). Would have to be something "external" to the waveform itself, such as the DAC (as CJ suggested) or something else. But perhaps I misunderstood the phenomenon?

@CJ: Yes, the test bit is only related to the oscillator, and not to the envelope.
2012-12-07 02:20
ChristopherJam

Registered: Aug 2004
Posts: 1370
No, the note sounds pretty consistent each time, it's just different to how it sounds on an 8580. The latter sounds how I would expect from my own simplistic wave generator.

Looks like I'll have to make a .sid so I can save out some waveforms from SIDPLAY. I gather I need to make a CIA based player to support 6x playback? I'm currently just waiting for $d011 values in my test player.
2012-12-07 07:54
Frantic

Registered: Mar 2003
Posts: 1627
Quote: No, the note sounds pretty consistent each time, it's just different to how it sounds on an 8580. The latter sounds how I would expect from my own simplistic wave generator.

Looks like I'll have to make a .sid so I can save out some waveforms from SIDPLAY. I gather I need to make a CIA based player to support 6x playback? I'm currently just waiting for $d011 values in my test player.


Ok, then I misunderstood the probem.

I had a look in the resid-fp sources, and here is some code from the wave generator function that may give a hint:
    // Build DAC lookup tables for 12-bit DACs.
    // MOS 6581: 2R/R ~ 2.20, missing termination resistor.
    build_dac_table(model_dac[0], 12, 2.20, false);
    // MOS 8580: 2R/R ~ 2.00, correct termination.
    build_dac_table(model_dac[1], 12, 2.00, true);


...and further:

// The SID DACs are built up as follows:
//
//          n  n-1      2   1   0    VGND
//          |   |       |   |   |      |   Termination
//         2R  2R      2R  2R  2R     2R   only for
//          |   |       |   |   |      |   MOS 8580
//      Vo  --R---R--...--R---R--    ---
//
//
// All MOS 6581 DACs are missing a termination resistor at bit 0. This causes
// pronounced errors for the lower 4 - 5 bits (e.g. the output for bit 0 is
// actually equal to the output for bit 1), resulting in DAC discontinuities
// for the lower bits.
// In addition to this, the 6581 DACs exhibit further severe discontinuities
// for higher bits, which may be explained by a less than perfect match between
// the R and 2R resistors, or by output impedance in the NMOS transistors
// providing the bit voltages. A good approximation of the actual DAC output is
// achieved for 2R/R ~ 2.20.
//
// The MOS 8580 DACs, on the other hand, do not exhibit any discontinuities.
// These DACs include the correct termination resistor, and also seem to have
// very accurately matched R and 2R resistors (2R/R = 2.00).

So, to be completely correct, I don't think there is any evidence that the triangle waveform itself is different on the different SIDs, but the end result (what is heard) may be different due to the DAC stuff (like CJ also said).

Speaking more generally, I find the resid-fp sources to be an interesting read in many ways. :)
2012-12-07 20:20
andym00

Registered: Jun 2009
Posts: 44
Since I'm currently getting my head around resid-fp lately whilst building a PC based SID contraption, I just dumped these out.. The triangles from the 6581 and 8580 after going through the computed DACs for each one..

They're big, 4096x4096 and the Y axis is reduced to keep the different offset visible.. You will need to zoom in.. A lot :)

6581 8580

Unless I've cocked something up, I'm pretty sure they're right :) The real differences aren't visible at the macro level, you need to zoom in to see all the fuzz on the 6581 DACs..

edit: Oops, they're upside down of course, bugger!
2012-12-08 16:14
ChristopherJam

Registered: Aug 2004
Posts: 1370
Ah, thank you! That's probably enough to explain it. I'd started saving out waveforms from jsidplay, but had only got as far as noting the drifting DC offset in the SID output.

I'll try feeding the DAC tables from the tables you've provided to my wave synthesis testbed, and see if that gets the same overtones.

Btw, I see that both the graphs you've provided exhibit marked discontinuities. That's at odds with the comments you extracted from the reSID sources, which claim that the 8580 has none. Do you know what's happening there?
2012-12-08 16:53
Dane
Account closed

Registered: May 2002
Posts: 421
Might take you a while to get an entire song done if you spend this much effort on the bass drum. :)
2012-12-08 17:17
ChristopherJam

Registered: Aug 2004
Posts: 1370
Hahahaha fair point Dane.

I do have some (I think) novel ideas for instrument building and music playback, I just want to get the foundations right before I start making unwarranted assumptions about what I can get away with :)
2012-12-09 10:25
andym00

Registered: Jun 2009
Posts: 44
I know it looks odd with the discontinuities in both, but that what I get from the DAC model..

If you've got your own testbed runing, then just yank out the dac::kinkedDac() function in DAC.cpp which is fairly standalone.. The triangle wave is just the top 12 bits of the phase accumulator indexed through the generated 12bit DAC.. Although the other waveforms are fairly straight forward, just the combined waveforms have lots of voodoo in there :) But again that code is all fairly stand alone in resid-fp..

I've been rolling resid-fp into one single .h/.cpp./.inl file and cleaning up the code and speeding it up and making other changes, although it's possible I made a mistake in that function, I don't think I did since I left it (mostly) alone given that it's only called to set things up.. I shall double check today though..
2012-12-09 11:03
ChristopherJam

Registered: Aug 2004
Posts: 1370
Curious indeed. Current testbed is in Python, but I do need to get resid compiling again; I was working on fixing some envelope emulation bugs, but got bogged down measuring the details.

I did get fairly similar artefacts just by extracting a table from your images, mind, so I think I'll just target 8580 and be done with it. Certainly sounds fine on my hardware, anyway :)

Thanks so much for your help!
Previous - 1 | 2 - Next
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
Mason/Unicess
Meikel aka ZUX/Sparks
Low Spirit
goerp/F4CG
Guests online: 119
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 The Ghost  (9.6)
10 Bromance  (9.6)
Top onefile Demos
1 It's More Fun to Com..  (9.9)
2 Party Elk 2  (9.7)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.5)
5 Rainbow Connection  (9.5)
6 TRSAC, Gabber & Pebe..  (9.5)
7 Onscreen 5k  (9.5)
8 Dawnfall V1.1  (9.5)
9 Quadrants  (9.5)
10 Daah, Those Acid Pil..  (9.5)
Top Groups
1 Oxyron  (9.3)
2 Nostalgia  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 Crest  (9.3)
Top Webmasters
1 Slaygon  (9.7)
2 Perff  (9.6)
3 Morpheus  (9.5)
4 Sabbi  (9.5)
5 CreaMD  (9.1)

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