pouët.net

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?
added on the 2010-02-19 18:54:17 by mic mic
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
added on the 2010-02-19 19:26:06 by Oswald Oswald
http://www.oxyron.de/html/registers_sid.html
added on the 2010-02-20 02:29:55 by Zonkham Zonkham
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.

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

added on the 2010-02-20 03:26:57 by QUINTIX QUINTIX
Hihi. More anal than ze Germans even...
added on the 2010-02-20 12:16:39 by raer raer
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
added on the 2010-02-20 13:14:29 by mic mic
Yeah the amount of bytes I've wasted fixing that gate stuff. SID is no friend of 1k demos.
added on the 2010-02-20 14:47:16 by 4mat 4mat

login