Thanks to a patient Smitdogg, we now have this WIP.
The 74LS629 is a PITA to emulate. I wanted to do a full electrical equivalent circuit in code, but it looks like it won't happen that way. There are too many non-linear inter-reactions depending on the freq and range voltages. So I settled on just getting data points from the chip and plugged the info into www.zunzun.com to get an equivalent formula. Which is:
z = a + by + cy2 + dy3 + fy4 + gx + hxy + ixy2 + jxy3 + kxy4 Fitting target of sum of squared absolute error = 4.8112640388343825E+04 a = 1.9904769024796306E+03 b = 1.2070059213983361E+03 c = 1.3266985579561126E+03 d = -1.5500979825922744E+02 f = 2.8184536266936275E+00 g = -2.3503421582744636E+02 h = -3.3836786704527731E+02 i = -1.3569136703258712E+02 j = 2.9914575453822643E+00 k = 1.6855569086172972E+00 where x=range; y=fmod; z=freq out
The following pic shows the measured data points I used. Notice that with the range voltage at 5V, the frequency gets lower as the modulation voltage gets lower, except at below 0.5V when the frequency starts to get higher again.
The data sheet says not to use modulation voltages less then 1V for this reason. Of course no one listens. The next pic shows the modulation voltage of the dkongjr walk sound, and sure enough it drops into this range.
This is why I settled on an equivalent formula, instead of an electrical simulation. No major difference to the ears. Here are a couple fancy 3D pics of the interaction of the range and modulation voltages on the output frequency.
The other fun thing on this chip, is that it is sensitive to heat changes. Heck I think passing airplanes have an effect on it. So the tolerance varies a bit, especially with modulation voltages under 1V, with under 0.5V being real finicky. So here is a graph of the error based on measured data and formula output. Its well within the tolerances of the IC.
Listen to the attached MP3 to hear what the new code changes.
Do not p-mail me for help compiling my updates, ask on the board.
Do not request sound for your favorite game. I work on whatever, when I get around to it.
If you have schematics for discrete sound games not easily found on the net, I would be interested.
|