Problem with SID envelopes
category: general [glöplog]
It's come to my attention that the envelope handling in my SID playback driver isn't working properly. I've just gone by the C64 Programmer's Reference when writing it, so I thought I should ask around on pouet since I'm sure a lot of c64 coders lurk here.
The desired behavior is that the envelope is reset every time a new note is started. The way I try to accomplish this is by first writing a value with bit 0 (GATE) clear to $D404+n*7, then I set the new frequency and then I write a value with bit 0 set to $D404+n*7. My problem is that the envelopes never seem to be reset. They output level will gradually go up to the sustain level over the course of several notes, and then just stays there.
Any ideas?
The desired behavior is that the envelope is reset every time a new note is started. The way I try to accomplish this is by first writing a value with bit 0 (GATE) clear to $D404+n*7, then I set the new frequency and then I write a value with bit 0 set to $D404+n*7. My problem is that the envelopes never seem to be reset. They output level will gradually go up to the sustain level over the course of several notes, and then just stays there.
Any ideas?
http://noname.c64.org/csdb/forums/?roomid=14&topicid=27340&showallposts=1
http://noname.c64.org/csdb/forums/?roomid=14&topicid=27005&showallposts=1
http://noname.c64.org/csdb/forums/?roomid=14&topicid=15934
http://noname.c64.org/csdb/forums/?roomid=14&topicid=27005&showallposts=1
http://noname.c64.org/csdb/forums/?roomid=14&topicid=15934
http://www.oxyron.de/html/registers_sid.html
http://noname.c64.org/csdb/forums/?roomid=14&topicid=27340&showallposts=1
http://noname.c64.org/csdb/forums/?roomid=14&topicid=27005&showallposts=1
http://noname.c64.org/csdb/forums/?roomid=14&topicid=15934
http://www.oxyron.de/html/registers_sid.html
Also, don't go by the reference.
http://noname.c64.org/csdb/forums/?roomid=14&topicid=27005&showallposts=1
http://noname.c64.org/csdb/forums/?roomid=14&topicid=15934
http://www.oxyron.de/html/registers_sid.html
Also, don't go by the reference.
Quote:
The funniest thing I remember was getting in a whole bunch of C-64 video games which had been written in Japan. The Japanese are so obsessed with technical specifications that they had written their code according to a SID spec. sheet (which I had written before SID prototypes even existed). Needless to say, the specs were not accurate. Rather than correct the obvious errors in their code, they produced games with out of tune sounds and filter settings that produced only quiet, muffled sound at the output. As far as they were concerned, it didn't matter that their code sounded all wrong, they had written their code correctly according to the spec. and that was all that mattered!
Bob Yannes, designer of the SID
Hihi. More anal than ze Germans even...
Not as anal as building a piece of hardware that requires you to start resetting the envelope 3 frames in advance for it to work properly.
Scheisse! :P
Scheisse! :P
Yeah the amount of bytes I've wasted fixing that gate stuff. SID is no friend of 1k demos.