I think it should be fairly easy to test, with enough sample to found the way the random is generated, just configure the channel to random, let it play for a long time and store the waveform, then convert that waveform for each output level, and with time you will get a repetition, and from that point, just find the math that produce the sequence.

It is probably what they have done in the link you put (I haven't checked them yet)

I can't hear the "bells" with Oricutron on the Xenon-1 meteors screen though; maybe an embryo of it when I apply some noise reduction but nothing obvious as in the samples I posted.
I mean the sound is perfect, but might not have the original mistakes?

Godzil wrote:Obviously an emulator will miss the analog part (filter & so on) that are not impossible to emulate but really time consuming to get something accurate..

Mine has a filter; it creates a wave at the chip's clock rate then performs a windowing filter to reduce it to your computer's sampling rate. But if there's a post-AY filter on the board then I haven't noticed it yet. Any idea what there real response range is? I can throw it in.

Godzil wrote:Obviously an emulator will miss the analog part (filter & so on) that are not impossible to emulate but really time consuming to get something accurate..

Mine has a filter; it creates a wave at the chip's clock rate then performs a windowing filter to reduce it to your computer's sampling rate. But if there's a post-AY filter on the board then I haven't noticed it yet. Any idea what there real response range is? I can throw it in.

There are at least a RC filter on the output.

Do you apply filter to mimic the real life way the signal is generated? Because it's not juste setting the voltage to a specific level, it's a bit more complexe in reality (due to a lot of factors)
This paper is interesting (but really hardcore if you are not a mad math person.. ): https://ccrma.stanford.edu/~stilti/papers/blit.pdf
I had some other documentation if I find them I will share them

Godzil wrote:Obviously an emulator will miss the analog part (filter & so on) that are not impossible to emulate but really time consuming to get something accurate..

Mine has a filter; it creates a wave at the chip's clock rate then performs a windowing filter to reduce it to your computer's sampling rate. But if there's a post-AY filter on the board then I haven't noticed it yet. Any idea what there real response range is? I can throw it in.

There are at least a RC filter on the output.

Do you apply filter to mimic the real life way the signal is generated? Because it's not juste setting the voltage to a specific level, it's a bit more complexe in reality (due to a lot of factors)
This paper is interesting (but really hardcore if you are not a mad math person.. ): https://ccrma.stanford.edu/~stilti/papers/blit.pdf
I had some other documentation if I find them I will share them

I do not, because I currently lack the knowledge. Sampling at the original rate and then filtering down is more about not just throwing away any of the information I'm definitely sure of than an attempt to be electrically accurate. And also because you need to do similar stuff over on the video side to decode composite video so, if you've decided you're doing that, why not use the same code in two places? I'll definitely see what sense I can make, if any, of the linked paper.

I still can't match Oricutron for overall compatibility though. So possibly I'm making a mistake on sweating these details.

EDIT: I've got a Kaiser Bessel windowing filter implemented, for the curious. The pure C++ does it with scalars, but Mac builds use a Mac-specific framework to offload the work onto your CPU's SIMD instructions, for the audio side. Video's on the GPU.

For the record, an example of my emulator's current attempt at AY playback is here and attached in lossless form — it's the opening of Barbitoric (with disk access gaps). The windowing filtering gives some very non-square wave forms such as the below, based on some real maths, so hopefully I'm already doing okay. Always room for improvement though, of course.

EDIT: to save anybody else saying it, comparing that to a Youtube recording of unspecified provenance (i.e. real hardware or emulator, but it probably doesn't matter), I'm off key. I must either have my AY clock rate wrong or be doing something stupid like shifting the tone dividers incorrectly. I'll need to look into that. The rule is still that if you're looking for an emulator that's, you know, good at running the original platform software, go with Oricutron. Done. The value of being better at resampling a wave is limited if the original wave is wrong.