MAMEWorld >> News
View all threads Index   Threaded Mode Threaded  

Pages: 1

Derrick Renaud
Discrete Coder
Reged: 10/18/03
Posts: 438
Loc: The Local Pub
Send PM


74LS629
#236740 - 10/19/10 04:22 AM Attachment: 74629.mp3 409 KB (154 downloads)


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: 8601
Loc: southern CA, US
Send PM


Re: 74LS629 new [Re: Derrick Renaud]
#236743 - 10/19/10 05:12 AM



>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. :-)

--
74LS629

http://mamedev.org/source/src/emu/sound/disc_dev.c.html

http://mamedev.org/source/src/mame/audio/dkong.c.html
http://mamedev.org/source/src/mame/audio/mario.c.html

--



>The next pic shows the modulation voltage of the walk sound, and sure enough it drops
> into this range.

Very good improvement for some of the Nintendo games.



Sune
Connected
Reged: 09/21/03
Posts: 5648
Loc: Lagoa Santa, Brasil
Send PM


Love it new [Re: Derrick Renaud]
#236746 - 10/19/10 05:23 AM



> 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 new [Re: Sune]
#236747 - 10/19/10 05:26 AM


SAWEET!



horseshoecrabs
MAME Fan
Reged: 11/09/04
Posts: 13
Send PM


Beautiful work! new [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


Re: 74LS629 new [Re: Derrick Renaud]
#236753 - 10/19/10 10:44 AM


Sounds very good, keep it up devs!



----
On a quest for Digital 573 and Dancing Stage EuroMix 2

By gods I've found it!



Derrick Renaud
Discrete Coder
Reged: 10/18/03
Posts: 438
Loc: The Local Pub
Send PM


Re: 74LS629 new [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.



"The Manuel"
Old Fart
Reged: 10/08/03
Posts: 244
Loc: Michigan, USA
Send PM


Re: 74LS629 new [Re: Derrick Renaud]
#236762 - 10/19/10 03:15 PM


I love it when progress is made on long-standing challenges like this.
Will this change the sound of dkongjr only?

Thanks for sharing!



Derrick Renaud
Discrete Coder
Reged: 10/18/03
Posts: 438
Loc: The Local Pub
Send PM


Re: 74LS629 new [Re: "The Manuel"]
#236768 - 10/19/10 05:03 PM


> 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.



"The Manuel"
Old Fart
Reged: 10/08/03
Posts: 244
Loc: Michigan, USA
Send PM


Re: 74LS629 new [Re: Derrick Renaud]
#236770 - 10/19/10 05:31 PM


Ah! One of my favorite oldies.

> Per gregf:
> http://mamedev.org/source/src/mame/audio/mario.c.html
>
> I'm updating that game soon.
>
> D.



tamalmalamarrado
MAME Fan
Reged: 06/10/07
Posts: 48
Send PM


Re: 74LS629 new [Re: Derrick Renaud]
#236772 - 10/19/10 06:20 PM


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


Re: 74LS629 new [Re: Derrick Renaud]
#236773 - 10/19/10 07:01 PM


Funny numbers make funny sounds.

(Yes, it's awesome.)



Derrick Renaud
Discrete Coder
Reged: 10/18/03
Posts: 438
Loc: The Local Pub
Send PM


Re: 74LS629 new [Re: tamalmalamarrado]
#236774 - 10/19/10 07:45 PM


> 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.



Antny
Lurker
Reged: 10/10/03
Posts: 908
Send PM


Re: 74LS629 new [Re: Derrick Renaud]
#236779 - 10/19/10 08:38 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.



CrapBoardSoftware
My real name is banned dickhead
Reged: 01/03/06
Posts: 1250
Loc: Wisconsin
Send PM


Re: 74LS629 new [Re: "The Manuel"]
#236784 - 10/19/10 09:38 PM


> Ah! One of my favorite oldies.

gregf?



"The Manuel"
Old Fart
Reged: 10/08/03
Posts: 244
Loc: Michigan, USA
Send PM


Re: 74LS629 new [Re: CrapBoardSoftware]
#236785 - 10/19/10 09:58 PM




I don't know, I could be older than the guy...



> > Ah! One of my favorite oldies.
>
> gregf?



Derrick Renaud
Discrete Coder
Reged: 10/18/03
Posts: 438
Loc: The Local Pub
Send PM


Re: 74LS629 new [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.



horseshoecrabs
MAME Fan
Reged: 11/09/04
Posts: 13
Send PM


Re: 74LS629 new [Re: Derrick Renaud]
#236790 - 10/20/10 12:02 AM


Can you elaborate for a non-engineer how the simulation / emulation of the sound is changing?



tamalmalamarrado
MAME Fan
Reged: 06/10/07
Posts: 48
Send PM


Re: 74LS629 new [Re: Derrick Renaud]
#236791 - 10/20/10 12:16 AM


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)



Derrick Renaud
Discrete Coder
Reged: 10/18/03
Posts: 438
Loc: The Local Pub
Send PM


Re: 74LS629 new [Re: horseshoecrabs]
#236808 - 10/20/10 04:06 AM


> 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.



horseshoecrabs
MAME Fan
Reged: 11/09/04
Posts: 13
Send PM


Re: 74LS629 new [Re: Derrick Renaud]
#236838 - 10/20/10 03:04 PM


> > 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: 8601
Loc: southern CA, US
Send PM


Re: 74LS629 new [Re: Derrick Renaud]
#236873 - 10/20/10 10:32 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.
-----



Trebor
MAME Fan
Reged: 01/18/05
Posts: 509
Send PM


Phenomenal and incredible... new [Re: Derrick Renaud]
#236878 - 10/20/10 10:58 PM


...work. This is very much appreciated.

Thank you, Derrick and everyone else involved!



Derrick Renaud
Discrete Coder
Reged: 10/18/03
Posts: 438
Loc: The Local Pub
Send PM


Re: 74LS629 new [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.



StilettoAdministrator
They're always after me Lucky ROMS!
Reged: 03/07/04
Posts: 6472
Send PM


Re: 74LS629 new [Re: Derrick Renaud]
#238141 - 11/05/10 10:15 PM


Beautiful, beautiful work. Congrats to all involved.

- Stiletto



mike20599
MAME Fan
Reged: 09/14/08
Posts: 247
Send PM


How many games use the 74LS629? new [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!



Derrick Renaud
Discrete Coder
Reged: 10/18/03
Posts: 438
Loc: The Local Pub
Send PM


Re: How many games use the 74LS629? new [Re: mike20599]
#238272 - 11/07/10 06:29 PM


As far as I know, just Mario Bros and Donkey Kong Jr.


Pages: 1

MAMEWorld >> News
View all threads Index   Threaded Mode Threaded  

Extra information Permissions
Moderator:  John IV, Robbbert, Tafoid 
1 registered and 145 anonymous users are browsing this forum.
You cannot start new topics
You cannot reply to topics
HTML is enabled
UBBCode is enabled
Thread views: 4298