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 8c37c8d96b Separate html "shell" javascript; player now standalone
Closes #3.

The code which defines what the buttons do and downloads songs and so
forth are now completely separated from the player, which has the
following API:

 - `XMPlayer.initAudio` -> starts up audio context; it's available as
   `XMPlayer.audioctx`
 - `XMPlayer.loadXM(ArrayBuffer)` -> returns `true` if loaded, otherwise
   barfs randomly
 - `XMPlayer.playXM()` -> starts playing
 - `XMPlayer.pauseXM()` -> obvious
 - `XMPlayer.stopXM()` -> obvious; call this before loading a new one

Loading trackview.js is now 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
2015-11-11 21:19:41 -08:00
ft2font.png Ripped font gfx out of FastTracker 2 :) 2015-10-30 17:58:24 -07:00
index.html Separate html "shell" javascript; player now standalone 2015-11-11 21:19:41 -08:00
LICENSE added per-channel low-pass filter 2015-10-23 17:34:52 -07:00
package.json Removed toolbar. 2015-11-11 22:49:25 +01:00
README.md update readme 2015-11-04 10:23:54 -08:00
shell.js Separate html "shell" javascript; player now standalone 2015-11-11 21:19:41 -08:00
trackview.js Separate html "shell" javascript; player now standalone 2015-11-11 21:19:41 -08:00
xm.js Separate html "shell" javascript; player now standalone 2015-11-11 21:19:41 -08:00
xmeffects.js Split viewer code into trackview.js 2015-11-11 18:01:15 -08:00

xm.js

FastTracker 2 .XM player, written for fun.

Demo

By default it plays "my dirty old kamel" by Alexander Bulér aka Zalza. I love this tune, and wrote this code just to play it. It can also load some other tunes hosted on my website with a file picker, and it should play just about any .XM file now if checked out and run locally.

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

MIT license.