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 Coding > resetting the SID
2011-07-02 23:32
ThunderBlade

Registered: Jan 2002
Posts: 78
resetting the SID

Hi, not sure if this is an awkward question, but... what's the proper way to reset the SID?

When starting various musics, I sometimes, very rarely, notice they sound different like all the other times. It seems to depend which music I played previously!

Inbetween playing musics, currently I just fill $D400 - $D418 with a counting down loop (starting with $D418) with zeroes. Is there a recommended better way?
 
... 44 posts hidden. Click here to view all posts....
 
2011-07-06 19:04
Devia

Registered: Oct 2004
Posts: 403
hehe.. yeah, whatever ;-)

and yes, did test on real hardware (6581R4AR) - I didn't test THAT thoroughly, so if it's completely silent or just have some barely inaudible properties remains to be measured.
But surely some supergeek must have tested this at some point?



2011-07-06 21:16
Devia

Registered: Oct 2004
Posts: 403
Uhm.. interestingly enough, the SID output is more silent in that configuration (filter ON, but no filter type active) with gate ON than OFF... /me is puzzled
Also the volume click is waaaay louder when changing from F to 0 or 0 to F than any other transition...

sorry for going off topic, but could someone point me in a direction of some material describing what everyone is referring to as the "ADSR bug"?

2011-07-06 21:33
Soren
Account closed

Registered: Dec 2001
Posts: 547
Devia: It's just something about the envelope on the sid being slightly unstable. But it's a good feature, especially when it's still possible to stabilize it with hard restart.
Unstable makes melodies more lively, etc. :-)

2011-07-07 20:24
Frantic

Registered: Mar 2003
Posts: 1661
A good source for people who are interested in the ADSR instability is to check the reSID code. There are some explanations regarding internal counters of the sid in the code comments too. If you make the effort to go through the code, it makes the nature of the ADSR bug quite clear.

Basically, there is an internal counter in the ADSR generator that misses a certain criterion under some circumstances, which makes it continue count upwards until it wraps ($ffff->$0000) instead of switching to downwards counting at a certain point as it is supposed to. In the cases when the criterion is missed and the counting just continues upwards, then wrapping, and eventually hitting the stopping criterion, the counting takes longer time, and the result is audible as instable sound (i.e, sometimes a delay, sometimes not, and the length of the delay depends on the states of the counters in relation to the ADSR values that are set). Not sure if that made anything clearer? :)

The delay of 2-3 frames makes sure that the counting is finished no matter if the bug is triggered or not, i.e. the internal counters will have reached a known state. Just to make very clear though: The ADSR bug is not a "random" thing. It just appears that way from the viewpoint of the musician. ...if anyone thought otherwise.

There was also a little article on the ADSR bug in the HVSIDs... uh... some HVSIDS production with articles in it and a bunch of tunes. If I remember correctly, that article wasn't really very pedagogically written though, but I might be wrong. I think it was this one:

10 Years HVSC

People often also mix up, or rather blend, two different things when they talk about "hard restart": Resetting the oscillator on the one hand (just use the testbit: flip on and off and it is reset) and handling the ADSR bug on the other...

@Devia: I am with you when you characterize the lack of filter type init as a "bad rip" problem. Quite obviously, there was some sort of filter type init in the original code if the tune ever played correctly in the original production, just as you say.
2011-07-07 22:05
Devia

Registered: Oct 2004
Posts: 403
Thanks for the info.. I do remember that article about hard restart.. just don't remember actually reading it ;-)

Seem to remember there was some info in the JCH Edit source pack too.. oh well, off to 5 days of beer, rain, beer and no toilets \o/

2011-07-09 08:26
ChristopherJam

Registered: Aug 2004
Posts: 1424
Speaking of the ADSR bug, while I second the recommendation of reading the reSID sources to get a good understanding of how it occurs (especially envelope.cpp), I've just been testing the behaviour of ENV3 and discovered that VICE/reSID starts the envelope off one cycle early.

Is anyone still actively maintaining this emulation combination?

If attack is zero and the envelope rate counter hasn't escaped, env3 becomes 1 between 4 and 12 cycles after writing a 1 to the gate.

lda#1
sta v3ctl
lda env3
ldx env3
ldy env3 ; should always be '1'. Under reSID+VICE is occasionally 2

let me know if you want the rest of the test harness.
2011-07-09 22:23
chatGPZ

Registered: Dec 2001
Posts: 11523
you should definately post that kind of stuff on the vice bugtracker. yes resid is maintained :)
2011-07-12 19:02
ChristopherJam

Registered: Aug 2004
Posts: 1424
Thanks Groepaz, I'll shrink my test code a little and get on it.
2011-07-12 20:07
Frantic

Registered: Mar 2003
Posts: 1661
ChrisJam: Interesting. Even though your finding is related to ADSR envelope, could the "one cycle off" phenomenon possibly be related to the following (which is rather about the waveform oscillators than the ADSR envelope):

http://codebase64.org/doku.php?id=base:detecting_sid_type_-_saf..

?

If it is, then maybe you should take care to test whether the behavior is actually the same on 8580 as on 6581. I am not sure whether the "one cycle off" thing for waveform oscillators is emulated in resid now. (Apparently resid-fp does emulate it).

Nice to see you around btw. Still remember when you first turned up on one of the LCP parties and released that very nice demo with the escher zoomer etc. :)
2011-07-13 12:14
ChristopherJam

Registered: Aug 2004
Posts: 1424
Hmm, good point about SID revisions - according to the test code you posted I've been testing on a 6581, though I should probably open up the c64 in question to double check (I only just retrieved it from my stash in the cupboard last week :)

VICE shows the same 'wrong' behaviour regardless of whether I set it to a ReSID-fp 6581 or a ReSID-fp 8580.

Glad Effluvious made an impression :)
Previous - 1 | 2 | 3 | 4 | 5 | 6 - 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
Mekong/Atheist
Han
Guests online: 262
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 Oxyron  (9.3)
4 Performers  (9.3)
5 Censor Design  (9.3)
Top Organizers
1 Burglar  (9.9)
2 Sixx  (9.8)
3 Tim  (9.7)
4 Irata  (9.7)
5 hedning  (9.7)

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