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:

Oric's 8912 volume scale

Post by meynaf »

Hi, i'm new here.


The question is related to audio output volumes.
Normally they are logarithmic so that +2 volume equals *2 amplitude.
Normally channels are mixed linearly so two channels playing the same sound equals twice the amplitude.
All similar chips (AY 8910, YM 2149) should behave the same.

Well... Not quite right.
It's known that on the Atari ST the audio mixing isn't linear. Emulators use a 4096 entry table, which was obtained by measuring the output levels.
I myself experienced wrong output when playing an oric music on the atari.

But...
When applying the normal rules to my old oric music rips (in my soundchip emulation) i get wrong results again.
It seems ok up to volume 13 but then it starts to become too loud.
So i'm wondering if the sound doesn't saturate, say, 3 channels together are 3V and this is perhaps too much for the small loudspeaker or the electronic itself.
However even a single channel with volume 15 is too loud.
I know my oric sound memories are a little rusty, but nevertheless.

My question is : do someone know what exact rules to apply when mixing sound channels so it'll sound exactly like the oric ?
User avatar
Dbug
Site Admin
Posts: 4437
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: Oric's 8912 volume scale

Post by Dbug »

Well, in my own experience, the Oric sound chip behaves exactly as the one of the Atari ST, except the 1mhz vs 2mhz base frequency which requires some adjustment for both the frequencies used for channels and enveloppe duration.

For my Oric demos I've converted a bunch of Atari ST musics directly to the Oric (using Ym2Mym), and I even replayed 8 bit sample sounds using the ST Replay logarithm compensated volume tables.

Maybe your Oric simply has a tired speaker or amplifier :D ?
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 »

Yeah sure, you convert things, but you're never sure they're really played like they ought to be.
Ym tunes are usually much louder than oric tunes ; oric is normally around 9 in volume while ym's evolve around 12-14. So ym tunes should scare you away if you play them with the same volume level. Noticed that ? Else perhaps you're plugging the oric into some amp and not use the internal speaker ?

I can't check now, my oric is long dead. But back in 1990 when both were still working fine, the situation was clear. I simply couldn't make the st play oric musics correctly (i didn't try the other way around).
And no, the oric was fine. Heard several orics, all were the same.
And no, it wasn't the st either :wink:

It's like many software pretending they play protracker music. They can play many of them. But on some they fail miserably.
However without a good reference you can't know.
User avatar
Dbug
Site Admin
Posts: 4437
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: Oric's 8912 volume scale

Post by Dbug »

meynaf wrote:Yeah sure, you convert things, but you're never sure they're really played like they ought to be.
Well, I've been using the Atari ST for quite a while, and the musics I converted were almost all musics I did listen to a lot on the Atari :)
meynaf wrote:Ym tunes are usually much louder than oric tunes ; oric is normally around 9 in volume while ym's evolve around 12-14. So ym tunes should scare you away if you play them with the same volume level. Noticed that ? Else perhaps you're plugging the oric into some amp and not use the internal speaker ?
Maybe the difference is that I always modded my Orics to add a jack connector to disconnect the internal speaker and connect to outside audio with volume control, mostly because back in the days I could not play on the Oric on the sunday morning without waking up the entire household.

Based on that, I would stay with my theory that the GI in the Oric outputs sound pretty much identical as the YM in the ST, but possibly the internal speaker is not able to cope with the volume without a lot of distortion.

The problem is, the way the soundchip works you cannot possibly lower the volume of an Atari ST music because you have no control on the volume of the enveloppe generated sounds.
User avatar
Chema
Game master
Posts: 3013
Joined: Tue Jan 17, 2006 10:55 am
Location: Gijón, SPAIN
Contact:

Re: Oric's 8912 volume scale

Post by Chema »

Mmmm maybe some Orics have different AY chips or something different on the sound parts? I think I recall something about this, and it was related to the way it handled the volume (log scale).

My Oric, for instance, plays horrible noise with the digitized music of one of your demos (Barbitoric? - the one with the 20th century fox music) and also has problems with Zip&Zap which has ditigized sfx...

I always wondered if I had something wrong with my Oric or if there was something incompatible in its hardware. I think Twilighte said something about this but my memory is what it used to be: horrible :)
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 »

Dbug wrote: Well, I've been using the Atari ST for quite a while, and the musics I converted were almost all musics I did listen to a lot on the Atari :)
Some musics are quite tolerant ;)
So on many musics you won't be able to tell the difference.

Got some emulator source which said basically this : on the ST the three voice outputs are bridged together and then connected to ground via a capacitor, causing a high-frequency roll-off that depends on the internal resistance of the chip. In addition, the D/As must work against each other because there are no resistors between them to reduce load.

Dbug wrote: Maybe the difference is that I always modded my Orics to add a jack connector to disconnect the internal speaker and connect to outside audio with volume control, mostly because back in the days I could not play on the Oric on the sunday morning without waking up the entire household.
Now we know where the thing comes from.
Perhaps you need to check an oric with internal speaker and see that it'll render very differently.
I remember having plugged the oric to an external amp and it sounded very deceiving. Now i know why.

Dbug wrote: Based on that, I would stay with my theory that the GI in the Oric outputs sound pretty much identical as the YM in the ST, but possibly the internal speaker is not able to cope with the volume without a lot of distortion.
And so i want to know how to make oric musics sound like before. I guess the thing starts to do clipping so perhaps a simple volume limitation could be enough. But by how much, is another story.

Remember that max single channel output is 1V so you can get max 3V. The small loudspeaker probably can't cope.

Dbug wrote: The problem is, the way the soundchip works you cannot possibly lower the volume of an Atari ST music because you have no control on the volume of the enveloppe generated sounds.
Envelope is (relative) rarely used on the Atari ST. Many musics simply don't use it.
However when they do, they use a very small period value which throws simple emulation to valhalla.

Chema wrote: Mmmm maybe some Orics have different AY chips or something different on the sound parts? I think I recall something about this, and it was related to the way it handled the volume (log scale).
All chips should be identical. They all have the same volume scale.
IIRC AY 8912 and AY 8910 are different in the fact that 8912 does not have the second i/o port (= diff isn't sound related).
The YM2149 has 32 volume levels for envelope, not just 16 like the AY (but i can't tell a music where this shows up).

Chema wrote: My Oric, for instance, plays horrible noise with the digitized music of one of your demos (Barbitoric? - the one with the 20th century fox music) and also has problems with Zip&Zap which has ditigized sfx...

I always wondered if I had something wrong with my Oric or if there was something incompatible in its hardware. I think Twilighte said something about this but my memory is what it used to be: horrible :)
The chip itself is the same, but not what's after.
It outputs its 3 channels separate. Then they must be mixed somehow. Here lies the problem.
User avatar
Dbug
Site Admin
Posts: 4437
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: Oric's 8912 volume scale

Post by Dbug »

meynaf wrote:And so i want to know how to make oric musics sound like before. I guess the thing starts to do clipping so perhaps a simple volume limitation could be enough. But by how much, is another story.
Remember that max single channel output is 1V so you can get max 3V. The small loudspeaker probably can't cope.
Maybe it's just a matter of reducing the voltage before it comes to the speaker.
meynaf wrote:Envelope is (relative) rarely used on the Atari ST. Many musics simply don't use it.
However when they do, they use a very small period value which throws simple emulation to valhalla.
Most old ST musics don't use the enveloppe, but I can guarantee you that anything from Count Zero, LAP or Jess is using the enveloppe a lot, mostly to generate some buzzer or metallic sounding lines.

meynaf wrote:All chips should be identical. They all have the same volume scale.
Not true :)
I had modified my 520 STf by adding two CINCH connectors on the back so it could be plugged on an external amplifier.
A friend of mine unplugged the machine while the amplified was on, resulting in a loud bang, electric spark and fried YM soundchip (very annoying on the ST because that makes you lose the side selection pin, so you can't load double sided floppies anymore).

A friend of mine had a GI chip lying around, and after some butchery involving cutting down pins, soldering a socket, and putting the GI on top we found out that most musics played correctly, but that indeed anything involving samples or fine volume control was just not working well at all.

I tested that by removing the log scaling from the volume tables the samples were playing ok again.

So yes, I have first hand confirmation that some of the AY compatible chips do have linear volume output.
Godzil
Squad Leader
Posts: 774
Joined: Sat May 21, 2011 7:21 pm
Location: Between UK and France
Contact:

Re: Oric's 8912 volume scale

Post by Godzil »

GI is the original chip manufacturer (now they are microchip BTW) and the AY are the version made by Yamaha, but both use the same die, at least the same layout for the die, there are maybe some slight changes, but both are normally the same chip.


On the oric, the 3 channels are directly mixed on the PCB near the chip (all A, B and C output are connected) then you have some filters and then connected to a simple LM386 opamp, nothing really special, but I think there were different manufacturer of the LM386 used, so there are maybe some slight changes there.

If I remember correctly the Atari mixing is similar but lack the amplifier as the signal is given at a "line level" on with RBG output and for the RF modulator for the ST that have it. (I've just looked at the STE schematics I don't see any filters but the schematics is really dirty)

One of the few thing that could fail on the Oric, the first is the OpAmp, different brand with different process and "pin compatible" OpAmp does not mean same things, unlike the GI and AY chips where the silicium should be identical.

Also, the capacitors around, especially in the filters as they are normal capacitors (~20 to 50% tolerance) it may dramatically change the filter frequency response. Same for the resistors used as they are 5%, but it would have less impact as the change is smaller.

Also capacitors like tantalum and electrolytic have their characteristics that change with time so the older they are the worse they are going to be, that's why 20 years electrolytic caps need to be replaced by brand new one, and possibly a good brand with better temperature characteristics and better characteristics in general.

Same on the LM386, replace it with a better audio opamp could dramatically change the sound response.
The LM386 is an audio opamp with "low distortion" as TI claim (see http://www.ti.com/lit/ds/symlink/lm386.pdf )

But it's not a rail 2 rail op amp and the switch characteristics are not made for high fidelity, you just need to look at the typical useages:

- AM-FM radio amplifiers
- Portable tape player amplifiers n Intercoms
- TV sound systems

It's clearly not devices with the best quality entry signal.
jede
Flying Officer
Posts: 191
Joined: Tue Mar 14, 2006 11:53 am
Location: France

Re: Oric's 8912 volume scale

Post by jede »

Chema wrote:Mmmm maybe some Orics have different AY chips or something different on the sound parts? I think I recall something about this, and it was related to the way it handled the volume (log scale).

My Oric, for instance, plays horrible noise with the digitized music of one of your demos (Barbitoric? - the one with the 20th century fox music) and also has problems with Zip&Zap which has ditigized sfx...

I always wondered if I had something wrong with my Oric or if there was something incompatible in its hardware. I think Twilighte said something about this but my memory is what it used to be: horrible :)
Hello,

in twilighte's case, It is probably a 6522 different chip. I can't remember, but some VIA6522 handles pins differently. That is why some samples (from Twilighte) can't be played on a real oric if it has the wrong VIA. Twilighte used a trick to play quicker music/samples (when he sends data to PSG across the 6522).

Twilighte were really upset with this problem because he could play sound quicker.

For example, the last sample in VIP4 demo does not work correctly on some oric.

The case is explained in twilighte's keyboard code (i think it's the same problem)

http://miniserve.defence-force.org/svn/ ... keyboard.s
/*
; Clear CB2, as keeping it high hangs on some orics.
; Pitty, as all this code could be run only once, otherwise
*/

For others problems in this thread, i don't know ;)
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 »

Dbug wrote: So yes, I have first hand confirmation that some of the AY compatible chips do have linear volume output.
Didn't know that. Yet the one in the oric clearly doesn't have linear volume output, so it doesn't help with my problem...
(But it explains why i've found some musics that sound much better with linear volumes !)
Godzil
Squad Leader
Posts: 774
Joined: Sat May 21, 2011 7:21 pm
Location: Between UK and France
Contact:

Re: Oric's 8912 volume scale

Post by Godzil »

DBug: it's possible that the version you used wass't one of the full drop-in replacement, but the original yamaha version had some slight changes, I know that Yamaha made some version with small changes, but the ref was different from the normal drop-in one.

General Instrument is the original manufacturer of this sound chip, Yamaha is a second source, but the die is normally the same not a "compatible" one. There should be some slight changes in the programming model.

Another potential explanation, there were multiple hardware revision like bug correction, and maybe the GI was an older chip with some hardware bugs? IDK, but if it was a dropin replacement, they should behave the same.

Edit: ok the Atari ST version is not replacable with a normal GI:

[cite]It was also produced under license by Yamaha (with minor modifications, i.e. a selectable clock divider pin, and a double-resolution but double-rate volume envelope table) as the YM2149F; the Atari ST uses this version. [/cite]

That could explain the differences you had.


By the way, because I missed that point, having three 1.5V battery in parallel is not going to give you 4.5V but 1.5V, it's the same here, mixing all the output together is not going you a maximum of 3V when all of the channel are at the highest voltage value, but at the highest that all of the three channel can output so about 1V:
Capture d’écran 2016-07-19 à 16.27.09.png
Capture d’écran 2016-07-19 à 16.27.16.png
Forget the three 0.1Ω resistors, they are there only to make the software happy.

The peak to peak voltage is about 1V (not exactly because of the 3 resistors) and not 3V
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 »

Godzil wrote: mixing all the output together is not going you a maximum of 3V when all of the channel are at the highest voltage value, but at the highest that all of the three channel can output so about 1V
Then if one channel's output is 1V, the final output is 1V regardless of the two other channels ? :?
Godzil
Squad Leader
Posts: 774
Joined: Sat May 21, 2011 7:21 pm
Location: Between UK and France
Contact:

Re: Oric's 8912 volume scale

Post by Godzil »

meynaf wrote:
Godzil wrote: mixing all the output together is not going you a maximum of 3V when all of the channel are at the highest voltage value, but at the highest that all of the three channel can output so about 1V
Then if one channel's output is 1V, the final output is 1V regardless of the two other channels ? :?
It will be lower, in fact:
1 at 1V and two at 0V will give something at about ⅓V so 0.33333...V

The formula is (V1 + V2 + V3) / Number_Of_Source so here:

(1+0+0)/3 = 0.33333V

Of course this is when all generators are perfect, which of course does not exist in real world.

If you want to have 3 volts, you have to put them in series and not in parallel, and then you will do 1+1+1 = 3V of 1+0+0 = 1V etc...
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 »

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

Anyway, how much can the oric's loudspeaker accept before it saturates and starts clipping ?
Godzil
Squad Leader
Posts: 774
Joined: Sat May 21, 2011 7:21 pm
Location: Between UK and France
Contact:

Re: Oric's 8912 volume scale

Post by Godzil »

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

Anyway, how much can the oric's loudspeaker accept before it saturates and starts clipping ?
No it's not the same, channel A is outputing a 440Hz square wave for exemple, and B & C are forced at 1V, you will have a 1V (full scale) square wave. If B and C are forced at 0V (which is more likely IRL) it will oscillate between 0 and 0.3333V

It's the same things as connecting AA battery in parallel, the voltage is not adding, you are not going to have 4.5V by doind that, but only 1.5V (or less if they don't have the same voltage)

For the LM386, to know at which level it is going to saturate, just look at the schematics and calculate the amplifier gain (too late for me here to do that)
Post Reply