From 0bfc83d48b4956bc413f260cb55540ad415cccbd Mon Sep 17 00:00:00 2001 From: Andy Sloane Date: Wed, 28 Oct 2015 15:56:29 -0700 Subject: [PATCH] added a few simple effects, updated todo --- index.html | 12 ++++++++++-- xm.js | 32 +++++++++++++++++++++++--------- 2 files changed, 33 insertions(+), 11 deletions(-) diff --git a/index.html b/index.html index ba17192..e895b92 100644 --- a/index.html +++ b/index.html @@ -7,9 +7,17 @@ code: github.com/a1k0n/jsxm tune: my dirty old kamel - Zalza todo: - - instrument fadeout + - unroll short sample loops + - unroll mixer code loops - pingpong loops - - various XM effects are missing + - multi-sample instruments + - instrument fadeout + - missing XM effects (in rough order of priority): + - Rxy - retrigger + - Bxx / Dxx - position / pattern jumps + - 7xy - tremolo + - E3x, E4x, E5x, E6x, E7x, E9x, EDx, EEx + - Gxx, Hxy, Kxx, Lxx, Pxy, Txy - oscilloscopes diff --git a/xm.js b/xm.js index 7c45b97..260cfe0 100644 --- a/xm.js +++ b/xm.js @@ -455,6 +455,14 @@ function eff_t0_4(ch, data) { // vibrato eff_t1_4(ch, data); } +function eff_t0_8(ch, data) { // set panning + ch.pan = data; +} + +function eff_t0_9(ch, data) { // sample offset + ch.off = data * 256; +} + function eff_t0_a(ch, data) { // volume slide if (data) { if (data & 0x0f) { @@ -523,12 +531,12 @@ var effects_t0 = [ // effect functions on tick 0 eff_t0_2, eff_t0_3, eff_t0_4, // 4 - eff_unimplemented_t0, // 5 + eff_t0_a, // 5, same as A on first tick eff_t0_a, // 6, same as A on first tick eff_unimplemented_t0, // 7 - eff_unimplemented_t0, // 8 - eff_unimplemented_t0, // 9 - eff_t0_a, + eff_t0_8, // 8 + eff_t0_9, // 9 + eff_t0_a, // a eff_unimplemented_t0, // b eff_t0_c, // c eff_unimplemented_t0, // d @@ -574,6 +582,11 @@ function eff_t1_4(ch) { // vibrato ch.vibratopos &= 63; } +function eff_t1_5(ch) { // portamento + volume slide + eff_t1_a(ch); + eff_t1_3(ch); +} + function eff_t1_6(ch) { // vibrato + volume slide eff_t1_a(ch); eff_t1_4(ch); @@ -595,6 +608,7 @@ function eff_t1_e(ch) { // note cut } } +function eff_nop() {} function eff_unimplemented() {} var effects_t1 = [ // effect functions on tick 1+ eff_t1_0, @@ -602,14 +616,14 @@ var effects_t1 = [ // effect functions on tick 1+ eff_t1_2, eff_t1_3, eff_t1_4, - eff_unimplemented, // 5 - eff_t1_6, + eff_t1_5, // 5 + eff_t1_6, // 6 eff_unimplemented, // 7 - eff_unimplemented, // 8 - eff_unimplemented, // 9 + eff_nop, // 8 + eff_nop, // 9 eff_t1_a, // a eff_unimplemented, // b - eff_unimplemented, // c + eff_nop, // c eff_unimplemented, // d eff_t1_e, // e eff_unimplemented, // f