Author Topic: Which emulator has the most accurate sound playback?  (Read 12975 times)

0 Members and 1 Guest are viewing this topic.

Offline mr_lou

  • 6128 Plus
  • ******
  • Posts: 2.892
  • Country: dk
    • index.php?action=treasury
    • 8-bit Memoirs - a Blu-ray diskmag-like eBook about the 8-bit era
  • Liked: 1052
  • Likes Given: 2264
When listening to my tracks in various emulators, I find that none of them plays back my tracks correctly.
Arnold plays one channel much too loud.
WinAPE seems to put too much volume on all channels, as if the volume is linear.
JavaCPC seems to cut off too much volume, leaving some instruments mute

Sorry if this has been discussed before. Was too lazy to do a search. But I'm also hoping new versions of various emulators have become better.

Offline arnoldemu

  • Supporter
  • 6128 Plus
  • *
  • Posts: 5.332
  • Country: gb
    • Unofficial Amstrad WWW Resource
  • Liked: 2246
  • Likes Given: 3477
Re: Which emulator has the most accurate sound playback?
« Reply #1 on: 19:15, 14 June 11 »
When listening to my tracks in various emulators, I find that none of them plays back my tracks correctly.
Arnold plays one channel much too loud.
WinAPE seems to put too much volume on all channels, as if the volume is linear.
JavaCPC seems to cut off too much volume, leaving some instruments mute

Sorry if this has been discussed before. Was too lazy to do a search. But I'm also hoping new versions of various emulators have become better.

Are you talking about the sound from the internal speaker, or sound from the stereo connector? There is a difference between the two.

I think most emus emulate the stereo connector sound.
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Offline mr_lou

  • 6128 Plus
  • ******
  • Posts: 2.892
  • Country: dk
    • index.php?action=treasury
    • 8-bit Memoirs - a Blu-ray diskmag-like eBook about the 8-bit era
  • Liked: 1052
  • Likes Given: 2264
Re: Which emulator has the most accurate sound playback?
« Reply #2 on: 19:27, 14 June 11 »
Are you talking about the sound from the internal speaker, or sound from the stereo connector? There is a difference between the two.

I think most emus emulate the stereo connector sound.

Yes, it's the stereo output.

Offline PhilZeVibe

  • 464 Plus
  • *****
  • Posts: 467
  • Country: fr
    • CPCBox - CPC emulator in JavaScript
  • Liked: 162
  • Likes Given: 185
Re: Which emulator has the most accurate sound playback?
« Reply #3 on: 21:11, 14 June 11 »
Something is coming very soon... ;)
Atwood's law (2007): "Any application that can be written in JavaScript, will eventually be written in JavaScript."

Offline mr_lou

  • 6128 Plus
  • ******
  • Posts: 2.892
  • Country: dk
    • index.php?action=treasury
    • 8-bit Memoirs - a Blu-ray diskmag-like eBook about the 8-bit era
  • Liked: 1052
  • Likes Given: 2264
Re: Which emulator has the most accurate sound playback?
« Reply #4 on: 22:34, 14 June 11 »
Something is coming very soon... ;)

I like the sound of that. :)
Do I dare hope it'll run on Linux?  ::)

Offline PhilZeVibe

  • 464 Plus
  • *****
  • Posts: 467
  • Country: fr
    • CPCBox - CPC emulator in JavaScript
  • Liked: 162
  • Likes Given: 185
Re: Which emulator has the most accurate sound playback?
« Reply #5 on: 23:24, 14 June 11 »
Do I dare hope it'll run on Linux?  ::)
Yeah, sure!
Release date: June 21 8)
Atwood's law (2007): "Any application that can be written in JavaScript, will eventually be written in JavaScript."

Offline Executioner

  • Supporter
  • 6128 Plus
  • *
  • Posts: 783
  • Country: au
  • WinAPE Developer
    • WinAPE
  • Liked: 391
  • Likes Given: 60
Re: Which emulator has the most accurate sound playback?
« Reply #6 on: 03:36, 15 June 11 »
WinAPE seems to put too much volume on all channels, as if the volume is linear.

WinAPE has always had logarithmic volumes (at least since 2.0A9).

The logarithmic volumes used by WinAPE are:

0,1,3,4,5,7,8,10,12,14,16,19,23,27,33,42

Assuming your sound cars has linear volumes of course. Perhaps this isn't logarithmic enough.

These are used so I can add three channels at maximum volume and still get a value less than 127.


Offline mr_lou

  • 6128 Plus
  • ******
  • Posts: 2.892
  • Country: dk
    • index.php?action=treasury
    • 8-bit Memoirs - a Blu-ray diskmag-like eBook about the 8-bit era
  • Liked: 1052
  • Likes Given: 2264
Re: Which emulator has the most accurate sound playback?
« Reply #7 on: 08:42, 15 June 11 »
WinAPE has always had logarithmic volumes (at least since 2.0A9).

The logarithmic volumes used by WinAPE are:

0,1,3,4,5,7,8,10,12,14,16,19,23,27,33,42

I don't suppose those values would be easy to find in the exe file with a hex-editor? I'd like to have a go at finding the values I think should be there.

(Or how about changing those values in JavaCPC Markus? I suppose I should look at the source then. Can you tell me which source file the volumes are encoded in?)

I compose my tracks using a CPC464. I don't suppose this should mean anything? I mean, can this create a different sound on a CPC6128? My CPC6128 is packed down at the moment, so I can't check. But as far as I can remember, my CPC464 and CPC6128 plays back STarKos tracks the same.

Offline McKlain

  • 6128 Plus
  • ******
  • Posts: 867
  • Country: es
  • Programmable Sound Generator
    • www.mcklain.com
  • Liked: 338
  • Likes Given: 950
Re: Which emulator has the most accurate sound playback?
« Reply #8 on: 10:12, 15 June 11 »
When listening to my tracks in various emulators, I find that none of them plays back my tracks correctly.
Arnold plays one channel much too loud.
WinAPE seems to put too much volume on all channels, as if the volume is linear.
JavaCPC seems to cut off too much volume, leaving some instruments mute

Sorry if this has been discussed before. Was too lazy to do a search. But I'm also hoping new versions of various emulators have become better.

Have you tried CPCE?

Offline Bryce

  • The Hardware Guy.
  • Supporter
  • 6128 Plus
  • *
  • Posts: 10.982
  • Country: wf
  • It's not broken, it just hasn't been fixed yet.
    • index.php?action=treasury
  • Liked: 3862
  • Likes Given: 401
Re: Which emulator has the most accurate sound playback?
« Reply #9 on: 11:13, 15 June 11 »
The sound on a real 464 should be identical to the sound on a real 6128 because they use exactly the same circuit and components.

Bryce.

Offline Devilmarkus

  • Vivid source of indefiniteness
  • 6128 Plus
  • ******
  • Posts: 4.035
  • Country: de
  • WebCPC / JavaCPC developer
    • index.php?action=treasury
    • CPC-Live website
  • Liked: 1011
  • Likes Given: 926
Re: Which emulator has the most accurate sound playback?
« Reply #10 on: 14:17, 15 June 11 »
I don't suppose those values would be easy to find in the exe file with a hex-editor? I'd like to have a go at finding the values I think should be there.

(Or how about changing those values in JavaCPC Markus? I suppose I should look at the source then. Can you tell me which source file the volumes are encoded in?)

Well JavaCPC already uses logarithmic sound.
Whereby JavaCPC has volume values between 0 and 15...
You can choose between 4 presets in the audio-settings.
I of course also compared JavaCPC (And a few other emulators, too) with the real CPC sound.
You can select 2 presets from AY_Emul, the CPCe95 preset and linear sound output.
The values of them you can see here:
Code: [Select]
    //
    // AY Amplitude values taken from CPCe95
    // and re-calculated for JavaCPC
    //
    // To calculate:
    // FOR n=0 TO 15: PRINT 15*(2^((1+n)/2))/256: NEXT n
    public static final double[] LOG_VOLUME = {
        0.08286408, 0.1171875, 0.1657282, 0.234375,
        0.3314563, 0.46875, 0.6629126, 0.9375,
        1.325825, 1.875, 2.65165, 3.75,
        5.303301, 7.5, 10.6066, 15
    };
    //
    // AY Amplitude values taken from Ay_Emul
    // and re-calculated for JavaCPC (divided with 4369)
    //
    // { (c)Hacker KAY }
    //  Amplitudes_AY:array[0..15]of Word=
    //   (0, 836, 1212, 1773, 2619, 3875, 5397, 8823, 10392, 16706, 23339,
    //   29292, 36969, 46421, 55195, 65535);
    public static final double[] LOG_VOLUME_A = {
        0, 0.117418174, 0.189517052, 0.283588922, 0.440146487,
        0.741130694, 1.12748913, 2.08514534, 2.36758984, 4.09155413,
        5.64934768, 6.96772717, 8.8908217, 10.8194095, 12.9095903, 15
    };
    //{ (c)V_Soft }
    // Amplitudes_AY:array[0..15]of Word=
    //   (0, 513, 828, 1239, 1923, 3238, 4926, 9110, 10344, 17876, 24682,
    //   30442, 38844, 47270, 56402, 65535);}
    public static final double[] LOG_VOLUME_B = {
        0, 0.191348135, 0.277409018, 0.405813687, 0.599450675,
        0.886930648, 1.23529412, 2.01945525, 2.37857633, 3.8237583,
        5.34195468, 6.70450904, 8.46166171, 10.6250858, 12.6333257, 15
    };
    public static final double[] LOG_VOLUME_L = {
        0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
    };

That sound is perhaps still a bit in-accurate does not depend on the logarithms but more on incomplete emulation.
(You still can hear fancy tones when you playback "Tire-Au-Flan" demo for example... It has a few disturbing sounds (Same than in WinApe.))

But JEMU already has some AY change. I'll try to implement them soon in JavaCPC, too...
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: 1011
  • Likes Given: 926
Re: Which emulator has the most accurate sound playback?
« Reply #11 on: 14:50, 15 June 11 »
Here's a small diagram for WinApe's, CPCe's and JavaCPC's volume tables:
Code: [Select]
10 INK 0,0:BORDER 0:INK 1,26:INK 2,2:INK 3,6:MODE 1:GOSUB 360:PLOT 0,0,1
20 LOCATE 1,1:PRINT"CPCe AY volume table"
30 FOR n=0 TO 15: a=15*(2^((1+n)/2))/256
40 a=a*25
50 DRAW d,a,1:FOR t=-4 TO 4 STEP 2:PLOT d+t,a-4,3:DRAW d+t,a+4:NEXT t:PLOT d,a,1:d=d+(640/16)
60 NEXT
70 CALL &BB18
80 PLOT 0,0,1
90 LOCATE 1,1:PRINT"JavaCPC AY volume table A (Hacker Kay)"
100 RESTORE 330:d=0
110 FOR n=0 TO 15: READ a
120 a=a*25
130 DRAW d,a,1:FOR t=-4 TO 4 STEP 2:PLOT d+t,a-4,3:DRAW d+t,a+4:NEXT t:PLOT d,a,1:d=d+(640/16)
140 NEXT
150 CALL &BB18
160 PLOT 0,0,1
170 LOCATE 1,1:PRINT"JavaCPC AY volume table B (V-Soft)     "
180 RESTORE 340:d=0
190 FOR n=0 TO 15: READ a
200 a=a*25
210 DRAW d,a,1:FOR t=-4 TO 4 STEP 2:PLOT d+t,a-4,3:DRAW d+t,a+4:NEXT t:PLOT d,a,1:d=d+(640/16)
220 NEXT
230 CALL &BB18
240 PLOT 0,0,1
250 LOCATE 1,1:PRINT"WinApe AY volume table            "
260 RESTORE 350:d=0
270 FOR n=0 TO 15: READ a:a=a/2.8
280 a=a*25
290 DRAW d,a,1:FOR t=-4 TO 4 STEP 2:PLOT d+t,a-4,3:DRAW d+t,a+4:NEXT t:PLOT d,a,1:d=d+(640/16)
300 NEXT
310 CALL &BB18
320 RUN
330 DATA 0, 0.117418174, 0.189517052, 0.283588922, 0.440146487,0.741130694, 1.12748913, 2.08514534, 2.36758984, 4.09155413,5.64934768, 6.96772717, 8.8908217, 10.8194095, 12.9095903, 15
340 DATA 0, 0.191348135, 0.277409018, 0.405813687, 0.599450675,0.886930648, 1.23529412, 2.01945525, 2.37857633, 3.8237583,5.34195468, 6.70450904, 8.46166171, 10.6250858, 12.6333257, 15
350 DATA 0,1,3,4,5,7,8,10,12,14,16,19,23,27,33,42
360 FOR t=0 TO 15:PLOT 0,t*25,2:DRAW 600,t*25:NEXT
370 d=0:FOR t=0 TO 15:PLOT d,0:DRAW d,374:d=d+(640/16):NEXT:d=0:RETURN

Edit: updated code!
« Last Edit: 15:10, 15 June 11 by Devilmarkus »
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 mr_lou

  • 6128 Plus
  • ******
  • Posts: 2.892
  • Country: dk
    • index.php?action=treasury
    • 8-bit Memoirs - a Blu-ray diskmag-like eBook about the 8-bit era
  • Liked: 1052
  • Likes Given: 2264
Re: Which emulator has the most accurate sound playback?
« Reply #12 on: 15:05, 15 June 11 »
You can choose between 4 presets in the audio-settings.
I of course also compared JavaCPC (And a few other emulators, too) with the real CPC sound.
You can select 2 presets from AY_Emul, the CPCe95 preset and linear sound output.

I actually missed those, but just tried them out now. I'm sorry to say that none of them gives the correct playback.
Any way I can change each of the 15 values individually, in order to make a custom volume table?

Have you tried CPCE?

No, but if it uses the same table as the CPCe95 option in JavaCPC, then it's no good either.

Offline arnoldemu

  • Supporter
  • 6128 Plus
  • *
  • Posts: 5.332
  • Country: gb
    • Unofficial Amstrad WWW Resource
  • Liked: 2246
  • Likes Given: 3477
Re: Which emulator has the most accurate sound playback?
« Reply #13 on: 15:05, 15 June 11 »
My answer to you is that none of the emus give an accurate result ;)
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Offline Bryce

  • The Hardware Guy.
  • Supporter
  • 6128 Plus
  • *
  • Posts: 10.982
  • Country: wf
  • It's not broken, it just hasn't been fixed yet.
    • index.php?action=treasury
  • Liked: 3862
  • Likes Given: 401
Re: Which emulator has the most accurate sound playback?
« Reply #14 on: 15:09, 15 June 11 »
You can't beat real hardware with that "software-stuff" you all seem to be so fond of :D

Bryce.

Offline Devilmarkus

  • Vivid source of indefiniteness
  • 6128 Plus
  • ******
  • Posts: 4.035
  • Country: de
  • WebCPC / JavaCPC developer
    • index.php?action=treasury
    • CPC-Live website
  • Liked: 1011
  • Likes Given: 926
Re: Which emulator has the most accurate sound playback?
« Reply #15 on: 15:13, 15 June 11 »
I actually missed those, but just tried them out now. I'm sorry to say that none of them gives the correct playback.
Any way I can change each of the 15 values individually, in order to make a custom volume table?

To say that exactly you would need to connect your CPC to a clear, non-logarithmic hifi-system!
A CPC will sound different on several HIFI-systems.

Sure you can change the volume-tables in JEMU.core.device.sound.AY_3_8910.java... But I don't think this makes sense until you really check your CPC direct output... (Perhaps by measuring the voltages on the 3,5mm jack?)
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 arnoldemu

  • Supporter
  • 6128 Plus
  • *
  • Posts: 5.332
  • Country: gb
    • Unofficial Amstrad WWW Resource
  • Liked: 2246
  • Likes Given: 3477
Re: Which emulator has the most accurate sound playback?
« Reply #16 on: 15:16, 15 June 11 »
You can't beat real hardware with that "software-stuff" you all seem to be so fond of :D

Bryce.
True, it's not as good as the stylophone.
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Offline mr_lou

  • 6128 Plus
  • ******
  • Posts: 2.892
  • Country: dk
    • index.php?action=treasury
    • 8-bit Memoirs - a Blu-ray diskmag-like eBook about the 8-bit era
  • Liked: 1052
  • Likes Given: 2264
Re: Which emulator has the most accurate sound playback?
« Reply #17 on: 15:16, 15 June 11 »
My answer to you is that none of the emus give an accurate result ;)
You can't beat real hardware with that "software-stuff" you all seem to be so fond of :D

Of course not, but this is a question about a simple volume table that seems to be wrong on all emulators. That's silly.
One thing is to accurately simulate the synth, especially when talking sawtooth, but to not play the synth at the correct volume is just silly, when it easy to adjust.

I have my PC and my CPC connected to the same mixer, so I can have the sound from both output at the same time. I should be able to find the correct volume table relatively easy.
Just gimme the tool to adjust the volume-table in some emulator.

Offline Devilmarkus

  • Vivid source of indefiniteness
  • 6128 Plus
  • ******
  • Posts: 4.035
  • Country: de
  • WebCPC / JavaCPC developer
    • index.php?action=treasury
    • CPC-Live website
  • Liked: 1011
  • Likes Given: 926
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 McKlain

  • 6128 Plus
  • ******
  • Posts: 867
  • Country: es
  • Programmable Sound Generator
    • www.mcklain.com
  • Liked: 338
  • Likes Given: 950
Re: Which emulator has the most accurate sound playback?
« Reply #19 on: 15:23, 15 June 11 »
No, but if it uses the same table as the CPCe95 option in JavaCPC, then it's no good either.

I have no idea of how it works internally, but to me is the one that sounds better. Just give it a try.  :)

http://cngsoft.no-ip.org/cpce/index.htm

Offline mr_lou

  • 6128 Plus
  • ******
  • Posts: 2.892
  • Country: dk
    • index.php?action=treasury
    • 8-bit Memoirs - a Blu-ray diskmag-like eBook about the 8-bit era
  • Liked: 1052
  • Likes Given: 2264
Re: Which emulator has the most accurate sound playback?
« Reply #20 on: 15:43, 15 June 11 »
I have no idea of how it works internally, but to me is the one that sounds better. Just give it a try.  :)

http://cngsoft.no-ip.org/cpce/index.htm

Groovy! CPCE does give the most accurate playback. The volume-table at least feels about 99%, which is very good.
The timing is a little bit off, but that doesn't matter much. Two CPC's would probably do that too.

So that settles it. CPCE gives the most accurate playback regarding volume-tables, in my opinion. Thanks mcklain.  :)

Offline McKlain

  • 6128 Plus
  • ******
  • Posts: 867
  • Country: es
  • Programmable Sound Generator
    • www.mcklain.com
  • Liked: 338
  • Likes Given: 950
Re: Which emulator has the most accurate sound playback?
« Reply #21 on: 15:45, 15 June 11 »
You are welcome  ;D

I know that Cesar put a lot of effort in the sound emulation.

Offline Devilmarkus

  • Vivid source of indefiniteness
  • 6128 Plus
  • ******
  • Posts: 4.035
  • Country: de
  • WebCPC / JavaCPC developer
    • index.php?action=treasury
    • CPC-Live website
  • Liked: 1011
  • Likes Given: 926
Re: Which emulator has the most accurate sound playback?
« Reply #22 on: 15:49, 15 June 11 »
Here are the 4 diagrams I calculated:
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 mr_lou

  • 6128 Plus
  • ******
  • Posts: 2.892
  • Country: dk
    • index.php?action=treasury
    • 8-bit Memoirs - a Blu-ray diskmag-like eBook about the 8-bit era
  • Liked: 1052
  • Likes Given: 2264
Re: Which emulator has the most accurate sound playback?
« Reply #23 on: 15:49, 15 June 11 »
You are welcome  ;D

I know that Cesar put a lot of effort in the sound emulation.

Well tell him he's done a great job. :)

Also, ask him if he'd be willing to shared his volume-table here, so other coders can use it.

Markus: What table is used in JavaCPC when selecting CPCe95? Clearly it's not the one actually used in CPCE.

Offline Devilmarkus

  • Vivid source of indefiniteness
  • 6128 Plus
  • ******
  • Posts: 4.035
  • Country: de
  • WebCPC / JavaCPC developer
    • index.php?action=treasury
    • CPC-Live website
  • Liked: 1011
  • Likes Given: 926
Re: Which emulator has the most accurate sound playback?
« Reply #24 on: 15:56, 15 June 11 »
Markus: What table is used in JavaCPC when selecting CPCe95? Clearly it's not the one actually used in CPCE.

This is:
Code: [Select]
    //
    // AY Amplitude values taken from CPCe95
    // and re-calculated for JavaCPC
    //
    // To calculate:
    // FOR n=0 TO 15: PRINT 15*(2^((1+n)/2))/256: NEXT n
    public static final double[] LOG_VOLUME = {
        0.08286408, 0.1171875, 0.1657282, 0.234375,
        0.3314563, 0.46875, 0.6629126, 0.9375,
        1.325825, 1.875, 2.65165, 3.75,
        5.303301, 7.5, 10.6066, 15
    };

C├ęsar himself gave me the method how he calculated the volumes.

I'll check the output routines, too, perhaps there is a little bug in...
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