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 > 6581 vs 8580, unfiltered drum
2012-10-29 05:21
ChristopherJam

Registered: Aug 2004
Posts: 1403
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?
2012-10-29 08:49
Frantic

Registered: Mar 2003
Posts: 1641
Hi!

Not sure about this actually. Do you get the same strangeness for all variants of the 6581 emulation?

It would be very nice if someone would start an article on codebase that summarizes and lists all the known differences between various SID chips, in accurate technical detail.
2012-10-29 20:59
SIDWAVE
Account closed

Registered: Apr 2002
Posts: 2238
the waveforms are a bit different, 8580 is more perfect with less flaws, and the adsr is different. if you want them to sound identical, you must find some middle way in the freq table. ?
2012-10-29 21:00
Reggy
Account closed

Registered: Oct 2009
Posts: 19
out of curiousity... you're describing the sound as an "unfiltered swept triangle wave", but how did you manage to make it sweep, without the filter?
2012-10-29 23:43
Wisdom

Registered: Dec 2001
Posts: 90
Perhaps you meant pulse sweep? If you can provide a .sid file, it should be easier to help.
2012-10-30 02:49
SIDWAVE
Account closed

Registered: Apr 2002
Posts: 2238
you are not missing anything. simply, if you want the sound to be same on both chips, you have to rework the sound and test. find some neutral state, and remove the overtones by tweaking the freq until you get it as you want. there is no other fix, than manual labour.
2012-10-30 03:40
RaveGuru

Registered: Apr 2002
Posts: 43
I'm guessing in this case OP is referring to a frequency sweep. That's basically how you build membrane instruments (drums); by quickly sweeping from higher to lower frequencies.

I'm very curious to hear that the actual waveform differs between the models as I've never noticed that, except for combined waveforms.

I'm putting my bet on an ADSR 'incompatibility'. Try experimenting with different envelope settings and see if you can find a solution.

2012-10-30 04:30
ChristopherJam

Registered: Aug 2004
Posts: 1403
Thanks all.

I get the strangeness for all the reSID 6581 variants, but not for the 'fast' 6581 emulation. Think I'll have to see if I can source a real '81..

Straight triangle wave ( $19 first few cycles, $11 for most of note, $10 for last few frames), 6x player, just sweeping the frequency down as RaveGuru suspected.

Envelope's $00f0, but I'll have a play and see if it makes any difference.
2012-10-30 07:44
Jammer

Registered: Nov 2002
Posts: 1333
ADSR is $00f0?? No wonder that it sounds different on both chips ;) It's not proper sound, just a fart because of rapid volume change thus it's probably louder on 6581 ;) Or maybe you mean hardrestart envelope? ;)
2012-10-30 12:45
Frantic

Registered: Mar 2003
Posts: 1641
well, since the test bit is on for the first few cycles anyway, is shouldn't matter much what is in the AD register I suppose. So I don't really see how ADSR could be the explanation.

The rapid volume change may still have something to do with it though -- considering the difference in digi playing on the 6581 and the 8580 -- but I must say that I am not sure exactly how this would be the case, since I guess that would probably only affect the initial moment of the sound, and I can't see how that would result in a swirling sound.

Also, since the "removal" of the test bit starts the oscillator from the beginning, I also fail to see how that in itself would produce different results on the 6581 and the 8580. (Well, there is a once cycle difference in where the oscillator is on the two chips, after toggling the test bit, but I can't see how that would produce a hearable difference in this case).

Hmm.. I am indeed confused. If you could post some complete, but minimal, test-code that reproduce the issue, I could certainly have a look.
2012-10-31 15:30
booker

Registered: Jul 2003
Posts: 334
Triangle wave sounds different on old and new SID.
2012-12-05 09:59
ChristopherJam

Registered: Aug 2004
Posts: 1403
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: 1641
...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: 1403
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: 1641
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: 45
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: 1403
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: 1403
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: 45
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: 1403
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!
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
Rock/Finnish Gold
A3/AFL
kbs/Pht/Lxt
chesser/Nigaz
Guests online: 114
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 Mojo  (9.6)
6 Uncensored  (9.6)
7 Wonderland XIV  (9.6)
8 Comaland 100%  (9.6)
9 No Bounds  (9.6)
10 Unboxed  (9.6)
Top onefile Demos
1 Layers  (9.6)
2 Party Elk 2  (9.6)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.6)
5 Rainbow Connection  (9.5)
6 It's More Fun to Com..  (9.5)
7 Morph  (9.5)
8 Dawnfall V1.1  (9.5)
9 Onscreen 5k  (9.5)
10 Daah, Those Acid Pil..  (9.5)
Top Groups
1 Booze Design  (9.3)
2 Oxyron  (9.3)
3 Nostalgia  (9.3)
4 Censor Design  (9.3)
5 Triad  (9.2)
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.052 sec.