No description
  • JavaScript 96.6%
  • HTML 3.4%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Andy Sloane 215f72c19d Fix samples for instruments with >1 sample
The sample offset was incorrectly computed, and was including the sample
headers for all samples after the first one into the first sample's
data, causing various glitches at the beginning of the sample.

Fixes #10.
2015-11-16 18:47:41 -08:00
test Add test case for Hxy 2015-11-15 00:37:46 +01:00
.gitignore really basic test runner 2015-11-11 22:28:49 -08:00
.travis.yml add travis testing 2015-11-11 22:32:56 -08:00
ft2font.png Ripped font gfx out of FastTracker 2 :) 2015-10-30 17:58:24 -07:00
index.html Remove Hxy from missing effects 2015-11-15 00:38:55 +01:00
LICENSE added per-channel low-pass filter 2015-10-23 17:34:52 -07:00
package.json add license field to package.json 2015-11-14 09:38:43 -08:00
README.md Remove XM suffix from XMPlayer calls 2015-11-12 08:56:33 -08:00
shell.js Remove XM suffix from XMPlayer calls 2015-11-12 08:56:33 -08:00
trackview.js Separate html "shell" javascript; player now standalone 2015-11-11 21:19:41 -08:00
xm.js Fix samples for instruments with >1 sample 2015-11-16 18:47:41 -08:00
xmeffects.js Implement the Hxy effect 2015-11-15 00:37:35 +01:00

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.