Oric's 8912 volume scale

Probably the most technical forum around. It does not have to be coding related, or assembly code only. Just talk about how you can use the AY chip to do cool sounding things :)
User avatar
meynaf
1st Star Corporal
Posts: 14
Joined: Mon Jul 18, 2016 6:37 pm
Location: Lyon (France)
Contact:

Re: Oric's 8912 volume scale

Post by meynaf » Mon Aug 08, 2016 10:06 am

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 !

Godzil
Squad Leader
Posts: 758
Joined: Sat May 21, 2011 7:21 pm
Location: Between UK and France
Contact:

Re: Oric's 8912 volume scale

Post by Godzil » Mon Aug 08, 2016 7:40 pm

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!

User avatar
meynaf
1st Star Corporal
Posts: 14
Joined: Mon Jul 18, 2016 6:37 pm
Location: Lyon (France)
Contact:

Re: Oric's 8912 volume scale

Post by meynaf » Mon Aug 08, 2016 9:14 pm

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 !

ThomH
Flying Officer
Posts: 136
Joined: Thu Oct 13, 2016 9:55 pm

Re: Oric's 8912 volume scale

Post by ThomH » Wed Oct 19, 2016 3:06 pm

meynaf wrote:
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.

User avatar
Chema
Game master
Posts: 2240
Joined: Tue Jan 17, 2006 10:55 am
Location: Gijón, SPAIN
Contact:

Re: Oric's 8912 volume scale

Post by Chema » Fri Jun 15, 2018 7:19 pm

Dbug wrote:
Wed Jul 20, 2016 9:43 am
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 :D
- 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...

User avatar
NekoNoNiaow
Pilot Officer
Posts: 102
Joined: Sun Jan 15, 2006 10:08 pm
Location: Montreal, Canadia

Re: Oric's 8912 volume scale

Post by NekoNoNiaow » Sat Jun 16, 2018 4:04 am

Hey Meynaf, funny to see you outside of the EAB.
Are you by chance writing an Oric emulator for ECS Amigas? ;)
meynaf wrote:
Tue Jul 19, 2016 8:04 pm
Godzil wrote: The formula is (V1 + V2 + V3) / Number_Of_Source so here:

(1+0+0)/3 = 0.33333V
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.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest