+// Javascript functions for controlling audio
+var starttime = 0;
+var endtime = 0;
+var ascrollpoint = 0;
+var bscrollpoint = 0;
+
+var song, interval, scroll, body;
+
+// Keycodes
+const spacebar = 32;
+const leftarrow = 37;
+const rightarrow = 39;
+const seta = 65;
+const setb = 66;
+const cleara = 67;
+const return2start = 82;
+
+const howmanysecs = 10;
+const scrollby = 1;
+const oneSec = 1000;
+const scrollTime = 400;
+
+function loop() {
+ // If endtime is not set then we can't loop
+ if (endtime == 0) return;
+
+ // if we're past the endtime then it's time to start back at the A marker
+ if (song.currentTime > endtime) {
+ song.currentTime = starttime;
+ if (ascrollpoint != 0) window.scrollTo(0, ascrollpoint);
+ } // if
+} // loop
+
+function scrollLyrics(x, y) {
+ window.scrollBy(0, scrollby);
+} // scrollLyrics