jsxm

FastTracker 2 .xm module player in Javascript

  • Owner: a1k0n/jsxm
  • Platform:
  • License:: MIT License
  • Category::
  • Topic:
  • Like:
    0
      Compare:

Github stars Tracking Chart

xm.js

Build Status

FastTracker 2 .XM player, written for fun.

Demo

There is an XM player and a visualizer which are separate components. The
player API looks like this:

  • XMPlayer.init -> starts up audio context; it's available as
    XMPlayer.audioctx
  • XMPlayer.load(ArrayBuffer) -> returns true if loaded, otherwise
    barfs randomly
  • XMPlayer.play() -> starts playing
  • XMPlayer.pause() -> obvious
  • XMPlayer.stop() -> obvious; call this before loading a new one

Loading trackview.js is optional; without it, the player won't do any
visualizations. Or, you can override the following to get callbacks:

  • XMView.pushEvent(e) -> push an audio event onto the queue. Called
    once per tick (about 50Hz, controlled by song). e contains fields:
    • t - audio timestamp
    • vu - Float32Array of RMS power (volume) for each channel
    • scopes - [Float32Array] of oscilloscope data, one array per
      channel; XMView.scope_width contains # of samples to produce here
    • songpos - position in the song (# patterns played)
    • pat - pattern number currently playing
    • row - row within pattern
  • XMView.pause() - pause visualization
  • XMView.stop() - stop/reset visualization

The code which defines what the buttons do and downloads songs and so
forth is in shell.js.

The player is fairly feature-complete, but is missing a bunch of effects.

MIT license.

Main metrics

Overview
Name With Ownera1k0n/jsxm
Primary LanguageJavaScript
Program languageHTML (Language Count: 2)
Platform
License:MIT License
所有者活动
Created At2015-10-22 13:51:50
Pushed At2020-12-18 10:07:21
Last Commit At2018-07-31 09:29:51
Release Count0
用户参与
Stargazers Count493
Watchers Count22
Fork Count37
Commits Count142
Has Issues Enabled
Issues Count21
Issue Open Count7
Pull Requests Count10
Pull Requests Open Count0
Pull Requests Close Count1
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private