I did some measures with reSID 1.0, in particular the new filter in filter8580new.cc.
I found out that the filter model for 6581 needs one adjustment regarding the DC level to boost the digi output a bit.
I've measured this with real 6581 SID chips and it was clear that real 6581 SIDs have a bit louder digi playback in proportion with the voice output.
DC level value 5.0 needs to be changed to value 5.35.
This can be tested by e.g. songs of Chris Hülsbeck that play voices and digis together.
I also did measurements for the 8580 filter. There the overall volume is too low. Especially when you compare it with the 6581 output.
Just play a song that doesn't use any filter, e.g.:
/MUSICIANS/H/Hubbard_Rob/Commando.sid
and play it as 6581 and then as 8580.
I've measured output levels of the same song on a real 6581 and 8580 and how it is configured now is wrong.
To fix this, the first value of the 8580 filter needs to change from 0.2 to 0.5. This will increase the volume a lot and some heavy filtered tunes might clip because of this.
Therefore transistor parameter value 9.09 needs to be increased to value 13.0.
The new values can be tested with tunes like:
/MUSICIANS/L/Linus/64_Forever.sid
/MUSICIANS/J/Jammer/Yet_Bigger_Beat_2SID.sid
The current DC level of the 8580 is set to 4.80. This is needed to make digi playback without using the 3 voices on a 8580 audible but very soft.
However, the current value is problematic for the following tune:
/MUSICIANS/P/Psych858o/90_Seconds.sid
Notice that you will hear a tone at the beginning which shouldn't be there. On a real 8580 the tone is not there.
The problem can be fixed to change value 4.80 to 4.84. This value still gives the right low volume output of digi playback via $D418.
I've tested this on sound cards at 44.1KHz and on 48KHz and the tone is not audible anymore with the new value 4.84.
The last change I would suggest is to change the second transistor parameter value 0.80. This needs to change to value 1.0 to make the filter sound the same as a real 8580.
I've tested this with tunes s.a.:
/MUSICIANS/P/Psych858o/90_Seconds.sid at 0:07 for the bass sound.
For the complete change in file filter8580new.cc:
static model_filter_init_t model_filter_init[2] = { { opamp_voltage_6581, sizeof(opamp_voltage_6581)/sizeof(*opamp_voltage_6581), // The dynamic analog range of one voice is approximately 1.5V, 1.5, // riding at a DC level of approximately 5.0V. 5.35, // Capacitor value. 470e-12, // Transistor parameters. 12.18, 1.31, 26.0e-3, 1.0, 20e-6, 9.0/1.0, 1.0/115, // DAC parameters. 6.65, 2.63, 2.20, false }, { opamp_voltage_8580, sizeof(opamp_voltage_8580)/sizeof(*opamp_voltage_8580), 0.5, // The 4.75V voltage for the virtual ground is generated by a PolySi resistor divider 4.84, // Capacitor value. 22e-9, // Transistor parameters. 13.0, 1.0, 26.0e-3, 1.0, // Unused, leave at 1 100e-6, // FIXME: 6581 only 0, 0, 0, 0, 2.00, true }
ok, then I can conclude that you didn't test the values I provided (without the patches that were done later). The tune you mentioned doesn't clip with the values I provided and doesn't have an annoying distortion.
I just want to say that I focused on the output (not if the values make sense) and proof that we can actually get the right result on a 8580 with the implementation from February 2022. I was hoping that you could figure out why it worked out well and fix the implementation and then work towards values that makes sense.
Also playing /MUSICIANS/L/Linus/64_Forever.sid on a real 8580 gives a lot of distortion at the beginning and I think this tune is made with an emulated SID instead of a real 8580.
You're right, but I see no point in trying out unrealistic values
I'll send him a message on csdb and ask :)
He answered:
"yes, GT2. Distorts possibly in the intro (before the drums come in) a bit through the filter on all voices. But I have not heard that on the Compo machine, i think."
"Besides that, besides the intro, no clipping on my 8580"
Last edit: gpz 2023-05-04
I can confirm, no clipping nor distortion on the real chip.
BTW here's the revised patch, was missing a line:
I can confirm it is actually clipping on a 8580 and therefore it sounds distorted. I've recorded it while playing the song on a real C64 and made sure the recording is not clipping. Just zoom in the audio sample and then it is clear that at certain parts it is clipped.
Yeah, it looks like analog saturation. It doesn't happen for me, but I'm using exSID so it might be the different clock frequency or the voltage, can't say for sure. Will post a recording later. @gpz do you have an 8580 equipped C64 to check out?
BTW, any objection applying the above patch? It sounds like a good overall improvement to me.
I do (more than one even) - what exactly do you want me to do? :)
As always, if you think it's an improvement, sure. I know close to nothing about this code :)
play /MUSICIANS/L/Linus/64_Forever.sid and see if you experience the same distortion as in the sample bozz64 posted.
The tunes I've tested sounds louder and with less clipping so it LGTM. Credits to @bozz64 for the suggestion.
This is recorded from an 8580R5 0591
Thanks for the recording. I think you recorded this from a exSID device? I hear a small difference in frequency which I think is there because of a 1Mhz clock. I also hear a beep at 0:09 which should not be there. Anyway, your 8580 has less distortion but I think we should compare recordings done on real C64 on PAL frequency.
The recording I did is done on a 8580R5 2087 on a real C64.
i am - once again - confused as to what to do with this now shrug
@daglem please comment :)
You'll have to sort this out without me :)
All of this has been tweaked considerably since I last worked on it, so I can't comment on it.
I can however say that there is no such thing as a "correct" DC level - this varies considerably between chips, at least for the 6581. But maybe you can get closer to some kind of average?
The last patch posted above (also attached here) increases the volume and reduces clipping on problematic tunes. It looks to me an overall improvement for the sids I've tested.
Anyway it seems there's quite some variation for the 8580 too with regard to filter distortion and digi samples volume.
so which do you want me to apply now? :)
If there's no objection the one I've attached (filter8580-bug1696.patch) is good to go.
Last edit: Leandro Nini 2023-06-01
applied in r43937 - so we can close this? :)