Commit graph jsxm/index.html
Author SHA1 Message Date
Johan Hillerström
1d8b91c8ea Remove E4x from missing effects 2015-11-21 20:21:39 +01:00
Andy Sloane
34e975ef55 changed my mind: render 000 effect as ...
also make the track view much taller in the standalone player
2015-11-19 20:47:28 -08:00
Andy Sloane
e347807abf Change cur_row to actually mean current row
It used to really mean "next row", and resulted in showing the wrong row
in the pattern view (row -1 instead of the last row).

Fixes #14.
2015-11-16 18:59:46 -08:00
Johan Hillerström
be1c0df30d Remove Hxy from missing effects 2015-11-15 00:38:55 +01:00
Johan Hillerström
8fe05fb89d Remove Gxx from missing effects 2015-11-14 13:07:51 +01:00
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
Andy Sloane
8e114a16da Split viewer code into trackview.js
Also disabled iOS hack, as it seems to be causing issues, and fixed a
minor drag-n-drop bug (wouldn't load if track was already playing past
length of newly loaded track).

To play without a viewer, you still have to stub it out. Not sure the
best way to handle that case yet.
2015-11-11 18:01:15 -08:00
Johan Hillerström
ea36dceb55 Wrap in IIFE and namespace any shared info 2015-11-12 00:08:32 +01:00
Johan Hillerström
a37555ed58 Reorder to load without any issues 2015-11-12 00:00:43 +01:00
Andy Sloane
2cf8840665 Contact with the real world
Many, many fixes found after posting this on my website.

 - drag n drop supported
 - plays on OSX and iOS safari now
 - random other hiccups fixed

there seems to be some remaining issues cleaning up when loading a new
song.
2015-11-10 20:30:41 -08:00
Andy Sloane
5aa5c06ab0 update readme 2015-11-04 10:23:54 -08:00
Andy Sloane
7d6481ad73 file picker! 2015-11-04 10:21:04 -08:00
Andy Sloane
a547732063 render a nice big title and center stuff 2015-11-04 07:19:44 -08:00
Andy Sloane
f092f847f7 instrument list rendering with FT2 font. 2015-11-04 06:22:49 -08:00
Andy Sloane
ea6edaf2e4 add play/pause function 2015-11-03 09:36:00 -08:00
Andy Sloane
c4370f447c implemented multiple samples / instrument 2015-11-02 13:46:23 -08:00
Andy Sloane
114240ca9f oscilloscopes.
couldn't really think of a better way to do it, but it looks pretty
awesome. you can really see the filter effect too.
2015-11-01 09:26:03 -08:00
Andy Sloane
3daeeee96b implement retrigger, move effects into separate js 2015-11-01 07:42:52 -08:00
Andy Sloane
6dee1787f3 show the instruments 2015-10-31 11:39:49 -07:00
Andy Sloane
c238aabd66 butter smooth screen updates, longer audio buffer 2015-10-30 21:25:21 -07:00
Andy Sloane
b7a2e58109 Ripped font gfx out of FastTracker 2 :) 2015-10-30 17:58:24 -07:00
Andy Sloane
92c6bddcc6 fixed a bunch of playback-stopping bugs 2015-10-29 14:56:17 -07:00
Andy Sloane
5645739edb unrolled main mixing loop 2015-10-28 21:59:54 -07:00
Andy Sloane
efec2d7273 implement instrument fadeout
i just hacked the fadeout directly into envelopes rather than
complicating anything else.
2015-10-28 19:47:42 -07:00
Andy Sloane
2615c201e2 implement sample loop unrolling & pingpong 2015-10-28 19:14:06 -07:00
Andy Sloane
16167bc599 implement pattern / song jumps 2015-10-28 16:21:12 -07:00
Andy Sloane
0bfc83d48b added a few simple effects, updated todo 2015-10-28 15:56:29 -07:00
Andy Sloane
5161e55669 added volume column effects, fixed panning
when there was no panning envelope, panning was totally wrong

panning is still sort of wrong, in that the RMS power of a channel is
not constant over pans...
2015-10-27 15:38:42 -07:00
Andy Sloane
343da0f3e9 creditz to zalza in index.html 2015-10-26 15:40:55 -07:00
Andy Sloane
706770584a add code pointer in index 2015-10-26 11:03:51 -07:00
Andy Sloane
10ea0b5f65 rudimentary VU meters 2015-10-26 10:53:23 -07:00
Andy Sloane
94d378d4ce added panning envelopes
refactored envelopes.

no idea if the final panning is right, though. need to do some tests vs
FT2.
2015-10-26 10:41:58 -07:00
Andy Sloane
741efc0f25 fixed vibrato, implemented Axy 2015-10-26 09:18:11 -07:00
Andy Sloane
fca447528e arpeggio!*&@ 2015-10-24 09:00:24 -07:00
Andy Sloane
6837fbb42e added a click/pop filter on volume and note end.
sounds a LOT better now.  just needs effects!
2015-10-23 17:58:42 -07:00
Andy Sloane
a0a2d4446e split javascript out into xm.js
Change-Id: I81718be257163f66ed88c6debbcc90c276a16fb0
2015-10-22 06:51:13 -07:00
Andy Sloane
733fd861d3 basic XM file parsing
Change-Id: I544a3e5216f933797102b05dd2381de260d654f5
2014-03-27 09:07:48 -05:00