News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_Devilmarkus

AY-Output - Linear or logarithmic?

Started by Devilmarkus, 21:46, 01 July 09

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Devilmarkus

Hi together,

as I talked with César (CNGSoft), he told me, that the AY soundchip output is a logarithmic output.

So I modified the AY-emulation in JavaCPC.

Now I need your opinion:

Wich of these 2 mp3 files sound "more realistic"?

http://cpc-live.com/Track1.mp3

http://cpc-live.com/Track2.mp3

One of them uses logarithmic AY sound.

So please tell me, which of the 2 files is the best emulated.
(Track1 or Track2)
(Recorded from Tire-Au-Flan demo / Overlanders)

Cheers,
Markus
When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

Gryzor

To begin with, they both sound to me more like ST tunes rather than CPC tunes for some reason. I think they're sharper than the CPC, and with more depth in the bass...

That said, the second example seems to have more reverb - maybe it's the logarithmic stuff working? I think Track1 sounds better for the CPC...?

Devilmarkus

Another example for logarithmic / linear output:


http://cpc-live.com/barbarian_logarithmic.mp3

http://cpc-live.com/barbarian_linear.mp3

In first posting, Track1.mp3 is the logarithmic output.

You will be able in next JavaCPC version to change between logarithmic (default) and linear output "on-the-fly".



The other point "Method B" does this:
We know, CPC has sound channels A,B and C.
Method B sends 100% A + 50% B to left stereo channel and 50% B + 100% C to right channel.
Without this, 100% A + 100% B are sent to left channel and 100% B + 100% C are sent to right channel.

Please leave your comments about the logarithmic output.

Cheers,
Markus
When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

dlfrsilver

logarythmic is way better. linear one sounds really crap.

Devilmarkus

Quote from: dlfrsilver on 00:07, 03 July 09
logarythmic is way better. linear one sounds really crap.

Thank you!  :)

In fact, many emulators use linear output...
When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

voXfReaX

Logarithmic is better by far!

Linear? BOOOOOOOOOOOOOOOOOOOOOHHH!!!!

we speak,
voxfreax

Carnivius

Actually I think the linear one sounds much better.  The percussion was far too muted in the logarithmic one and annoyed me.  The track sounded 'emptier' because of it.
Favorite CPC games: Count Duckula 3, Oh Mummy Returns, RoboCop Resurrection, Tankbusters Afterlife

Devilmarkus

Quote from: Carnivac on 12:16, 03 July 09
Actually I think the linear one sounds much better.  The percussion was far too muted in the logarithmic one and annoyed me.  The track sounded 'emptier' because of it.

Better try it on emulator. MP3 recordings are not the best quality  ;)
When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

Gryzor

I fired up my CPC yesterday and I think that logarithmic (the first version you sent me, I don't know which one is online now!) sounds better.

That said, I don't get what logarithmic vs linear has to do with how channel volumes are split between left and right...

@Carnivac: I think I know what you meand and I agree to some extend, but it's not as faithful...

Btw: is there an emulator that saves wav/mp3 files?

Octoate

The AY-3-8910 uses logarithmic sound volumes. You can see that in the official datasheet on page 29: http://users.rcn.com/carlott/ay3-8910.pdf
In my opinion the logarithmic emulations sounds better than the linear one.
--

Gryzor

Well, yes, I understand that, but how does this affect how the channels are split between L/R? That's what I'm asking.

Again: anyone knows of an emu that is able to save sound output?

[EDIT] Duh... Winape of course.

Devilmarkus

Quote from: Gryzor on 12:48, 04 July 09
Again: anyone knows of an emu that is able to save sound output?

I am already working on it... But I have some problems generating the amplitudes.
Perhaps someone can help me with this?


    public void doCapture(byte a, byte b){
        CPC.tapesample[CPC.recordcount] = a;
        CPC.recordcount++;
        CPC.tapesample[CPC.recordcount] = b;
        CPC.recordcount++;
    }


This produces negative, inverted amplitudes:



    public void doCapture(byte a, byte b){
         CPC.tapesample[CPC.recordcount] = (byte)(a^0x80);
         CPC.recordcount++;
         CPC.tapesample[CPC.recordcount] = (byte)(b^0x80);
         CPC.recordcount++;
     }


This produces positive only amplitudes:



I need a calculation which changes the incoming bytes for WAV format so my goal is to get this:



Would be great, if somebody knows how to calculate this.

Cheers,
Markus
When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

Gryzor

I was just toying with WinApe as you posted this, and was thinking it'd be great if you did it since you've got the logarithmic gimmick going :D

Devilmarkus

Quote from: Gryzor on 15:55, 04 July 09
I was just toying with WinApe as you posted this, and was thinking it'd be great if you did it since you've got the logarithmic gimmick going :D

The logarithmic sound output is already implemented in coming JavaCPC version.
Use CPCE95 (It also uses logarithmic sound output, I adapted it from this emu)

BTW.: This is not a question about the channels (left, right) but about each of the 15 volume states.

You can calculate it easily in BASIC:
FOR n=0 TO 15: PRINT 15*(2^((1+n)/2))/256: NEXT n
When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

Gryzor

Yes, but will you have sound recording capabilities?

Devilmarkus

Quote from: Gryzor on 09:16, 05 July 09
Yes, but will you have sound recording capabilities?

JavaCPC version 6.5 will have this Feature.
My method is correct:
public void doCapture(byte a, byte b){
        CPC.tapesample[CPC.recordcount] = (byte)(a^0x80);
        CPC.recordcount++;
        CPC.tapesample[CPC.recordcount] = (byte)(b^0x80);
        CPC.recordcount++;
    }

Is correct.
I am grabbing the AY signal directly, and the AY chip can only produce positive signals.
So the sound is played well, but looks a bit strange in audio-editors ;-)
When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

Gryzor

Yay! I'm trying to grab some stuff to make ringtones out of. Would you happen to have a good TAF recording with the logarithmic mode?

Devilmarkus

Quote from: Gryzor on 10:59, 05 July 09
Would you happen to have a good TAF recording with the logarithmic mode?

Try the 2 files I sent you... Direct AY recording...
When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

Devilmarkus

I made a test between 3 emulators (WinApe, WinCPC, JavaCPC) and my real CPC 6128.
In fact, in JavaCPC are some things missing  :(

But, test it yourself:
http://cpc-live.com/taf_real_cpc.rar
http://cpc-live.com/taf_1.rar
http://cpc-live.com/taf_2.rar
http://cpc-live.com/taf_3.rar

please compare all tunes (all are recorded with 44khz, 8 bit stereo)
I will tell you later, which file comes from which emulator... And I will also tell you my favourite emulator sound later...
When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

Devilmarkus

#19
I finished coding the audio-recorder for JavaCPC.
Here's a small video which demonstrates it's useage:
http://cpc-live.com/videos/audiocapture
(Sorry for poor audio quality, it's a bad capture video)

Wait for next release!
When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

Gryzor

Oh the squareness! :D

Well done, mate. Oh, a feature request: could it be done so that the program starts recording automatically when there's AY output?

Great stuff :)

Gry

PS Saw your messages, but I'm out all day... :(

Devilmarkus

Quote from: Gryzor on 09:04, 08 July 09
Oh, a feature request: could it be done so that the program starts recording automatically when there's AY output?

Yes, I think that will be possible. Good idea.
The YM-Recorder does the same.
When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

Devilmarkus

Quote from: Gryzor on 09:04, 08 July 09
Oh, a feature request: could it be done so that the program starts recording automatically when there's AY output?

I changed the recorder:
http://cpc-live.com/videos/audiocapture

I think this will be helpful.  ;D
When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

Gryzor

Ahhh Antiriad... lovely music...

Anyhow, great job as always :D

Devilmarkus

#24
Here is a stunning live-demonstration for the new AY output in JavaCPC:
CLICK ME

Please check if AY-Volume knob is turned to maximum (because reading old javacpc.ini, it maybe is turned off)

Turn your speakers to loudest possible and enjoy!
When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

Powered by SMFPacks Menu Editor Mod