AY emulation testing

Struggling with Fuse or trying to find an emulator with a specific feature. Ask your questions here.
User avatar
djnzx48
Manic Miner
Posts: 729
Joined: Wed Dec 06, 2017 2:13 am
Location: New Zealand

Re: AY emulation testing

Post by djnzx48 »

Is anyone willing to try running the test?

Meanwhile, I found yet another bug: envelope type 13 is broken in Spectaculator. It's supposed to ramp up to the maximum level and stay there, but instead it drops back to 0, resulting in silence. You can see the cause of the problem here:

Image

The envelope level is incremented, but does not get set back to 15 when the cycle ends, causing it to overflow and become silence.
User avatar
Guesser
Manic Miner
Posts: 639
Joined: Wed Nov 15, 2017 2:35 pm
Contact:

Re: AY emulation testing

Post by Guesser »

I've said it before, but I believe the only way to get really accurate AY sound is to first determine how the DACs actually work and then calculate the resulting levels and apply suitable filtering per machine. No fiddling with look-up-table values is going to correctly emulate a +3 for instance.
User avatar
djnzx48
Manic Miner
Posts: 729
Joined: Wed Dec 06, 2017 2:13 am
Location: New Zealand

Re: AY emulation testing

Post by djnzx48 »

Guesser wrote: Fri Sep 13, 2019 12:18 pm I've said it before, but I believe the only way to get really accurate AY sound is to first determine how the DACs actually work and then calculate the resulting levels and apply suitable filtering per machine. No fiddling with look-up-table values is going to correctly emulate a +3 for instance.
Could you elaborate on that? What does a current emulator (using accurate measurements) get wrong that would require proper DAC emulation to rectify? I'm not sure that I see much value in trying to emulate the faulty sound of the +3.

I found some recordings taken from AY and YM chips, and I couldn't detect any volume differences in the tone+noise parts. Or if they are there, the difference is more subtle than claimed. But it's hard to tell without an isolated recording.

I also fixed the envelope 13 bug, here's the patch if anyone wants to apply it.
Spoiler
000021D5:C7->E9
000021D6:00->B7
000021D7:03->07
000021DA:00->90
00002991:00->C7
00002993:00->03
00002997:00->89
00002998:00->1A
00002999:00->E9
0000299A:00->3D
0000299B:00->F8
0000299C:00->FF
0000299D:00->FF
User avatar
1024MAK
Bugaboo
Posts: 3104
Joined: Wed Nov 15, 2017 2:52 pm
Location: Sunny Somerset in the U.K. in Europe

Re: AY emulation testing

Post by 1024MAK »

Amstrad messed up the audio circuitry on the +2A/+3 PCB hence the AY audio is distorted. Note that most +2A machines use a later PCB where they corrected the circuit design.

Also, what type of digital to analogue converter does the AY actually use? And is there good repeatability between chips of different batches...

Mark
:!: Standby alert :!:
“There are four lights!”
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb :dance
Looking forward to summer later in the year.
User avatar
Ast A. Moore
Rick Dangerous
Posts: 2640
Joined: Mon Nov 13, 2017 3:16 pm

Re: AY emulation testing

Post by Ast A. Moore »

djnzx48 wrote: Fri Sep 13, 2019 10:03 am Is anyone willing to try running the test?
Sure. Here’s the audio from my +2A(B). Recorded from the TV speaker.
Matches the output of Fuse, by the way.
Every man should plant a tree, build a house, and write a ZX Spectrum game.

Author of A Yankee in Iraq, a 50 fps shoot-’em-up—the first game to utilize the floating bus on the +2A/+3,
and zasm Z80 Assembler syntax highlighter.
User avatar
djnzx48
Manic Miner
Posts: 729
Joined: Wed Dec 06, 2017 2:13 am
Location: New Zealand

Re: AY emulation testing

Post by djnzx48 »

Thanks. So the 'noise doubling' doesn't seem to occur on a real chip.

I wonder how EvgenRU managed to observe the effect.
User avatar
Guesser
Manic Miner
Posts: 639
Joined: Wed Nov 15, 2017 2:35 pm
Contact:

Re: AY emulation testing

Post by Guesser »

djnzx48 wrote: Sat Sep 14, 2019 5:15 am Could you elaborate on that?
The different models of Spectrum all have different circuits for the AY, though the +3 is where this has the most significant effect on the resulting audio signal as the amplification is all wrong. The +3 and Black +2 circuits both have some low pass filtering too.
Last edited by Guesser on Sat Sep 14, 2019 4:47 pm, edited 1 time in total.
User avatar
Guesser
Manic Miner
Posts: 639
Joined: Wed Nov 15, 2017 2:35 pm
Contact:

Re: AY emulation testing

Post by Guesser »

1024MAK wrote: Sat Sep 14, 2019 10:49 am Also, what type of digital to analogue converter does the AY actually use? And is there good repeatability between chips of different batches...
And what effect does shorting the channels together vs mixing them with a resistor network have on the resulting signal.
User avatar
goodboy
Microbot
Posts: 122
Joined: Tue Jul 23, 2019 8:22 am
Location: Russia

Re: AY emulation testing

Post by goodboy »

full reverse of AY-3-8910 1979 G.I. CORP
http://dlcorp.nedopc.com/download/file.php?id=3033
Post Reply