From 5af28d860ed9cc348cafcd7dc56cf52d502ebf18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johan=20Hillerstr=C3=B6m?= Date: Sat, 21 Nov 2015 02:26:50 +0100 Subject: [PATCH] Update vibratopos according to the spec --- xmeffects.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/xmeffects.js b/xmeffects.js index dad153d..7249bc7 100644 --- a/xmeffects.js +++ b/xmeffects.js @@ -71,8 +71,11 @@ function eff_t1_4(ch) { // vibrato ch.vibratopos, ch.vibratospeed, ch.vibratodepth); ch.periodoffset = 0; } - ch.vibratopos += ch.vibratospeed; - ch.vibratopos &= 63; + // only updates on non-first ticks + if (player.cur_tick > 0) { + ch.vibratopos += ch.vibratospeed; + ch.vibratopos &= 63; + } } function getVibratoDelta(type, x) {