avatar_mr_lou

Which emulator has the most accurate sound playback?

Started by mr_lou, 16:51, 14 June 11

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

mr_lou

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.

arnoldemu

Quote from: mr_lou on 16:51, 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

mr_lou

Quote from: arnoldemu on 17:15, 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.

Phi2x

#3
.

mr_lou

Quote from: phi2x on 19:11, 14 June 11
Something is coming very soon... ;)

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

Phi2x

#5
.

Executioner

Quote from: mr_lou on 16:51, 14 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.


mr_lou

Quote from: Executioner on 01:36, 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.

McKlain

Quote from: mr_lou on 16:51, 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.

Have you tried CPCE?

Bryce

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.

Devilmarkus

Quote from: mr_lou on 06:42, 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:
    //
    // 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

Devilmarkus

#11
Here's a small diagram for WinApe's, CPCe's and JavaCPC's volume tables:
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!
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

mr_lou

Quote from: Devilmarkus on 12:17, 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?

Quote from: mcklain on 08:12, 15 June 11
Have you tried CPCE?

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

arnoldemu

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

Bryce

You can't beat real hardware with that "software-stuff" you all seem to be so fond of :D

Bryce.

Devilmarkus

Quote from: mr_lou on 13:05, 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

arnoldemu

Quote from: Bryce on 13:09, 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

mr_lou

Quote from: arnoldemu on 13:05, 15 June 11
My answer to you is that none of the emus give an accurate result ;)
Quote from: Bryce on 13:09, 15 June 11
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.

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

McKlain

Quote from: mr_lou on 13:05, 15 June 11No, 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

mr_lou

Quote from: mcklain on 13:23, 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.  :)

McKlain

You are welcome  ;D

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

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

mr_lou

Quote from: mcklain on 13:45, 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.

Devilmarkus

Quote from: mr_lou on 13:49, 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:

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

Powered by SMFPacks Menu Editor Mod