Mod Archive Forums Mod Archive Forums
Advanced search  

News:

Please note: Your main modarchive.org account will not work here, you must create a forum account to post on the forums.

Pages: [1]   Go Down

Author Topic: Javascript Module Player  (Read 11324 times)

0 Members and 1 Guest are viewing this topic.

deskjet

  • Liking the Pie
  • Offline Offline
  • Posts: 3
    • View Profile
Javascript Module Player
« on: September 03, 2013, 18:18:50 »

Hi,
I am the creator of chiptune.js, a javascript module player for the browser.
It is based libxmp, so it should play pretty much any format (mod, s3m, it, xm etc) just fine.
I used emscripten to compile the libraries C code into Javascript and built a JS Wrapper around it, so it can be used quite easily.
It uses the Web Audio API for sound output via the browser, which ist currently only supported in Google Chrome, but Firefox support ist about to come in Version 25.

I saw modarchive only has a Java based player, so my project could be an option.
Just have a look if you're interested.

You can try the player on the Demo page. You can drop any module files on the page and hit the play button, when it's loaded. I hope you like it, let me know. :D

Or visit my Repository over at Github, to see the code. If you guys have ideas for improvement I would be happy to know. You can send me patches, too. Any help is appreciated.

I almost forgot: It is really pure Javascript, no browser plugins needed!
« Last Edit: September 03, 2013, 18:26:10 by deskjet »
Logged

raina

  • Milkytracker Moderator
  • Url of Pieland
  • ***
  • Offline Offline
  • Posts: 718
    • View Profile
    • raina.kapsi.fi
Re: Javascript Module Player
« Reply #1 on: September 04, 2013, 14:24:45 »

Well, the volume envelope timing was off with the first .xm I threw at it but these efforts are greatly appreciated. I don't care about the playback accuracy of any old module but once the performance and browser support are there, a js mod player could be tasty for new thigns.

deskjet

  • Liking the Pie
  • Offline Offline
  • Posts: 3
    • View Profile
Re: Javascript Module Player
« Reply #2 on: September 04, 2013, 15:54:44 »

That kind of playback errors seem to be related to libxmp, what I use for decoding.
Chiptune.js just takes the raw audio data and passes it to the browser for playback. So that is a problem, that might get fixed in a future version of libxmp, that I can adopt. libxmp is still under active development, so it's not to late to fix errors.

In terms of performace it's alerady pretty good. I'm not doing benchmarks but it still plays smoothly on slow systems. However I have not tried it on Smartphones, yet.

I'm waiting for Web Audio to be finally officially supported in Firefox. It is currently in developmet and also somewhat working, but the timing of audio buffers seems to be inaccurate. So I hope this will get fixed.
I don't know anything about Internet Explorer. Maybe I'll find some kind of flash fallback as a replacement for Web Audio. We'll see.
Logged

Saga Musix

  • TMA Moderator
  • Too much pie
  • *****
  • Offline Offline
  • Posts: 2189
  • I love OpenMPT! And Modules! And TMA! And Pie! :>
    • View Profile
    • Saga Musix - free module music and more!
Re: Javascript Module Player
« Reply #3 on: September 04, 2013, 16:22:23 »

Not that I want to hijack this thread or anything,but there are also plans to make an emscripten version of libopenmpt - as you seem to have some experience with that kind of stuff now, it might even be a nice idea to team up for that.
Logged
» My TMA artist profile
» Visit my music site: https://sagamusix.de/ [de, en]
» Visit my programming website: https://sagagames.de/ [de]
» Open ModPlug Tracker

deskjet

  • Liking the Pie
  • Offline Offline
  • Posts: 3
    • View Profile
Re: Javascript Module Player
« Reply #4 on: September 04, 2013, 17:16:48 »

OK. I just did some internet research on libopenmpt. Turns out that it is not the same thing as libmodplug, which is great. When starting with chiptune.js I first wanted to do it with libmodplug and failed because the code was a mess. It was much easier with libxmp.
I also found out that there is no release of libopenmpt yet and it's in developmet for quite a long time. To me  an emscripten port of libopenmpt sounds like a good idea but it's hard to do, when there is no stable release of the library, that is known to work.
I found nothing an an emscripten version of libopenmpt, so if I missed something just tell me.
Logged

Saga Musix

  • TMA Moderator
  • Too much pie
  • *****
  • Offline Offline
  • Posts: 2189
  • I love OpenMPT! And Modules! And TMA! And Pie! :>
    • View Profile
    • Saga Musix - free module music and more!
Re: Javascript Module Player
« Reply #5 on: September 04, 2013, 19:13:10 »

libopenmpt is "more or less" ready for productive use but I'm sure we will have a stable API very soon (read: most definitely before the end of the year).

Quote
I found nothing an an emscripten version of libopenmpt, so if I missed something just tell me.
You didn't miss anything, we just very recently played with that idea but nothing specific happened yet.
Logged
» My TMA artist profile
» Visit my music site: https://sagamusix.de/ [de, en]
» Visit my programming website: https://sagagames.de/ [de]
» Open ModPlug Tracker

claudio

  • Tasted the Pie
  • Offline Offline
  • Posts: 1
    • View Profile
Re: Javascript Module Player
« Reply #6 on: November 11, 2013, 01:50:38 »

Hi, I'm interested in fixing the xm envelope problem in libxmp. Could you point me to a module where the problem is especially visible, such as raina's test module?
Logged

DragShot

  • Needs more Pie
  • Offline Offline
  • Posts: 25
    • View Profile
Re: Javascript Module Player
« Reply #7 on: December 13, 2013, 03:46:17 »

Hey, nice web app you got there. And JavaScript? I never tried to build something like a media player using JavaScript before, considering AudioContext is not supported in most browsers, and I'm still not familiarized enough with such scripts :\ .

Anyway, good luck. That project already rocks :) .
Logged
Pages: [1]   Go Up