From 6e666fcc1b46527bd37996a8b200f25faa4571b8 Mon Sep 17 00:00:00 2001 From: Yotam Mann Date: Mon, 13 Feb 2017 17:31:06 -0500 Subject: [PATCH] making prediction path relative this makes it work in the live experience where there is a path beyond the root level --- static/src/ai/AI.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/src/ai/AI.js b/static/src/ai/AI.js index 55c19cb..326e121 100644 --- a/static/src/ai/AI.js +++ b/static/src/ai/AI.js @@ -52,7 +52,7 @@ class AI extends events.EventEmitter{ let additional = endTime additional = Math.min(additional, 8) additional = Math.max(additional, 1) - request.load(`/predict?duration=${endTime + additional}`, JSON.stringify(request.toArray()), 'POST').then((response) => { + request.load(`./predict?duration=${endTime + additional}`, JSON.stringify(request.toArray()), 'POST').then((response) => { response.slice(endTime / 2).tracks[1].notes.forEach((note) => { const now = Tone.now() + 0.05 if (note.noteOn + now > this._aiEndTime){