Commit graph

130 commits

Author SHA1 Message Date
Andy Sloane
219479ecc6 addendum to previous commit; duh 2016-05-31 22:15:46 -07:00
Andy Sloane
f6113fc6c4 simple optimization to filter
just basic algebra, but I should have noticed this sooner!
2016-05-31 18:52:33 -07:00
Andy Sloane
ea423577f0 [#4] Re-enable iOS hack
Before it was running a 1Hz oscillator for 10ms which caused a huge DC
offset when it was done.. Turns out it works if you just immediately
stop and disconnect it, without causing DC offsets or other problems.
2016-04-22 12:12:50 -07:00
Andy Sloane
27d9435d83 [#24] Implement M0 volume effect (portamento)
Written so Mx is equivalent to 3x0; I think if both are present, it
might not do exactly what FT2 does.
2016-04-19 16:34:20 -07:00
Johan Hillerström
7153fa7f3c Merge pull request #21 from hillerstorm/implement_E4x
Implement E4x and address some vibrato issues
2015-11-21 20:25:35 +01:00
Johan Hillerström
e3d159e7ff Add contributors to package.json 2015-11-21 20:22:00 +01:00
Johan Hillerström
1d8b91c8ea Remove E4x from missing effects 2015-11-21 20:21:39 +01:00
Johan Hillerström
9b959532fb Add tests for E4x, E41 and E42 2015-11-21 20:19:30 +01:00
Johan Hillerström
677c157c71 Fix failing vibrato test 2015-11-21 19:54:54 +01:00
Johan Hillerström
e39f601038 Double vibrato depth to act like FT2 2015-11-21 15:50:58 +01:00
Johan Hillerström
b81d675b66 Test for resetting vibrato pos on note retrigger 2015-11-21 15:50:48 +01:00
Johan Hillerström
413bc4b538 Retrigger waveforms 0-3 2015-11-21 15:50:35 +01:00
Johan Hillerström
5af28d860e Update vibratopos according to the spec 2015-11-21 14:58:33 +01:00
Johan Hillerström
0e47b13d83 Implement all vibrato waveforms 2015-11-21 14:58:32 +01:00
Johan Hillerström
fb103e61bc Read vibrato waveform type 2015-11-21 14:58:32 +01:00
Andy Sloane
65a2ea2863 [#5] implement volume effect vibrato 2015-11-20 17:43:48 -08:00
Andy Sloane
8b3f318f60 [#19] handle loops of length 0
also more robust way to find sample offsets to load in the file
2015-11-20 17:42:41 -08:00
Andy Sloane
2679587654 update screen if pattern changes without row changing
this is solely for strobe - CELL II, pretty much...
2015-11-20 12:09:57 -08: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
89e6b9c554 fix Dxx effect
argument is BCD, so 0x10 actually means 10 decimal
2015-11-19 20:24:00 -08:00
Andy Sloane
bf138a245c re-sort Dxx test 2015-11-16 19:21:51 -08:00
Andy Sloane
21e3f073d9 add test for Dxx effect 2015-11-16 19:20:29 -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
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
Andy Sloane
bb5555f5a1 Merge pull request #13 from hillerstorm/implement_Hxy_effect
Implement Hxy effect
2015-11-14 20:28:14 -08:00
Johan Hillerström
be1c0df30d Remove Hxy from missing effects 2015-11-15 00:38:55 +01:00
Johan Hillerström
007f0db8f7 Add test case for Hxy 2015-11-15 00:37:46 +01:00
Johan Hillerström
0f3888cfff Implement the Hxy effect 2015-11-15 00:37:35 +01:00
Andy Sloane
0e82964315 add license field to package.json
I was certain I had already added it, but somehow it went missing.
2015-11-14 09:38:43 -08:00
Andy Sloane
c35bb07fac fix some wrong comments here and there 2015-11-14 09:37:15 -08:00
Andy Sloane
05216f5ce0 implement E5x finetune override
nf_chill.xm just needs EDx now
2015-11-14 09:29:08 -08:00
Andy Sloane
9a410aa535 Merge remote-tracking branch 'hillerstorm/implement_Gxx_effect' 2015-11-14 08:39:27 -08:00
Andy Sloane
0f86a8d2c5 Merge pull request #11 from hillerstorm/fix_out_of_range_pattern_error
Fix non-existing pattern error
2015-11-14 08:35:04 -08:00
Andy Sloane
660729010b jshint cleanup of xmeffects 2015-11-14 08:30:35 -08:00
Andy Sloane
267ecbeffb test for effect Axy 2015-11-14 08:27:17 -08:00
Johan Hillerström
8fe05fb89d Remove Gxx from missing effects 2015-11-14 13:07:51 +01:00
Johan Hillerström
88584b9cd0 Add test case for Gxx 2015-11-14 13:04:43 +01:00
Johan Hillerström
eff3fd1ed6 Implement the Gxx effect 2015-11-14 13:04:29 +01:00
Johan Hillerström
b04e6c00b0 Introduce a global volume variable 2015-11-14 13:04:16 +01:00
Johan Hillerström
fc6be2b246 Add tests for non-existing song positions 2015-11-14 12:35:28 +01:00
Johan Hillerström
1f2b0ba419 Add safeguards when setting cur_pat 2015-11-14 12:35:18 +01:00
Andy Sloane
570aa33a20 added test for vibrato... and fixed vibrato
naturally when i actually tested it, it turned out to be subtly broken

also reorg'd the tests a bit, sorry @hillerstorm.
2015-11-13 22:06:50 -08:00
Andy Sloane
be463856db Add round 1 of tests 2015-11-12 10:57:02 -08:00
Andy Sloane
6a5fe5e024 Remove XM suffix from XMPlayer calls 2015-11-12 08:56:33 -08:00
Andy Sloane
ce5fd027a3 add build status and API docs to README 2015-11-11 22:49:40 -08:00
Andy Sloane
9bf35716f3 add travis testing 2015-11-11 22:32:56 -08:00
Andy Sloane
7ca90f9b98 really basic test runner
npm test now does... something somewhat useful.

now to write a bunch of tests.
2015-11-11 22:28:49 -08: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
Andy Sloane
4b6e75332e Merge pull request #9 from hillerstorm/namespacing_and_global_leakage
Namespacing and global leakage
2015-11-11 16:12:14 -08:00