Jump to content
IGNORED

Web Pokey


mrk

Recommended Posts

Recently I was working a bit on POKEY emulator working in a browser (this is a part of bigger project - atari emulator in a browser, I'll create separate topic about that soon) and I want to share results with you: https://github.com/mrk-its/web-pokey
 

Please take a look on live examples https://github.com/mrk-its/web-pokey#live-examples and let me know what do you think about that. For example this https://mrk.sed.pl/web-pokey/examples/pokey-regs/ demo allows you to provide values of POKEY registers, please let me know if you find significant differences between real atari / Altirra and generated sound (you can copy & paste link with register values here). Other example is SAP type R player: https://mrk.sed.pl/web-pokey/examples/sap-player/#https://atarionline.pl/forum/?PostBackAction=Download&AttachmentID=16744

Let me know what do you think about, thanks!

Edited by mrk
  • Like 8
  • Thanks 3
Link to comment
Share on other sites

Link to comment
Share on other sites

Great job thanks for sharing it, some time ago i wanted to make a music player for my wiki. i did it, but i didn't like very much the mp3 result. i tried to test your web pokey using the following form, but without results. ?

 

https://mrk.sed.pl/web-pokey/examples/sap-player/#https://www.atariware.cl/archivos/sap/bruce_lee.sap

Link to comment
Share on other sites

1 hour ago, ascrnet said:

i tried to test your web pokey using the following form, but without results. ?

https://mrk.sed.pl/web-pokey/examples/sap-player/#https://www.atariware.cl/archivos/sap/bruce_lee.sap

because this is not 'type R' SAP:
 

SAP
AUTHOR "<?>"
NAME "Bruce Lee"
DATE "1984"
NTSC
TYPE B
FASTPLAY 262
INIT 982C
PLAYER 98BC
TIME 01:04.278


I'll add some section displaying header and information about invalid sap type.

Unfortunately other than 'R' types require some kind of atari emulation, so supporting them is a bit harder - definitely doable, but out of scope of this example :)

Edited by mrk
  • Thanks 1
Link to comment
Share on other sites

29 minutes ago, mrk said:

because this is not 'type R' SAP

thanks for the clarification, I thought it supports all types B,C,D. ?

30 minutes ago, mrk said:

I'll add some section displaying header and information about invalid sap type.

Unfortunately other than 'R' types require some kind of atari emulation, so supporting them is a bit harder

?

Link to comment
Share on other sites

1 hour ago, rensoup said:

Is it possible to play a local file ?

Not yet, but I can easily add that.

 

1 hour ago, rensoup said:

Does the header need to be complete ? I can save SAPR easily with my RMT2LZSS converter but I don't fill the duration parameter nor the play type.

Header doesn't need to be complete, but `type` needs to be present. I can make it optional, assuming R if not present. type defaults to `R` if not present (just fixed)

Edited by mrk
  • Like 2
Link to comment
Share on other sites

ok I've changed my converter to output time just in case, small test: emkay's hybris mod conversion

hybrisl1.sap

 

https://mrk.sed.pl/web-pokey/examples/sap-player/#https://atariage.com/forums/applications/core/interface/file/attachment.php?id=876075

 

VinsCool's Xenon conversion:

 

https://mrk.sed.pl/web-pokey/examples/sap-player/#https://atariage.com/forums/applications/core/interface/file/attachment.php?id=876078

 

VinsCool's Battle Squadron conversion at 100hz (too slow, messed up the conversion)

 

https://mrk.sed.pl/web-pokey/examples/sap-player/#https://atariage.com/forums/applications/core/interface/file/attachment.php?id=876077

 

Enderdude's Bionic commando at 100hz (too slow, messed up the conversion)

 

https://mrk.sed.pl/web-pokey/examples/sap-player/#https://atariage.com/forums/applications/core/interface/file/attachment.php?id=876076

 

The 100hz tunes should have been 50hz but my converter has a bug and outputs the raw data... perhaps a switch to select playback frequency ?

 

The 50hz tunes seems to play fine! no idea if they're dead accurate but it sounds pretty good, very nice!

 

Bionic_Stage_1mk.sap Battle Squadron Title 100hz Final.sap Xenon Final.sap

Edited by rensoup
  • Like 2
Link to comment
Share on other sites

12 hours ago, rensoup said:

The 100hz tunes should have been 50hz but my converter has a bug and outputs the raw data... perhaps a switch to select playback frequency ?

Fixing these files is as simple as adding FASTPLAY 156 line to header, right? Here are fixed versions:
 

Battle_Squadron_Title_100hz_Final_fixed.sap

 

Bionic_Stage_1mk_fixed.sap
 

Quote

The 50hz tunes seems to play fine! no idea if they're dead accurate but it sounds pretty good, very nice!

That's great to hear! If something sounds wrong please point me frame number(s) from player, I'll try to debug it.
 

Battle_Squadron_Title_100hz_Final_fixed.sap Bionic_Stage_1mk_fixed.sap

Edited by mrk
  • Like 4
Link to comment
Share on other sites

33 minutes ago, rensoup said:

Yes indeed, sounding great as well !

 

Confirmation from the authors ? @VinsCool @emkay @EnderDude

Battle Squadron sounds spot on to me!

Sounds about exactly what I remember doing for it.

20 hours ago, rensoup said:

VinsCool's Xenon conversion:

Hmm something with the Poly5 (Distortion 2) emulation is off, things sound weird with it ?

  • Like 1
Link to comment
Share on other sites

18 minutes ago, VinsCool said:

Hmm something with the Poly5 (Distortion 2) emulation is off, things sound weird with it ?

I had some problems with Poly5 some time ago and instead of computing it copied table from atari800. Now I reverted it (for test)

Could you test it again? Any difference?

Edited by mrk
Link to comment
Share on other sites

7 minutes ago, mrk said:

I had some problems with Poly5 some time ago and instead of computing it copied table from atari800. Now I reverted it.

Could you test it again? Any difference?

I can't say I could notice a difference really...

I know ASAP player also has similar issues with Poly5 sounds for some reason.

 

This is what is sounds like from my hardware for reference :)  (PAL 800xl)

 

Link to comment
Share on other sites

10 minutes ago, EnderDude said:

You have my confirmation!
100hz can be useful to go between two different frequencies and have finer phasing control, but it does come at a cost!

nah, not when encoded with LZSS, it'll still be faster than a RMT tune played back at 50hz...

 

bions1.png.8923043e0c8afd74aed252e61fa6e09a.png

 

I've added the 100hz & 50hz versions, I can't really tell the difference but I don't have a great HW audio setup (ears aren't in good shape either!)

Bionic_Stage_1_50hz.obx Bionic_Stage_1.obx

  • Like 1
Link to comment
Share on other sites

9 minutes ago, VinsCool said:

I can't say I could notice a difference really...

I know ASAP player also has similar issues with Poly5 sounds for some reason.

 

As I see Poly5 is on channel3 (with 1.79Mhz clock), right? I'll try to compare sound for few AUDC3 / AUDF3 register values with Altirra, thanks!

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

12 minutes ago, mrk said:

As I see Poly5 is on channel3 (with 1.79Mhz clock), right? I'll try to compare sound for few AUDC3 / AUDF3 register values with Altirra, thanks!

Here's the channel 3 itself playing alone (also recorded from the same hardware, used in the oscilloscope video) if you think this may be helpful :) 

Xenon In-Game Music #1 STEMS-03.wav

  • Like 1
Link to comment
Share on other sites

 

5 minutes ago, rensoup said:

How accurate do you think your emulator is ?

I'm just trying to figure it out - that's also why I'm asking about your opinion here :) I think it is built on solid base and implements already most of pokey features (one missing thing is SKCTL support: two-tone or pokey reset), personally I'm quite happy with results.
 

15 minutes ago, rensoup said:

@ivop's been looking into changing the Pokey emulator used in RMT perhaps your would be a potential candidate ?

Maybe, but it works in web browser (with WebAudio API, like recent chrome or firefox), so it would require embedding browser some way.

But this implementation is quite simple and probably can be quite easy ported to other language.

  • Like 1
Link to comment
Share on other sites

36 minutes ago, rensoup said:

How accurate do you think your emulator is ? @ivop's been looking into changing the Pokey emulator used in RMT perhaps your would be a potential candidate ?

Perhaps it hasn't been clear yet, but the main problem with RMT is its inherent timing, which is... ehm... wrong, and cannot be fixed without the RMT source code. Even if phaeron were to create a Pokey library for RMT based on Altirra, it would be all over the place, timing wise. So, a waste of time. We have to make do with apokeysnd during composition, even though its resampling is fixed and does not vary between NTSC and PAL.

 

 

Edit: in the end, we need a new tracker editor ;) Hi emkay! But after all these years, I must say he was right all along about needing a new tracker, even though not for the exact reasons discovered recently.

Edited by ivop
  • Thanks 2
Link to comment
Share on other sites

4 minutes ago, mrk said:

Maybe, but it works in web browser (with WebAudio API, like recent chrome or firefox), so it would require embedding browser some way.

I don't think it's worth the trouble, as the RMT timing problem will always remain.

 

4 minutes ago, mrk said:

But this implementation is quite simple and probably can be quite easy ported to other language.

Yes, I looked at your javascript source code, and it's pretty, pretty, pretty clean :)

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...