From 1b33e91fb5808d7b08f3f7b3287769cc18fd01a0 Mon Sep 17 00:00:00 2001 From: Kevin Ngo Date: Sat, 17 Nov 2018 06:53:33 -0800 Subject: [PATCH] factor warm up time into beatsTime --- src/components/beat-loader.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/beat-loader.js b/src/components/beat-loader.js index 4a3b892..e071c96 100644 --- a/src/components/beat-loader.js +++ b/src/components/beat-loader.js @@ -161,8 +161,8 @@ AFRAME.registerComponent('beat-loader', { // Get current song time. const song = this.el.components.song; if (!song.isPlaying) { return; } - this.beatsTime = (song.getCurrentTime() + this.data.beatAnticipationTime) * 1000; - if (this.beatsTime <= this.beatsPreloadTimeTotal) { return; } + this.beatsTime = (song.getCurrentTime() + this.data.beatAnticipationTime + + this.data.beatWarmupTime) * 1000; } else { // Song is not playing and is preloading beats, use maintained beat time. this.beatsTime = this.beatsPreloadTime; @@ -214,7 +214,7 @@ AFRAME.registerComponent('beat-loader', { generateBeat: (function () { const beatObj = {}; - + return function (noteInfo) { var beatEl; var color;