CPCWiki forum

General Category => Emulators => Topic started by: Devilmarkus on 21:46, 01 July 09

Title: AY-Output - Linear or logarithmic?
Post by: Devilmarkus on 21:46, 01 July 09
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
Title: Re: AY-Output - Linear or logarithmic?
Post by: Gryzor on 22:59, 01 July 09
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...?
Title: Re: AY-Output - Linear or logarithmic?
Post by: Devilmarkus on 12:25, 02 July 09
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".

(http://cpc-live.com/advanced_options.png)

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
Title: Re: AY-Output - Linear or logarithmic?
Post by: dlfrsilver on 00:07, 03 July 09
logarythmic is way better. linear one sounds really crap.
Title: Re: AY-Output - Linear or logarithmic?
Post by: Devilmarkus on 00:31, 03 July 09
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...
Title: Re: AY-Output - Linear or logarithmic?
Post by: voXfReaX on 11:48, 03 July 09
Logarithmic is better by far!

Linear? BOOOOOOOOOOOOOOOOOOOOOHHH!!!!

we speak,
voxfreax
Title: Re: AY-Output - Linear or logarithmic?
Post by: Carnivius 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.
Title: Re: AY-Output - Linear or logarithmic?
Post by: Devilmarkus on 13:58, 03 July 09
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  ;)
Title: Re: AY-Output - Linear or logarithmic?
Post by: Gryzor on 14:01, 03 July 09
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?
Title: Re: AY-Output - Linear or logarithmic?
Post by: Octoate on 11:52, 04 July 09
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 (http://users.rcn.com/carlott/ay3-8910.pdf)
In my opinion the logarithmic emulations sounds better than the linear one.
Title: Re: AY-Output - Linear or logarithmic?
Post by: Gryzor on 12:48, 04 July 09
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.
Title: Re: AY-Output - Linear or logarithmic?
Post by: Devilmarkus on 15:53, 04 July 09
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?

(http://file:///E:/DOKUME%7E1/Markus/LOKALE%7E1/Temp/moz-screenshot.png)(http://file:///E:/DOKUME%7E1/Markus/LOKALE%7E1/Temp/moz-screenshot-1.png)
    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:

(http://cpc-live.com/negative.png)

    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:

(http://cpc-live.com/positive.png)

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

(http://cpc-live.com/goal.png)

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

Cheers,
Markus
Title: Re: AY-Output - Linear or logarithmic?
Post by: 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
Title: Re: AY-Output - Linear or logarithmic?
Post by: Devilmarkus on 16:03, 04 July 09
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
Title: Re: AY-Output - Linear or logarithmic?
Post by: Gryzor on 09:16, 05 July 09
Yes, but will you have sound recording capabilities?
Title: Re: AY-Output - Linear or logarithmic?
Post by: Devilmarkus on 09:36, 05 July 09
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 ;-)
Title: Re: AY-Output - Linear or logarithmic?
Post by: Gryzor on 10:59, 05 July 09
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?
Title: Re: AY-Output - Linear or logarithmic?
Post by: Devilmarkus on 11:24, 05 July 09
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...
Title: Re: AY-Output - Linear or logarithmic?
Post by: Devilmarkus on 13:17, 05 July 09
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...
Title: Re: AY-Output - Linear or logarithmic?
Post by: Devilmarkus on 15:02, 07 July 09
I finished coding the audio-recorder for JavaCPC.
Here's a small video which demonstrates it's useage:
http://cpc-live.com/videos/audiocapture (http://cpc-live.com/videos/audiocapture)
(Sorry for poor audio quality, it's a bad capture video)

Wait for next release!
Title: Re: AY-Output - Linear or logarithmic?
Post by: Gryzor on 09:04, 08 July 09
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... :(
Title: Re: AY-Output - Linear or logarithmic?
Post by: Devilmarkus on 11:26, 08 July 09
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.
Title: Re: AY-Output - Linear or logarithmic?
Post by: Devilmarkus on 16:22, 08 July 09
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
Title: Re: AY-Output - Linear or logarithmic?
Post by: Gryzor on 08:17, 09 July 09
Ahhh Antiriad... lovely music...

Anyhow, great job as always :D
Title: Re: AY-Output - Linear or logarithmic?
Post by: Devilmarkus on 14:39, 09 July 09
Here is a stunning live-demonstration for the new AY output in JavaCPC:
CLICK ME (http://cpc-live.com/javacpc.php?system=CPC6128&disc=dtc.zip&boot=-dtc&title=DTC%20by%20Arkos&mousejoy=false&joystick=false&doubled=true&menu=false&vhold=true&options=true)

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!
Powered by SMFPacks Menu Editor Mod