Author Topic: AY-Output - Linear or logarithmic?  (Read 5015 times)

0 Members and 1 Guest are viewing this topic.

Offline Devilmarkus

  • Vivid source of indefiniteness
  • 6128 Plus
  • ******
  • Posts: 4.035
  • Country: de
  • WebCPC / JavaCPC developer
    • index.php?action=treasury
    • CPC-Live website
  • Liked: 1014
  • Likes Given: 926
AY-Output - Linear or logarithmic?
« on: 23: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
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

Offline Gryzor

  • Administrator
  • 6128 Plus
  • *****
  • Posts: 15.568
  • Country: gr
  • CPC-Wiki maintainer
    • CPCWiki
  • Liked: 3136
  • Likes Given: 5784
Re: AY-Output - Linear or logarithmic?
« Reply #1 on: 00:59, 02 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...?

Offline Devilmarkus

  • Vivid source of indefiniteness
  • 6128 Plus
  • ******
  • Posts: 4.035
  • Country: de
  • WebCPC / JavaCPC developer
    • index.php?action=treasury
    • CPC-Live website
  • Liked: 1014
  • Likes Given: 926
Re: AY-Output - Linear or logarithmic?
« Reply #2 on: 14: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".



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

Offline dlfrsilver

  • CPC6128
  • ****
  • Posts: 249
  • Liked: 73
  • Likes Given: 6
Re: AY-Output - Linear or logarithmic?
« Reply #3 on: 02:07, 03 July 09 »
logarythmic is way better. linear one sounds really crap.

Offline Devilmarkus

  • Vivid source of indefiniteness
  • 6128 Plus
  • ******
  • Posts: 4.035
  • Country: de
  • WebCPC / JavaCPC developer
    • index.php?action=treasury
    • CPC-Live website
  • Liked: 1014
  • Likes Given: 926
Re: AY-Output - Linear or logarithmic?
« Reply #4 on: 02:31, 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

Offline voXfReaX

  • CPC664
  • ***
  • Posts: 100
  • Country: gr
    • Benediction
  • Liked: 31
  • Likes Given: 30
Re: AY-Output - Linear or logarithmic?
« Reply #5 on: 13:48, 03 July 09 »
Logarithmic is better by far!

Linear? BOOOOOOOOOOOOOOOOOOOOOHHH!!!!

we speak,
voxfreax

Offline Carnivius

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.462
  • Country: gb
  • Mayhem Attack Squad
    • index.php?action=treasury
  • Liked: 1042
  • Likes Given: 586
Re: AY-Output - Linear or logarithmic?
« Reply #6 on: 14: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.
Favorite CPC games: SwitchBlade, Stryker in the Crypts of Trogan, Turrican II, UN Squadron, Oh Mummy

Offline Devilmarkus

  • Vivid source of indefiniteness
  • 6128 Plus
  • ******
  • Posts: 4.035
  • Country: de
  • WebCPC / JavaCPC developer
    • index.php?action=treasury
    • CPC-Live website
  • Liked: 1014
  • Likes Given: 926
Re: AY-Output - Linear or logarithmic?
« Reply #7 on: 15:58, 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

Offline Gryzor

  • Administrator
  • 6128 Plus
  • *****
  • Posts: 15.568
  • Country: gr
  • CPC-Wiki maintainer
    • CPCWiki
  • Liked: 3136
  • Likes Given: 5784
Re: AY-Output - Linear or logarithmic?
« Reply #8 on: 16: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?

Offline Octoate

  • CPC6128
  • ****
  • Posts: 290
  • Country: de
    • Octoate.de
  • Liked: 62
  • Likes Given: 326
Re: AY-Output - Linear or logarithmic?
« Reply #9 on: 13: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
In my opinion the logarithmic emulations sounds better than the linear one.
--

Offline Gryzor

  • Administrator
  • 6128 Plus
  • *****
  • Posts: 15.568
  • Country: gr
  • CPC-Wiki maintainer
    • CPCWiki
  • Liked: 3136
  • Likes Given: 5784
Re: AY-Output - Linear or logarithmic?
« Reply #10 on: 14: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.

Offline Devilmarkus

  • Vivid source of indefiniteness
  • 6128 Plus
  • ******
  • Posts: 4.035
  • Country: de
  • WebCPC / JavaCPC developer
    • index.php?action=treasury
    • CPC-Live website
  • Liked: 1014
  • Likes Given: 926
Re: AY-Output - Linear or logarithmic?
« Reply #11 on: 17:53, 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?


Code: [Select]
    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:



Code: [Select]
    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

Offline Gryzor

  • Administrator
  • 6128 Plus
  • *****
  • Posts: 15.568
  • Country: gr
  • CPC-Wiki maintainer
    • CPCWiki
  • Liked: 3136
  • Likes Given: 5784
Re: AY-Output - Linear or logarithmic?
« Reply #12 on: 17: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

Offline Devilmarkus

  • Vivid source of indefiniteness
  • 6128 Plus
  • ******
  • Posts: 4.035
  • Country: de
  • WebCPC / JavaCPC developer
    • index.php?action=treasury
    • CPC-Live website
  • Liked: 1014
  • Likes Given: 926
Re: AY-Output - Linear or logarithmic?
« Reply #13 on: 18:03, 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

Offline Gryzor

  • Administrator
  • 6128 Plus
  • *****
  • Posts: 15.568
  • Country: gr
  • CPC-Wiki maintainer
    • CPCWiki
  • Liked: 3136
  • Likes Given: 5784
Re: AY-Output - Linear or logarithmic?
« Reply #14 on: 11:16, 05 July 09 »
Yes, but will you have sound recording capabilities?

Offline Devilmarkus

  • Vivid source of indefiniteness
  • 6128 Plus
  • ******
  • Posts: 4.035
  • Country: de
  • WebCPC / JavaCPC developer
    • index.php?action=treasury
    • CPC-Live website
  • Liked: 1014
  • Likes Given: 926
Re: AY-Output - Linear or logarithmic?
« Reply #15 on: 11:36, 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

Offline Gryzor

  • Administrator
  • 6128 Plus
  • *****
  • Posts: 15.568
  • Country: gr
  • CPC-Wiki maintainer
    • CPCWiki
  • Liked: 3136
  • Likes Given: 5784
Re: AY-Output - Linear or logarithmic?
« Reply #16 on: 12: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?

Offline Devilmarkus

  • Vivid source of indefiniteness
  • 6128 Plus
  • ******
  • Posts: 4.035
  • Country: de
  • WebCPC / JavaCPC developer
    • index.php?action=treasury
    • CPC-Live website
  • Liked: 1014
  • Likes Given: 926
Re: AY-Output - Linear or logarithmic?
« Reply #17 on: 13:24, 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

Offline Devilmarkus

  • Vivid source of indefiniteness
  • 6128 Plus
  • ******
  • Posts: 4.035
  • Country: de
  • WebCPC / JavaCPC developer
    • index.php?action=treasury
    • CPC-Live website
  • Liked: 1014
  • Likes Given: 926
Re: AY-Output - Linear or logarithmic?
« Reply #18 on: 15: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...
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

Offline Devilmarkus

  • Vivid source of indefiniteness
  • 6128 Plus
  • ******
  • Posts: 4.035
  • Country: de
  • WebCPC / JavaCPC developer
    • index.php?action=treasury
    • CPC-Live website
  • Liked: 1014
  • Likes Given: 926
Re: AY-Output - Linear or logarithmic?
« Reply #19 on: 17: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
(Sorry for poor audio quality, it's a bad capture video)

Wait for next release!
« Last Edit: 17:30, 07 July 09 by CPC-Live »
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

Offline Gryzor

  • Administrator
  • 6128 Plus
  • *****
  • Posts: 15.568
  • Country: gr
  • CPC-Wiki maintainer
    • CPCWiki
  • Liked: 3136
  • Likes Given: 5784
Re: AY-Output - Linear or logarithmic?
« Reply #20 on: 11: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... :(

Offline Devilmarkus

  • Vivid source of indefiniteness
  • 6128 Plus
  • ******
  • Posts: 4.035
  • Country: de
  • WebCPC / JavaCPC developer
    • index.php?action=treasury
    • CPC-Live website
  • Liked: 1014
  • Likes Given: 926
Re: AY-Output - Linear or logarithmic?
« Reply #21 on: 13:26, 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

Offline Devilmarkus

  • Vivid source of indefiniteness
  • 6128 Plus
  • ******
  • Posts: 4.035
  • Country: de
  • WebCPC / JavaCPC developer
    • index.php?action=treasury
    • CPC-Live website
  • Liked: 1014
  • Likes Given: 926
Re: AY-Output - Linear or logarithmic?
« Reply #22 on: 18:22, 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

Offline Gryzor

  • Administrator
  • 6128 Plus
  • *****
  • Posts: 15.568
  • Country: gr
  • CPC-Wiki maintainer
    • CPCWiki
  • Liked: 3136
  • Likes Given: 5784
Re: AY-Output - Linear or logarithmic?
« Reply #23 on: 10:17, 09 July 09 »
Ahhh Antiriad... lovely music...

Anyhow, great job as always :D

Offline Devilmarkus

  • Vivid source of indefiniteness
  • 6128 Plus
  • ******
  • Posts: 4.035
  • Country: de
  • WebCPC / JavaCPC developer
    • index.php?action=treasury
    • CPC-Live website
  • Liked: 1014
  • Likes Given: 926
Re: AY-Output - Linear or logarithmic?
« Reply #24 on: 16:39, 09 July 09 »
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!
« Last Edit: 16:45, 09 July 09 by CPC-Live »
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