|
|
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.
|
|
gregf |
Ramtek's Trivia promoter
|
|
|
Reged: 09/21/03
|
Posts: 8615
|
Loc: southern CA, US
|
|
Send PM
|
|
|
|
|
Sune |
Connected
|
|
|
Reged: 09/21/03
|
Posts: 5648
|
Loc: Lagoa Santa, Brasil
|
|
Send PM
|
|
|
|
> Listen to the attached MP3 to hear what the new code changes.
That is abso-friggin-lutely beautiful.
S
|
|
|
redk9258 |
Regular
|
|
|
Reged: 09/21/03
|
Posts: 3968
|
Loc: Troy, Illinois USA
|
|
Send PM
|
|
|
Re: Love it
[Re: Sune]
#236747 - 10/19/10 05:26 AM
|
|
|
|
|
Beautiful work!
[Re: redk9258]
#236750 - 10/19/10 07:04 AM
|
|
|
That sounds nothing short of astounding, especially compared to what it sounds like today.
Bravo!
|
|
|
Naoki |
|
|
|
Reged: 11/10/09
|
Posts: 1998
|
Loc: United Kingdom
|
|
Send PM
|
|
|
|
Sounds very good, keep it up devs!
|
----
On a quest for Digital 573 and Dancing Stage EuroMix 2
By gods I've found it!
|
|
|
Re: 74LS629
[Re: gregf]
#236760 - 10/19/10 02:23 PM
|
|
|
> > Thanks to a patient Smitdogg, we now have this WIP. > > The 74LS629 is a PITA to emulate. > > The long ago purchase [Donkey Kong logic schematics manual] eventually pays off. :-)
Actually has more to do with Smitdogg lending me a Mario board with 74LS629s on it last year. There was no way to get this working without testing a real IC.
So for the viewing audience, yes, devs do get to working on what interests them when they have the time. Smitdogg was very patient and never once demanded something to happen. I started the electrical simulation last year and have a very good idea of how it works. Unfortunately that knowledge has proven that it can not easily be simulated as the constant current oscillator that it is. Summer then came and went. And now I finally got back to it.
What is it RB says? Wait for good things to happen.
D.
|
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.
|
|
|
|
I love it when progress is made on long-standing challenges like this. Will this change the sound of dkongjr only?
Thanks for sharing!
|
|
|
|
|
> Will this change the sound of dkongjr only?
Per gregf: http://mamedev.org/source/src/mame/audio/mario.c.html
I'm updating that game soon.
D.
|
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.
|
|
|
|
|
|
|
An error bigger than the coefficients of the polynom????, it sounds bad :P
Edit: why not you try a polynom as in taylor series?? in the form
a+b*x+c*y+d*x^2+e*x*y+f*y^2+g*x^3+h*x^2*y+i*x*y^2+j*y^3+k*x^4+l*x^3*y+m*x^2*y^2+n*x*y^3+m*y^4+...
Edited by tamalmalamarrado (10/19/10 06:29 PM)
|
|
|
Foxhack |
Furry guy
|
|
|
Reged: 01/30/04
|
Posts: 2409
|
Loc: Spicy Canada
|
|
Send PM
|
|
|
|
Funny numbers make funny sounds.
(Yes, it's awesome.)
|
|
|
|
|
> An error bigger than the coefficients of the polynom????, it sounds bad :P
Check the percent error graph. It is not that bad. There is going to be measurement errors in the test equipment I used. It's not like I have digital power supplies that will put out accurate 0.1V or less stepped voltages. I have to tweak the knob, get the voltage close to where I want it, then measure. Not to mention the frequency counter I used only does 4 digits. Notice all frequencies I measured above 10000Hz all end in 0. I really need to fix my 100MHz scope with built-in frequency counter.
Remember the chip is not a high tolerance waveform generator. So the errors are well within the tolerance of the chip. When the modulation voltage is below 1V, the frequency can start to jitter, so IMHO, this simulation is close enough. There is no way to make it 100%.
> Edit: why not you try a polynom as in taylor series?? in the form > a+b*x+c*y+d*x^2+e*x*y+f*y^2+g*x^3+h*x^2*y+i*x*y^2+j*y^3+k*x^4+l*x^3*y+m*x^2*y^2+n*x*y^3+m*y^4+...
I just used what www.zunzun.com recommended and looked closest. Here is the data I used. If you have a better formula, that is not significantly slower, then I will try it out. Right now the new code is a few percent quicker then the old code.
Code:
Range Fmod Freq 5 0 890 5 0.21 787 5 0.3 696 5 0.4 635 5 0.5 644 5 0.6 692 5 0.7 736 5 0.8 773 5 0.9 821 5 1 856 5 1.1 905 5 1.2 960 5 1.3 1026 5 1.4 1087 5 1.5 1153 5 1.6 1221 5 1.7 1291 5 1.8 1365 5 1.9 1436 5 2 1515 5 2.1 1589 5 2.2 1665 5 2.3 1742 5 2.4 1819 5 2.5 1893 5 2.6 1977 5 2.7 2055 5 2.8 2140 5 2.9 2221 5 3 2305 5 3.1 2391 5 3.2 2477 5 3.3 2561 5 3.4 2643 5 3.5 2734 5 3.6 2818 5 3.7 2906 5 3.8 2995 5 3.9 3089 5 4 3177 5 4.1 3263 5 4.2 3354 5 4.3 3447 5 4.4 3536 5 4.5 3625 5 4.6 3720 5 4.7 3808 5 4.8 3902 5 4.9 3996 5 5 4087 0 0 1995 0 0.21 2289 0 0.3 2449 0 0.4 2666 0 0.5 2911 0 0.6 3156 0 0.7 3445 0 0.8 3748 0 0.9 4042 0 1 4387 0 1.1 4740 0 1.2 5101 0 1.3 5496 0 1.4 5864 0 1.5 6278 0 1.6 6681 0 1.7 7125 0 1.8 7590 0 1.9 8029 0 2 8480 0 2.1 8984 0 2.2 9485 0 2.3 9985 0 2.4 10450 0 2.5 10960 0 2.6 11480 0 2.7 12010 0 2.8 12550 0 2.9 13070 0 3 13610 0 3.1 14150 0 3.2 14690 0 3.3 15220 0 3.4 15720 0 3.5 16280 0 3.6 16780 0 3.7 17300 0 3.8 17800 0 3.9 18340 0 4 18850 0 4.1 19340 0 4.2 19840 0 4.3 20340 0 4.4 20810 0 4.5 21300 0 4.6 21780 0 4.7 22230 0 4.8 22710 0 4.9 23160 0 5 23610
D.
|
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.
|
|
|
|
I'm glad you finally did this. I was about to come to your house and complain in person about your "lack of progress" on this matter.
|
|
|
|
|
> Ah! One of my favorite oldies.
gregf?
|
|
|
|
|
I don't know, I could be older than the guy...
> > Ah! One of my favorite oldies. > > gregf?
|
|
|
|
Re: 74LS629
[Re: Antny]
#236786 - 10/19/10 10:01 PM
|
|
|
> I'm glad you finally did this. I was about to come to your house and complain in > person about your "lack of progress" on this matter.
You know the rules. Bring beer.
|
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.
|
|
|
|
Can you elaborate for a non-engineer how the simulation / emulation of the sound is changing?
|
|
|
|
|
ok, i can´t get a better polynom. With the polynom a+b*x+c*y+d*x^2+e*x*y+f*y^2+g*x^3+h*x^2*y+i*x*y^2+j*y^3+k*x^4+l*x^3*y+m*x^2*y^2+n*x*y^3+o*y^4 and
a=2029.88808308354 b=106.090966107482 c=1052.34077029347 d=-674.870916986877 e=6.23776156391548 f=1464.53852573267 g=272.284647887558 h=84.5971312459074 i=-107.333218843179 j=-197.518327994408 k=-30.3172098568589 l=-28.2290161372278 m=-16.6987890621752 n=19.9948187485705 o=7.03235515902020
with x=Range, y=Fmod and using matlab the máximum relative error than it polynom gets is of 13%, so i think that your short polynom is the best choice (y)(y)(y)
|
|
|
|
|
> Can you elaborate for a non-engineer how the simulation / emulation of the sound is > changing?
The old code was based on the data sheet, which are notoriously incorrect. The new code is based on testing the real IC. The old code generated frequencies that were too low. Lets say the real chip puts out 56kHz under certain conditions. The old code would only generate 30kHz. The new code generates 56kHz.
Or as Kitsune Sniper said: "Funny numbers make funny sounds."
D.
|
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.
|
|
|
|
> > Can you elaborate for a non-engineer how the simulation / emulation of the sound is > > changing? > > The old code was based on the data sheet, which are notoriously incorrect. The new > code is based on testing the real IC. The old code generated frequencies that were > too low. Lets say the real chip puts out 56kHz under certain conditions. The old code > would only generate 30kHz. The new code generates 56kHz. > > Or as Kitsune Sniper said: "Funny numbers make funny sounds." > > D.
Thank you for the explanation!
I take it this caused higher-frequency sounds to get changed [or compressed?] down to lower tones. It definitely didn't sound right before, now it sounds perfect.
|
|
|
gregf |
Ramtek's Trivia promoter
|
|
|
Reged: 09/21/03
|
Posts: 8615
|
Loc: southern CA, US
|
|
Send PM
|
|
|
|
>>> Thanks to a patient Smitdogg, we now have this WIP. >>> The 74LS629 is a PITA to emulate. >> The long ago purchase [Donkey Kong logic schematics manual]
>Actually has more to do with Smitdogg lending me a Mario board with 74LS629s on it last > year. There was no way to get this working without testing a real IC.
Okay. I changed my guess and figured it was from a pcb, but wasn't sure which one. As before, good work there.
Is a 566 chip or a pcb (Exidy audio pcb from an Exidy game) still needed? Or is the 566 complete?
------- http://mamedev.org/source/src/emu/sound/disc_dev.c.html
DSD_566 - Usage of node_description values * * Mar 2004, D Renaud. updated Sept 2009 * * The data sheets for this are no where near correct. * This simulation is based on the internal schematic and testing of * a real Signetics IC. -----
|
|
|
|
Phenomenal and incredible...
[Re: Derrick Renaud]
#236878 - 10/20/10 10:58 PM
|
|
|
...work. This is very much appreciated.
Thank you, Derrick and everyone else involved!
|
|
|
|
Re: 74LS629
[Re: gregf]
#236929 - 10/21/10 02:16 PM
|
|
|
> Is a 566 chip or a pcb (Exidy audio pcb from an Exidy game) still needed? Or is the > 566 complete?
> * This simulation is based on the internal schematic and testing of > * a real Signetics IC.
The 566 is complete. Thanks. Much easier chip to emulate. It behaves like a proper constant current oscillator should. Unlike the 74LS629.
|
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.
|
|
Stiletto |
They're always after me Lucky ROMS!
|
|
|
Reged: 03/07/04
|
Posts: 6472
|
|
|
Send PM
|
|
|
|
Beautiful, beautiful work. Congrats to all involved.
- Stiletto
|
|
|
|
How many games use the 74LS629?
[Re: Derrick Renaud]
#238240 - 11/07/10 02:37 AM
|
|
|
This seems really cool even though I don't understand half of it. Sounds better though!
|
|
|
|
Re: How many games use the 74LS629?
[Re: mike20599]
#238272 - 11/07/10 06:29 PM
|
|
|
As far as I know, just Mario Bros and Donkey Kong Jr.
|
|
|