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: 75
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?
2011-07-03 01:27
Soren

Registered: Dec 2001
Posts: 547
Different musics, different music routines, possibly?
resetting oscillators (testbit in waveform register)should have to do with parts of this issue. I bet the oscillators start running as soon as they are NOT reset.
d404,09 = gate on and reset oscillator.
So d404,0 possibly lets the oscillator running, even though no waveform is really played, but the phase is not reset.
Also ADSR might give some problems.
There are people that know far much more than me about this, so lets wait and see. :-)
2011-07-03 06:32
iAN CooG

Registered: May 2002
Posts: 3132
It happened very often to me to reset the SID between an intro and a game by writing first $ff then $00 to every sidregs, else the game tune would sound w/o a voice or with one continuous BEEP. There are a shitload of intros out there that don't take the problem of properly reset the SID into account =)
2011-07-03 07:14
Hermit

Registered: May 2008
Posts: 208
I don't know whether it's the same issue, but I remember, when I was coding SRA Music Collection, and wanted to fade out tunes, some of the tunes played ugly after fading out the previous in the list.
I had to remove the fade-out function. Whatever I did, didn't help. Maybe this $ff then $00 would have been the solution to start every tune correctly, not depending on previous tune.
Now in my player I'm trying with $08 to every register at init/startup, as I saw in some tunes at RakBit project. An ancient way possibly, but simple, and resets the oscillators.
Anyway. That's why I like SID, it's soo analog, if it was a living creature not a chip, which always has new aspects to discover.
2011-07-03 08:59
Conrad

Registered: Nov 2006
Posts: 833
Quote: It happened very often to me to reset the SID between an intro and a game by writing first $ff then $00 to every sidregs, else the game tune would sound w/o a voice or with one continuous BEEP. There are a shitload of intros out there that don't take the problem of properly reset the SID into account =)

Yeah, the older intros used the kernal routines to reset the VIC, but didn't necessarily reset the sid registers either. You could definitely tell with those lame frozen "cracks" some groups did. ;)

One thing I know is that you can reset the noise generator by set waveform $91, and then a frame later, reset with $09, as Jeff mentioned. Works wonders with tunes that use phase effects with the noise waveform.
2011-07-03 18:41
ThunderBlade

Registered: Jan 2002
Posts: 75
Thank you for the hints, yes it's different play routines. I will try the suggested solutions.
2011-07-03 18:49
Frantic

Registered: Mar 2003
Posts: 1627
I haven't really experimented with, or thought closely about, how to reset the sid in the best possible way, but...

Filter regs, frequency regs, and pulse width regs should simply be set to 00.

I would first set ADSR regs to 00, then set the control registers to $08 to set gate off and turn oscillators off (what Jeff suggested, sort of). Then you should preferably wait for a while (2-3 frames should be completely safe) to make sure that the internal ADSR counters are reset properly.

...and finally, if everything is silent when you try to play your tune, just set global sid volume to $0f before initializing the tune. (The tune init routine really should take care of this itself though, so I guess you won't ever need that.)

2011-07-03 19:57
iAN CooG

Registered: May 2002
Posts: 3132
or even $1f as probably is best for most tunes, happened also that some tunes lacked a proper init (yes there are) and setting $0f would make the tune play with one voice muted =)
2011-07-03 20:09
j0x

Registered: Mar 2004
Posts: 215
ian: Am I somehow misunderstanding your post? To me, $0f should be the correct value. Adding $10 just enables the low-pass filter. Are you mixing up bits 3 and 7 here?
2011-07-03 20:28
Frantic

Registered: Mar 2003
Posts: 1627
j0x: I thought just the same.. I think Ian got something wrong here..
2011-07-03 20:28
iAN CooG

Registered: May 2002
Posts: 3132
jox: no, many tunes with muted voices were fixed by setting $1f instead of $0f. I've done quite a bunch of them in the lastest HVSC updates.
one of the many examples
# from iAN CooG: Restored $d418 setting, bassline now it's audible.
/update/fix/MUSICIANS/C/Coolrock/Commercial_Music_3.sid
/MUSICIANS/C/Coolrock/

if you remove the sta $d418 like it was before, sidplay defaults to lda #$0f sta $d418 before jmping to the init. and the bassline is not audible anymore. there were plenty, just check the hvsc updates =)
 
... 40 posts hidden. Click here to view all posts....
 
Previous - 1 | 2 | 3 | 4 | 5 - 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
andym00
psych
Mr. SID
Krill/Plush
kbs/Pht/Lxt
Viti/Hokuto Force
New Design/Excess
Flavioweb/🇮🇹HF..
Guests online: 199
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 Bromance  (9.6)
10 Memento Mori  (9.6)
Top onefile Demos
1 It's More Fun to Com..  (9.7)
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 Wafer Demo  (9.5)
9 Dawnfall V1.1  (9.5)
10 Quadrants  (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 Musicians
1 Rob Hubbard  (9.7)
2 Jeroen Tel  (9.7)
3 Stinsen  (9.6)
4 Mutetus  (9.6)
5 Linus  (9.6)

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