a1k0n / jsxm

FastTracker 2 .xm module player in Javascript
http://www.a1k0n.net/code/jsxm/
MIT License
485 stars 36 forks source link

Implement Hxy effect #13

Closed hillerstorm closed 8 years ago

hillerstorm commented 8 years ago

Tested against 0xx00.xm.

The effect is in use in the last few patterns, col 1, every 8th row.

To jump there instantly set a breakpoint in xm.js:play(), run the following code in the debugger and then resume:

player.cur_songpos=12;player.cur_pat=18;player.cur_row=0
hillerstorm commented 8 years ago

That song also has lots of E9x in the beginning (second pattern). I have read some conflicting info about that effect though.

wiki.openmpt.org says the following:

Retriggers the current note every x ticks. This effect also works with parameters greater than the current speed setting if the next row also contains an E9x effect.

It also states that E9x does not use a memory, which would mean that E90 does nothing. Since the tempo in this song is 3, none of the E94s and E95s would do anything (except when used one after another, to continue on the next row). Seems a bit odd.

wiki.multimedia.cx however, says this:

Retrig note.

This effect retrigs the sample on every x-th tick. It doesn't use the counter, which is used by Rxy. Instead it uses the normal tick counter, which is reset on every row. Thus, it is more similar to the protracker version of the retrig effect, while Rxy is more similar to the Scream Tracker (and Impulse Tracker) version of retrig. Please note that similar does not mean 100% compatible :)

Notes:

  • If the parameter x is 0, this effect retrigs the sample only once - on tick 0.
  • If the parameter x is not 0, this effect retrigs on every x-th tick, except on tick 0.
  • Although this effect does not use the Rxy counter and never increments it, it resets it whenever a retrig occurs, except on tick 0.
  • This effect also does not touch the Rxy effect memory.

Which would still mean that the notes are never retriggered in this song at all, but the wording suggests that Rxy is a lot more complicated than the current implementation (Rxy on wiki.multimedia.cx)

I started trying to implement it but got confused :)

a1k0n commented 8 years ago

LGTM. I forgot to remove some other missing effects from the readme.

Hmm, re: E9x, it seems the best way to find out would be to load up Fasttracker 2 in DosBox and try it out... I would trust OpenMPT to get it right though. Also their description is consistent with what the .xm author apparently expected...

a1k0n commented 8 years ago

@hillerstorm I just tried this in FT2; it appears wiki.multimedia.cx is correct. E9x if x >= speed appears to do nothing, even if repeated on the next rows. So, retrigger when cur_tick % x == 0.

I didn't realize Rxy had a separate counter, either; my implementation is probably wrong.