The links he gives at the very end of the video are also useful.
Next time someone pretends the oric (or whatever ym emulation program) plays the ST tunes identical i'll send him to sndhrecord.atari.org for a comparison :p

Btw. Does someone know if there is a site with oric tune recordings ? Having a good reference is always useful !

Dbug wrote:On the topic, there's some interesting details about sound on Gunstick's presentation: https://www.youtube.com/watch?v=yLDtiTS4JLg
Around the 34th minute there are some Audacity sample output of the three channels, and discussion of the shape on emulators vs real machine.

I have a friend that could explain why emulation need some clever math for giving the correct sound, I haven't seen this video yet, I can ask him to make a simple text to explain why if some of you are interested!

Godzil wrote:
I have a friend that could explain why emulation need some clever math for giving the correct sound, I haven't seen this video yet, I can ask him to make a simple text to explain why if some of you are interested!

I already know why emulation needs some clever math. What i don't know is what this clever math can be. If you friend knows, he's more than welcome to explain !

Godzil wrote:
I have a friend that could explain why emulation need some clever math for giving the correct sound, I haven't seen this video yet, I can ask him to make a simple text to explain why if some of you are interested!

I already know why emulation needs some clever math. What i don't know is what this clever math can be. If you friend knows, he's more than welcome to explain !

I'm probably far too late and/or answering the wrong question, and I'm learning this stuff almost as I type, but as far as I can make out there are two segments of maths involved:

voltage decay;

resampling.

Despite it being about a different chip, the simplest explanation of voltage decay that I could quickly find is under "the imperfect SN76489" here (at least, prior to about a minute ago; it's gone HTTP 503 while I was writing this post but I'm sure it'll be back later; Google has it cached), specifically:

Wherever a voltage (output) is artificially held away from zero, there will be leakage and the actual output will decay towards zero at a rate proportional to the offset from zero:
dV
-- = -kV
dt
where k is a constant.

The diagrams there are artificial but note how they match the measured waves given in the Youtube video linked earlier. So output voltage is a differential equation, a function of voltage and time since the voltage was set. The AY will hit the voltage it is supposed to, then decay until the next conscious change.

Rampling is much more trite — see any of the windowing techniques, e.g. as per here. It's also not something the original hardware does, it's just how you squeeze what the original hardware does out of your speaker. So there's more leeway.

We are using different routines for the different demos:
- The "Welcome" in "Just Oric" is a 8bit sample replayed using three channels and Atari ST Replay log conversion tables
- The "DTS" and "20st Century Fox" in Quintessential are 4 bit samples replayed one one channel, with values very naively converted from the 8bit source. It sounds like hell on my machine as well
- The final sample over the flickering scroll text in Quintessential is Twilighte's routine that uses the VIA shift register, it works on some machines (my Pravetz) not on some other (my Atmos)
- The sample in Oric Tech is a variant of the DTS/20st Century, using a better 4bit conversion, but it's essentially the same code (that being said, may be the VIA selection code was tweaked, can't remember)

To summarize, what can impact the replay is:
- Using the shift register on the VIA
- Having a sound-chip with linear volume tables instead of logarithmic

Quintessential DTS and 20th effects sound like noise in my Atmos and I hear nothing over the final scrolling text, but OricTech sounds perfectly.

Sorry to up this old thread, but I'd be very interested in sorting this issue... I am curious...

So in fact it's the same, but divided by 3 ?
But then, it's like if a single channel can't output more than 0.33V by itself.

The theory seems to say the waveforms should just get added together (averaged if you prefer), yet the sound that's heard in reality suggests otherwise...

You can mix audio sources in two ways : serial or parallel. With serial mixing, the sources are added to one another, and with parallel mixing they are averaged together.

The problem with parallel mixing is that all three outputs share a common ground line, so essentially, when one output sets itself to 0V, it drags the others to the ground as well and the chip has to fight to keep voltage up for the output lines which want to be at 1V. (Which you mentioned in one of your first posts.) The chip is technically trying to output 1V on one of its pin, but that same pin is driven to ground by two other pins at the same time so inevitably it has to give.

Serial mixing is possible and would avoid this issue but it would require the sound chip to dedicate a different ground line for each of the chip audio outputs. This comes with its own set of issues so parallel mixing is preferred as it is simpler and just works.