<!doctype html>
<html>
<head>
<title>HTML5 Web Audio API Usage - RJM Programming - June, 2019 - Thanks to https://www.html5rocks.com/en/tutorials/webaudio/intro/</title>
<style>
button { background-color: yellow; }
input { background-color: pink; }
.parent{
width: 490px;
height: 50px;
border: 1px solid #aaa;
overflow: hidden;
}
.child{
width:420px;
height: 28px;
margin-right: -50px; /* maximum width of scrollbar */
padding-right: 50px; /* maximum width of scrollbar */
overflow-y: scroll;
}
</style>
<script type='text/javascript'>

if ((location.search.split('vscaseyrule=')[1] ? (' ' + decodeURIComponent(location.search.split('vscaseyrule=')[1]).split('&')[0]) : '') != '') {
window.onload = setTimeout(init, 13000);
} else if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
window.onload = setTimeout(init, 3000);
} else {
window.onload = init;
}
var donei=false;
var prevdg=0, oxd='';
var dvih='<video onclick="this.play();" id=ivideo src="../PHP/macbetha1s1.m4v" controls></video>';
var valtsofar=";0;1;2;3;";
var nostop=false;
var context;
var one=1, five=5, four=4;
var bufferLoader;
var atonl=true;
var gvo=null;
var source=null;
var documentURL=document.URL;
var isrc=' src=';
var source1 = null; //context.createBufferSource();
var source2 = null; //context.createBufferSource();
var source3 = null; //context.createBufferSource();
var source4 = null; //context.createBufferSource();

var ourmimetype='', kk=0;
var types = ["video/mp4","image/svg","audio/wav","audio/x-wav","audio/x-pn-realaudio","audio/x-mpegurl","audio/x-aiff","audio/mpeg","audio/mid",
"audio/basic","audio/ogg","video/x-sgi-movie","video/x-msvideo","video/quicktime","audio/mp3","video/mp4","video/mpeg",
"video/x-la-asf","video/ogg","video/webm","audio/mp4", "image/jpeg", "image/jpeg", "image/png", "image/gif", "image/bmp", "image/tif",
"text/html", "text/html", "text/html", "text/javascript", "text/css", "text/plain", "text/xml", "text/csv",
"application/vnd.ms-word", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "application/x-php", "application/pdf",
"application/vnd.openxmlformats-officedocument.presentationml.presentation", "application/vnd.ms-powerpoint",
"application/vnd.ms-excel", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"];
var exts = [".mp4",".svg",".wav",".wav",".ram",".m3u",".aiff",".mp3",".rmi",
".snd",".ogg",".movie",".avi",".mov",".mp3",".m4v",".mpeg",
".lsx",".ogv",".webm",".m4a", ".jpg", ".jpeg", ".png", ".gif", ".bmp", ".tif",
".htm", ".html", ".htmls", ".js", ".css", ".txt", ".xml", ".csv",
".doc", ".docx", ".php", ".pdf",
".pptx", ".ppt",
".xls", ".xlsx"];

var lastcmdsuffix='';
var wone='url1';
var woneo=null;
var wonev='urlv1';
var woneov=null;
var done=true;
var actedupon=false;

var cmdfixes=[];

var source1p = false; //context.createBufferSource();
var source2p = false; //context.createBufferSource();
var source3p = false; //context.createBufferSource();
var source4p = false; //context.createBufferSource();

var ioffset=0;
var lastbo=null, mfile=null;
var zi=location.search.split('zi=')[1] ? eval(decodeURIComponent(location.search.split('zi=')[1]).split('&')[0]) : 2;

var nafter=0;
var notebuffstuff="";

var sb=[], asb=[];
var ioffs=[0,0,0,0];

var whichs='';
var fors='';
var forid='';

function afterfor() {
if (fors != '' && forid != '') {
if (document.getElementById(forid).innerHTML.indexOf(fors.substring(0,eval(-1 + fors.length))) == -1) {
document.getElementById(forid).innerHTML+=fors;
}
}
fors='';
forid='';
}

function xd() {
//alert(oxd);
if (parent.document.getElementById(oxd)) {
document.getElementById(oxd).click();
} else {
document.getElementById(oxd).click();
}
}

function xdocumentgetElementById(idis) {
oxd=idis;
setTimeout(xd, 2000);
}

function documentgetElementById(idis, ds) {
fors='';
forid='';
if (source_valid() && ('' + ds).indexOf('-') == -1 && ('' + ds).replace('0','') != '') {
forid=idis;
fors=' ... for ' + ds + ' secs';
setTimeout(afterfor,900);
document.getElementById(idis).click();
} else {
document.getElementById(idis).click();
}
}

function atThisTime() {
if (("" + nextones[eval(-1 + inextones)].buttonNum + " ").substring(0,1) == '1') {
if (("" + nextones[eval(-1 + inextones)].buttonNum + " ") == '1') {
documentgetElementById('b1',nextones[eval(-1 + inextones)].durationSecs); //.click();
} else {
documentgetElementById('xb1',nextones[eval(-1 + inextones)].durationSecs); //.click();
}
} else if (("" + nextones[eval(-1 + inextones)].buttonNum + " ").substring(0,1) == '2') {
if (("" + nextones[eval(-1 + inextones)].buttonNum + " ") == '2') {
documentgetElementById('b2',nextones[eval(-1 + inextones)].durationSecs); //.click();
} else {
documentgetElementById('xb2',nextones[eval(-1 + inextones)].durationSecs); //.click();
}
} else if (("" + nextones[eval(-1 + inextones)].buttonNum + " ").substring(0,1) == '3') {
if (("" + nextones[eval(-1 + inextones)].buttonNum + " ") == '3') {
documentgetElementById('b3',nextones[eval(-1 + inextones)].durationSecs); //.click();
} else {
documentgetElementById('xb3',nextones[eval(-1 + inextones)].durationSecs); //.click();
}
} else if (("" + nextones[eval(-1 + inextones)].buttonNum + " ").substring(0,1) == '4') {
if (("" + nextones[eval(-1 + inextones)].buttonNum + " ") == '4') {
documentgetElementById('b4',nextones[eval(-1 + inextones)].durationSecs); //.click();
} else {
documentgetElementById('xb4',nextones[eval(-1 + inextones)].durationSecs); //.click();
}
}
}

function nbit() {
document.getElementById('duration').value='';
}

function checknext() {
if (nafter > 0) { setTimeout(nbit, nafter); nafter=0; }
if (lastcmdsuffix != "") {
//if (lastcmdsuffix.indexOf(('' + prevdg + ';')) == 0) { lastcmdsuffix=lastcmdsuffix.replace(('' + prevdg + ';'),''); alert('-2:' + lastcmdsuffix); } else { alert('-5:' + prevdg + ' in ' + lastcmdsuffix); }
var huhss=lastcmdsuffix.split(';');
if (lastcmdsuffix.indexOf(huhss[0] + ';') != -1) {
lastcmdsuffix=lastcmdsuffix.replace(huhss[0] + ';', '');
} else {
lastcmdsuffix=lastcmdsuffix.replace(huhss[0], '');
}
var withins=huhss[0].split(':');
if (withins.length >= 5) {
if (("" + nextones[inextones].durationSecs).indexOf('-') == -1 && ("" + nextones[inextones].durationSecs) != '0') {
document.getElementById('startingat').value="" + nextones[inextones].startingAt;
document.getElementById('startingin').value="" + nextones[inextones].startingIn;
document.getElementById('loop1').checked=nextones[inextones].loopIt;
if (document.getElementById('duration').value.indexOf(huhss[0] + ';') != -1) {
setTimeout(atThisTime, eval(1000 * eval('' + prevdg)));
document.getElementById('duration').value=lastcmdsuffix.replace(huhss[0] + ";", nextones[inextones].durationSecs + ";");
//alert('here at ' + document.getElementById('duration').value);
} else {
setTimeout(atThisTime, eval(1000 * eval('' + prevdg)));
//alert('Here ' + inextones + ' . ' + huhss[0] + ' at ' + document.getElementById('duration').value);
//document.getElementById('duration').value=lastcmdsuffix.replace(huhss[0], nextones[eval(0 + inextones)].durationSecs);
document.getElementById('duration').value=lastcmdsuffix.replace(huhss[0], nextones[eval(0 + inextones)].durationSecs);
//alert('Here at ' + lastcmdsuffix.replace(huhss[0], nextones[eval(0 + inextones)].durationSecs));
}
inextones++;
} else {
lastcmdsuffix="";
//document.getElementById('duration').value="";
nextones=[];
inextones=0;
}
} else if (withins.length == four) {
lastcmdsuffix="";
//document.getElementById('duration').value="";
nextones=[];
inextones=0;
} else if (withins.length == 3) {
lastcmdsuffix="";
//document.getElementById('duration').value="";
nextones=[];
inextones=0;
} else if (withins.length == 2) {
lastcmdsuffix="";
//document.getElementById('duration').value="";
nextones=[];
inextones=0;
} else if (withins.length == 1) {
lastcmdsuffix="";
//document.getElementById('duration').value="";
nextones=[];
inextones=0;
} else if (lastcmdsuffix == "") {
nextones=[];
inextones=0;
} else {
document.getElementById('duration').value=lastcmdsuffix;
inextones=0;
}
} else {
//document.getElementById('duration').value="";
nextones=[];
inextones=0;
}
}

function source_valid() {
if (typeof source !== 'undefined') {
if (source.length >= four) { return true; }
}
return false;
}

function sourcep_valid() {
if (typeof sourcep !== 'undefined') {
if (sourcep.length >= four) { return true; }
}
return false;
}

function predura(tv,tvo) {
var withins=[];
var total=0;
if (tv != '') {
lastcmdsuffix=tv;
document.getElementById('duration').value=tv;
if (tv.split(';')[0].split(':')[eval(-1 + tv.split(';')[0].split(':').length)].indexOf('-') == -1 && tv.split(';')[0].split(':')[eval(-1 + tv.split(';')[0].split(':').length)] != '0') {
total+=eval('0' + tv.split(';')[0].split(':')[eval(-1 + tv.split(';')[0].split(':').length)]);
}
var huhss=lastcmdsuffix.split(';');
if (huhss.length <= 1) {
lastcmdsuffix="";
nextones=[];
inextones=0;
} else {
lastcmdsuffix="";
nextones=[];
inextones=0;
for (var jji=1; jji<huhss.length; jji++) {
lastcmdsuffix+=huhss[jji];
withins=huhss[jji].split(':');
if (withins.length >= 5) {
nextones.push(new NextAudioSet(withins[0], withins[1], withins[2], withins[3], withins[4]));
if (withins[4].indexOf('-') == -1 && withins[4] != '0') {
total+=eval('0' + withins[4].split(';')[0].split(':')[eval(-1 + withins[4].split(';')[0].split(':').length)]);
}
} else if (withins.length == 4) {
nextones.push(new NextAudioSet(withins[0], withins[1], withins[2], withins[3], ""));
} else if (withins.length == 3) {
nextones.push(new NextAudioSet(withins[0], withins[1], withins[2], false, ""));
} else if (withins.length == 2) {
nextones.push(new NextAudioSet(withins[0], withins[1], "", false, ""));
} else if (withins.length == 1) {
nextones.push(new NextAudioSet(withins[0], "", "", false, ""));
}
}
//document.getElementById('duration').value=lastcmdsuffix;
//alert(lastcmdsuffix);
}
if (atonl) {
if (huhss[0].indexOf(':') != -1) {
switch ((huhss[0].split(':')[0] + ' ').substring(0,1)) {
case '1':
if (huhss[0].split(':')[0].length == 1) {
xdocumentgetElementById('b1'); //.click();
} else {
xdocumentgetElementById('xb1'); //.click();
}
break;

case '2':
if (huhss[0].split(':')[0].length == 1) {
xdocumentgetElementById('b2'); //.click();
} else {
xdocumentgetElementById('xb2'); //.click();
}
break;

case '3':
if (huhss[0].split(':')[0].length == 1) {
xdocumentgetElementById('b3'); //.click();
} else {
xdocumentgetElementById('xb3'); //.click();
}
break;

case '4':
if (huhss[0].split(':')[0].length == 1) {
xdocumentgetElementById('b4'); //.click();
} else {
xdocumentgetElementById('xb4'); //.click();
}
break;

default:
xdocumentgetElementById('b1'); //.click();
break;
}
} else {
xdocumentgetElementById('b1'); //.click();
}
atonl=false;
}
}
if (total > 0) { total++; nafter=eval(1000 * eval('' + total)); }
tvo.value='';
}

function dura(insis,lbo) {
var dg="";
if (('' + fors).indexOf('-') == -1 && ('' + fors) != '0' && fors != '') {
dg=fors.split(' for ')[1].split(' ')[0];
fors='';
forid='';
if (dg.indexOf('-') == -1 && dg != '0') {
if (lbo) { if (lbo.innerHTML.indexOf(' ... for ' + dg + ' sec') == -1) { lbo.innerHTML+=' ... for ' + dg + ' secs'; } }
if (insis.split(',').length == 3) {
prevdg=eval('' + dg);
return insis.replace(',' + insis.split(',')[2].split(')')[0] + ')', ',' + dg + ')');
} else if (insis.split(',').length == 2) {
prevdg=eval('' + dg);
return insis.replace(')', ',0,' + dg + ')');
} else {
prevdg=eval('' + dg);
return '(0,0,' + dg + ')';
}
}
} else if (document.getElementById('duration').value.split(';')[0].replace('0','').indexOf(':') != -1) {
dg=document.getElementById('duration').value.split(';')[0].split(':')[eval(-1 + document.getElementById('duration').value.split(';')[0].split(':').length)];
if (dg.indexOf('-') == -1 && dg != '0') {
if (lbo) { if (lbo.innerHTML.indexOf(' ... for ' + dg + ' sec') == -1) { lbo.innerHTML+=' ... for ' + dg + ' secs'; } }
if (insis.split(',').length == 3) {
prevdg=eval('' + dg);
return insis.replace(',' + insis.split(',')[2].split(')')[0] + ')', ',' + dg + ')');
} else if (insis.split(',').length == 2) {
prevdg=eval('' + dg);
return insis.replace(')', ',0,' + dg + ')');
} else {
prevdg=eval('' + dg);
return '(0,0,' + dg + ')';
}
}
} else if (document.getElementById('duration').value.replace('0','') != '') {
if (document.getElementById('duration').value.split(':')[0].split(';')[0].split('.')[0].split(' ')[0].indexOf('-') == -1) {
if (insis.split(',').length == 3) {
prevdg=eval('' + document.getElementById('duration').value.split(':')[0].split(';')[0].split('.')[0].split(' ')[0]);
if (lbo) { if (lbo.innerHTML.indexOf(' ... for ' + prevdg + ' sec') == -1) { lbo.innerHTML+=' ... for ' + prevdg + ' secs'; } }
return insis.replace(',' + insis.split(',')[2].split(')')[0] + ')', ',' + document.getElementById('duration').value.split(':')[0].split(';')[0].split('.')[0].split(' ')[0] + ')');
} else if (insis.split(',').length == 2) {
prevdg=eval('' + document.getElementById('duration').value.split(':')[0].split(';')[0].split('.')[0].split(' ')[0]);
if (lbo) { if (lbo.innerHTML.indexOf(' ... for ' + prevdg + ' sec') == -1) { lbo.innerHTML+=' ... for ' + prevdg + ' secs'; } }
return insis.replace(')', ',' + document.getElementById('duration').value.split(':')[0].split(';')[0].split('.')[0].split(' ')[0] + ')');
} else {
prevdg=eval('' + document.getElementById('duration').value.split(':')[0].split(';')[0].split('.')[0].split(' ')[0]);
if (lbo) { if (lbo.innerHTML.indexOf(' ... for ' + prevdg + ' sec') == -1) { lbo.innerHTML+=' ... for ' + prevdg + ' secs'; } }
return '(0,0,' + document.getElementById('duration').value.split(':')[0].split(';')[0].split('.')[0].split(' ')[0] + ')';
}
}
} else if (nextones.length > 0 && nextones.length > eval(-1 + inextones) && inextones > 0) {
dg=nextones[eval(-1 + inextones)].durationSecs;
if (lbo) { if (lbo.innerHTML.indexOf(' ... for ' + dg + ' sec') == -1) { lbo.innerHTML+=' ... for ' + dg + ' secs'; } }
prevdg=0;
//alert(insis);
if (insis.split(',').length == 3) {
//prevdg=eval('' + document.getElementById('duration').value.split(':')[0].split(';')[0].split('.')[0].split(' ')[0]);
return insis.replace(',' + insis.split(',')[2].split(')')[0] + ')', ',' + dg + ')');
} else if (insis.split(',').length == 2) {
//prevdg=eval('' + document.getElementById('duration').value.split(':')[0].split(';')[0].split('.')[0].split(' ')[0]);
//alert(insis.replace(')', ',' + dg + ')'));
return insis.replace(')', ',' + dg + ')');
} else {
//prevdg=eval('' + document.getElementById('duration').value.split(':')[0].split(';')[0].split('.')[0].split(' ')[0]);
return '(0,0,' + dg + ')';
}
}
return insis;
}


function NextAudioSet(buttonNum, startingAt, startingIn, loopIt, durationSecs) {
this.buttonNum = "" + buttonNum;
if (typeof startingAt !== 'undefined') {
this.startingAt = "" + startingAt;
} else {
this.startingAt = "";
}
if (typeof startingIn !== 'undefined') {
this.startingIn = "" + startingIn;
} else {
this.startingIn = "";
}
if (typeof loopIt !== 'undefined') {
if ((("" + loopIt).toLowerCase() + "f").substring(0,1).replace('0','f').replace('1','t') == 't') {
this.loopIt = true;
} else {
this.loopIt = false;
}
} else {
this.loopIt = false;
}
if (typeof durationSecs !== 'undefined') {
this.durationSecs = "" + durationSecs;
} else {
this.durationSecs = "";
}
}



var nextones=[];
var inextones=0;
var isSafari = /Safari/.test(navigator.userAgent) && /Apple Computer/.test(navigator.vendor);

var source=[];
var sourcep=[];
var notoka=location.search.split('notoka=')[1] ? (" " + decodeURIComponent(location.search.split('notoka=')[1]).split('&')[0]) : "";

if (isSafari) { isrc=' srcdoc='; }

if (notoka == "") {
for (var iii=1; iii<=eval(-1 + five); iii++) {
source.push(null);
sourcep.push(false);
}
} //else if (notoka.trim() == 'secret') {
//isrc=' srcdoc=';
//}

fivenotfive();

for (var ii=five; ii<eval(200 * four); ii++) {
valtsofar+='' + eval(-1 + ii) + ';';
if (source_valid()) { //if (typeof source !== 'undefined') {
source.push(null);
if (sourcep_valid()) { //if (typeof sourcep !== 'undefined') {
sourcep.push(false);
}
} else {
eval("var source" + ii + " = null;"); //context.createBufferSource();
}
}

function BufferLoader(context, urlList, callback) { // thanks to https://stackoverflow.com/questions/17333777/uncaught-reference-error-bufferloader-is-not-defined
this.context = context;
this.urlList = urlList;
this.onload = callback;
this.bufferList = new Array();
this.loadCount = 0;
}

function playnotes() {
var pxlist;
if (parent.document.getElementById('conduit')) {
if (parent.document.getElementById('conduit').value.trim() != '') {
var plist=parent.document.getElementById('conduit').value.trim().split(' ');
parent.document.getElementById('conduit').value=parent.document.getElementById('conduit').value.replace(' ' + plist[0], ' ');
//alert(plist[0].replace('/','').replace('.',''));
if (document.getElementById(plist[0].replace('/','').replace('.',''))) {
//if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
// document.getElementById(plist[0].replace('/','').replace('.','')).style.display='block';
//}
//if (isSafari) { document.getElementById(plist[0].replace('/','').replace('.','')).style.display='inline-block'; }
document.getElementById(plist[0].replace('/','').replace('.','')).click();
//parent.document.title+=' ' + (document.getElementById(plist[0].replace('/','').replace('.','')).outerHTML);
pxlist=parent.document.getElementById('cmdconduit').value.trim().split(' ');
} else {
pxlist=parent.document.getElementById('cmdconduit').value.trim().split(' ');
eval(pxlist[0]);
}
parent.document.getElementById('cmdconduit').value=parent.document.getElementById('cmdconduit').value.replace(' ' + pxlist[0], ' ');
}
}
}

function fivenotfive() {
if (five != 5) {
if (1 == 1) {
console.log(document.getElementById('dchoose').innerHTML);
if (document.getElementById('dchoose').innerHTML.indexOf('Web Audio') == 0) {
if (document.getElementById('ddchoose')) {
if (document.getElementById('ddchoose').innerHTML == '') {
document.getElementById('ddchoose').innerHTML=notebuffstuff;
}
} else {
document.getElementById('dchoose').innerHTML+=notebuffstuff;
}
} else {
setTimeout(fivenotfive, 1000);
}
console.log(document.getElementById('dchoose').innerHTML.substring(0,100));
} else {
document.getElementById('dpiano').innerHTML=notebuffstuff;
}
//alert(notebuffstuff);
}
}

function vspiano(buffarray) { // 13 x 6 + 5 + 4 + 1
if (actedupon && (location.search.split('vscaseyrule=')[1] ? (' ' + decodeURIComponent(location.search.split('vscaseyrule=')[1]).split('&')[0]) : '') != '') { //navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
if (1 == 2 && navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
parent.document.getElementById('conduit').value='';
parent.document.getElementById('cmdconduit').value='';
} else {
five=88;
four=87;
source=[];
sourcep=[];
ioffs=[];
for (var iiix=1; iiix<=eval(-1 + five); iiix++) {
source.push(null);
sourcep.push(false);
ioffs.push(0);
}
for (var iiixx=five; iiixx<=eval(-1 + five * 200); iiixx++) {
source.push(null);
sourcep.push(false);
ioffs.push(0);
}
if (parent.document.getElementById('conduit')) { setInterval(playnotes, 100); setTimeout(fivenotfive,1000); }
return [butready('piano/Bb0.mp3'),butready('piano/Db1.mp3'),butready('piano/Eb1.mp3'),butready('piano/Gb1.mp3'),butready('piano/Ab1.mp3'),
butready('piano/Bb1.mp3'),butready('piano/Db2.mp3'),butready('piano/Eb2.mp3'),butready('piano/Gb2.mp3'),butready('piano/Ab2.mp3'),butready('piano/Bb2.mp3'),
butready('piano/Db3.mp3'),butready('piano/Eb3.mp3'),butready('piano/Gb3.mp3'),butready('piano/Ab3.mp3'),butready('piano/Bb3.mp3'),butready('piano/Db4.mp3'),
butready('piano/Eb4.mp3'),butready('piano/Gb4.mp3'),butready('piano/Ab4.mp3'),butready('piano/Bb4.mp3'),butready('piano/Db5.mp3'),butready('piano/Eb5.mp3'),
butready('piano/Gb5.mp3'),butready('piano/Ab5.mp3'),butready('piano/Bb5.mp3'),butready('piano/Db6.mp3'),butready('piano/Eb6.mp3'),butready('piano/Gb6.mp3'),
butready('piano/Ab6.mp3'),butready('piano/Bb6.mp3'),butready('piano/Db7.mp3'),butready('piano/Eb7.mp3'),butready('piano/Gb7.mp3'),butready('piano/Ab7.mp3'),
butready('piano/Bb7.mp3'),butready('piano/A0.mp3'),butready('piano/B0.mp3'),butready('piano/C1.mp3'),butready('piano/D1.mp3'),butready('piano/E1.mp3'),
butready('piano/F1.mp3'),butready('piano/G1.mp3'),butready('piano/A1.mp3'),butready('piano/B1.mp3'),butready('piano/C2.mp3'),butready('piano/D2.mp3'),
butready('piano/E2.mp3'),butready('piano/F2.mp3'),butready('piano/G2.mp3'),butready('piano/A2.mp3'),butready('piano/B2.mp3'),butready('piano/C3.mp3'),
butready('piano/D3.mp3'),butready('piano/E3.mp3'),butready('piano/F3.mp3'),butready('piano/G3.mp3'),butready('piano/A3.mp3'),butready('piano/B3.mp3'),
butready('piano/C4.mp3'),butready('piano/D4.mp3'),butready('piano/E4.mp3'),butready('piano/C5.mp3'),butready('piano/C6.mp3'),butready('piano/D6.mp3'),
butready('piano/E6.mp3'),butready('piano/F6.mp3'),butready('piano/B5.mp3'),butready('piano/A5.mp3'),butready('piano/G5.mp3'),butready('piano/F5.mp3'),
butready('piano/E5.mp3'),butready('piano/D5.mp3'),butready('piano/B4.mp3'),butready('piano/A4.mp3'),butready('piano/G4.mp3'),butready('piano/F4.mp3'),
butready('piano/G6.mp3'),butready('piano/A6.mp3'),butready('piano/B6.mp3'),butready('piano/C7.mp3'),butready('piano/D7.mp3'),butready('piano/E7.mp3'),
butready('piano/F7.mp3'),butready('piano/G7.mp3'),butready('piano/A7.mp3'),butready('piano/B7.mp3'),
];
}
}
return buffarray;
}

BufferLoader.prototype.loadBuffer = function(url, index) {
// Load buffer asynchronously
var request = new XMLHttpRequest();
request.open("GET", url, true);
request.responseType = "arraybuffer";

var loader = this;

request.onload = function() {
// Asynchronously decode the audio file data in request.response
loader.context.decodeAudioData(
request.response,
function(buffer) {
if (!buffer) {
alert('error decoding file data: ' + url);
return;
}
loader.bufferList[index] = buffer;
if (++loader.loadCount == loader.urlList.length)
loader.onload(loader.bufferList);
},
function(error) {
valtsofar=valtsofar.replace(';' + index + ';', ';' + url + ';');
for (var iij=eval(4 + eval('' + index)); iij<eval(200 * four); iij+=four) {
valtsofar=valtsofar.replace(';' + iij + ';', ';' + url + ';');
}
console.error('decodeAudioData error', error);
document.getElementById('ivideo').src=url;
}
);
}

request.onerror = function() {
alert('BufferLoader: XHR error');
}

request.send();
}

BufferLoader.prototype.load = function() {
for (var i = 0; i < this.urlList.length; ++i) {
asb.push(this.urlList[i]);
this.loadBuffer(this.urlList[i], i);
}
}

function init() { // thanks to https://www.html5rocks.com/en/tutorials/webaudio/intro/
// Fix up prefixing
// './past_quarterto.m4a',
if (!donei) {
donei=true;
document.getElementById('huhb').style.visibility='hidden';
if (document.getElementById('dlhuhb')) {
document.getElementById('dlhuhb').style.visibility='hidden';
}

window.AudioContext = window.AudioContext || window.webkitAudioContext;

if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
if (window.AudioContext) {
window.audioContext = new window.AudioContext();
}
}

context = new AudioContext();

// you should null check window.AudioContext for old browsers to not blow up

// create a dummy sound - and play it immediately in same 'thread'
if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
var oscillator = context.createOscillator();
oscillator.frequency.value = 400;
oscillator.connect(context.destination);
oscillator.start(0);
oscillator.stop(.5); // you can set this to zero, but I left it here for testing.
}


bufferLoader = new BufferLoader(
context,
vspiano([
(parent.document.getElementById('url1') ? parent.document.getElementById('url1').value : (location.search.split('url1=')[1] ? (decodeURIComponent(location.search.split('url1=')[1]).split('&')[0]) : '../PHP/macbetha1s1.m4a')),
(parent.document.getElementById('url2') ? parent.document.getElementById('url2').value : (location.search.split('url2=')[1] ? (decodeURIComponent(location.search.split('url2=')[1]).split('&')[0]) : './one_to_fiftynine.m4a')),
(parent.document.getElementById('url3') ? parent.document.getElementById('url3').value : (location.search.split('url3=')[1] ? (decodeURIComponent(location.search.split('url3=')[1]).split('&')[0]) : './am_pm.m4a')),
(parent.document.getElementById('url4') ? parent.document.getElementById('url4').value : (location.search.split('url4=')[1] ? (decodeURIComponent(location.search.split('url4=')[1]).split('&')[0]) : './past_quarterto.m4a')),
]),
finishedLoading
);

bufferLoader.load();

getideas();

setTimeout(decide, 1600);

}
}

function decide() {
if (document.getElementById('dlhuhb') && document.getElementById('dchoose')) {
var suff=' ';
if (document.getElementById('ddchoose')) {
suff+=document.getElementById('ddchoose').outerHTML;
}
if (four != 4 || actedupon) {
document.getElementById('dchoose').innerHTML='Web Audio' + suff;
} else {
document.getElementById('dchoose').innerHTML='CaseyRule' + suff;
}
}
}

function andthen() {
if (gvo) { gvo.play(); }
}

function andnotthen() {
document.getElementById('dvideo').innerHTML=dvih;
}

function startit() {
if (whichs != '') {
if (1 == 2) { eval("if (source" + eval(whichs % 400) + "p) { if (!source" + eval(whichs % 400) + ".start) { source" + eval(whichs % 400) + ".start = source" + eval(whichs % 400) + ".noteOn; } else if (1 == 6 && source" + whichs + "p) { var source" + whichs + " = context.createBufferSource(); source" + whichs + ".buffer = sb[" + eval(-1 + eval(whichs % four)) + "]; source" + whichs + ".connect(context.destination); } }"); }
}
}

function stopit() {
if (whichs != '') {
//eval("if (!source" + whichs + ".stop) { source" + whichs + ".stop = source" + whichs + ".noteOff; } else if (source" + whichs + "p) { source" + whichs + ".stop(); }");
//whichs='';
if (source_valid()) { //if (typeof source !== 'undefined') {
if (sourcep_valid()) { //if (typeof sourcep !== 'undefined') {
console.log('x ' + eval(-1 + eval(whichs)));
if (sourcep[eval(-1 + eval(whichs))]) { source[eval(-1 + eval(whichs))].stop(); }
} else {
eval(" if (source" + whichs + "p) { source[" + eval(-1 + eval(whichs)) + "].stop(); }");
}
} else {
eval(" if (source" + whichs + "p) { source" + whichs + ".stop(); }");
}
if (lastbo) {
lastbo.style.border='';
lastbo.innerHTML=lastbo.innerHTML.split(' ... ')[0];
lastbo=null;
}
}
}


function butready(inbutid) {
notebuffstuff+='<button style="display:none;" title=' + one + ' id=' + inbutid.replace('/','').replace('.','') + ' onclick="pianonoteplay(this); ">' + inbutid + '</button>';
one++;
//parent.document.title=notebuffstuff;
return inbutid;
}


function pianonoteplay(bo) {
var ioth='' + eval('' + bo.title);
var prefix="";
console.log('e');
if (!nostop) { stopit(); } else { lastbo=null; }
if (whichs == "") { whichs="" + ioth; }
whichs="" + eval(ioffs[eval(-1 + eval('' + ioth))] + eval(ioth));
if (sourcep_valid()) { //if (typeof sourcep !== 'undefined') {
//alert('' + ioth);
sourcep[eval(-1 + eval(whichs))]=true;
} else {
eval("source" + whichs + "p=true;");
}
var sendb=("(" + document.getElementById('startingin').value + "," + document.getElementById('startingat').value + ");").replace("(,)", "(0)").replace("(,", "(0,").replace(",)", ",0)");
var suffix=("(" + document.getElementById('startingin').value + "," + document.getElementById('startingat').value + ")").replace("(,)", "").replace("(0,0)", "").replace("(0,)", "").replace("(,0)", "").replace("(,", ",").replace(",)", "").trim();
if (source_valid()) { //if (typeof source !== 'undefined') {
//alert('-6:' + prevdg);
if (fors.replace('0','') != '' && fors.indexOf('-') == -1) {
//alert('-66:' + prevdg);
console.log('ea');
source[eval(-1 + eval(whichs))].start(eval('0' + document.getElementById('startingin').value), eval('0' + document.getElementById('startingat').value), eval('' + dura(document.getElementById('duration').value,lastbo).split(';')[0].split(':')[eval(-1 + dura(document.getElementById('duration').value,lastbo).split(';')[0].split(':').length)].split('.')[0].split(' ')[0]));
//source[eval(-1 + eval(whichs))].noteOn(0);
//alert('-1:' + document.getElementById('duration').value);
} else if (document.getElementById('duration').value.replace('0','') != '') {
//alert('-66:' + prevdg);
console.log('eb');
source[eval(-1 + eval(whichs))].start(eval('0' + document.getElementById('startingin').value), eval('0' + document.getElementById('startingat').value), eval('' + dura(document.getElementById('duration').value,lastbo).split(';')[0].split(':')[eval(-1 + dura(document.getElementById('duration').value,lastbo).split(';')[0].split(':').length)].split('.')[0].split(' ')[0]));
//source[eval(-1 + eval(whichs))].noteOn(0);
//alert('-1:' + document.getElementById('duration').value);
} else {
//alert('-89:' + prevdg);
//alert(bo.id + ' ... ' + bo.title + ' ... ' + eval(-1 + eval(whichs)));
console.log('ec ' + eval(-1 + eval(whichs)) + ' vs ' + source.length);
source[eval(-1 + eval(whichs))].start(eval('0' + document.getElementById('startingin').value), eval('0' + document.getElementById('startingat').value));
//source[eval(-1 + eval(whichs))].noteOn(0);
}
} else {
//alert('-77:' + sendb + ' ... ' + dura(sendb));
eval("source" + whichs + ".start" + dura(sendb,lastbo));
//eval("source" + whichs + ".noteOn(0)");
}
nostop=false;
document.getElementById('startingat').value='';
document.getElementById('startingin').value='';
document.getElementById('loop1').checked=false;
document.getElementById('loop2').checked=false;
//alert(43);
checknext();
//alert(ioth);
ioffs[eval(-1 + eval(ioth))]+=four;
//alert(5432);
ioffset=ioffs[eval(-1 + eval(ioth))];
//alert(four);
if (sourcep_valid()) { //if (typeof sourcep !== 'undefined') {
//alert(-four);
//alert('' + eval(-1 + eval(ioffset + eval(ioth))));
sourcep[eval(-1 + eval(ioffset + eval(ioth)))]=false;
} else {
eval("source" + eval(ioffset + eval(ioth)) + "p=false;");
}
//alert(42);
if (source_valid()) { //if (typeof source !== 'undefined') {
//alert(1);
source[eval(-1 + eval(ioffset + eval(ioth)))] = context.createBufferSource();
source[eval(-1 + eval(ioffset + eval(ioth)))].buffer = sb[eval(-1 + eval(ioth))];
source[eval(-1 + eval(ioffset + eval(ioth)))].connect(context.destination);
} else {
//alert(0);
eval("source" + eval(ioffset + eval(ioth)) + " = context.createBufferSource(); source" + eval(ioffset + eval(ioth)) + ".buffer = sb[" + eval(-1 + eval(ioth)) + "]; source" + eval(ioffset + eval(ioth)) + ".connect(context.destination); ");
}
console.log('ee');
}

function other(ioth, bo) {
var prefix="";
if (!nostop) { stopit(); } else { lastbo=null; }
if (whichs == "") { whichs="" + ioth; }
whichs="" + eval(ioffs[eval(-1 + eval('' + ioth))] + ioth);
if (valtsofar.indexOf(';' + eval(-1 + eval(whichs)) + ';') == -1) {
document.getElementById('ivideo').src=valtsofar.substring(1).split(';')[eval(-1 + eval(whichs))];
document.getElementById('ivideo').play();
} else {
//startit();
if (sourcep_valid()) { //if (typeof sourcep !== 'undefined') {
sourcep[eval(-1 + eval(whichs))]=true;
} else {
eval("source" + whichs + "p=true;");
}
if (document.getElementById('loop1').checked || document.getElementById('loop2').checked) {
prefix="🔁";
if (source_valid()) { //if (typeof source !== 'undefined') {
source[eval(-1 + eval(whichs))].loop=true;
} else {
eval("source" + whichs + ".loop = true;");
}
}
var sendb=("(" + document.getElementById('startingin').value + "," + document.getElementById('startingat').value + ");").replace("(,)", "(0)").replace("(,", "(0,").replace(",)", ",0)");
var suffix=("(" + document.getElementById('startingin').value + "," + document.getElementById('startingat').value + ")").replace("(,)", "").replace("(0,0)", "").replace("(0,)", "").replace("(,0)", "").replace("(,", ",").replace(",)", "").trim();
if (document.getElementById('loop1').checked || document.getElementById('loop2').checked || sendb.replace(/0/g,'').replace(/\,/g,'').replace('(','').replace(')','') != '') {
//alert(suffix.replace('(', ' @ ').replace(',', ' in ').replace(')', ' secs'));
if ((prefix + ' ' + suffix.replace('(', ' @ ').replace(',', ' in ').replace(')', ' secs')).trim() == '') {
bo.innerHTML=bo.innerHTML.split(' ... ')[0];
} else {
bo.innerHTML=bo.innerHTML.split(' ... ')[0] + ' ... ' + prefix + ' ' + suffix.replace('(', ' in ').replace(',', ' @ ').replace(')', ' secs');
}
} else if (bo.innerHTML.indexOf(' ... ') != -1) {
bo.innerHTML=bo.innerHTML.split(' ... ')[0];
}
bo.style.border='1px inset red';
if (1 == 5 && (document.getElementById('loop1').checked || document.getElementById('loop2').checked)) {
lastbo=null;
} else {
lastbo=bo;
}
//alert('-7:' + prevdg);
if (source_valid()) { //if (typeof source !== 'undefined') {
//alert('-6:' + prevdg);
if (fors.replace('0','') != '' && fors.indexOf('-') == -1) {
//alert('-66:' + prevdg);
source[eval(-1 + eval(whichs))].start(eval('0' + document.getElementById('startingin').value), eval('0' + document.getElementById('startingat').value), eval('' + dura(document.getElementById('duration').value,lastbo).split(';')[0].split(':')[eval(-1 + dura(document.getElementById('duration').value,lastbo).split(';')[0].split(':').length)].split('.')[0].split(' ')[0]));
//source[eval(-1 + eval(whichs))].noteOn(0);
//alert('-1:' + document.getElementById('duration').value);
} else if (document.getElementById('duration').value.replace('0','') != '') {
//alert('-66:' + prevdg);
source[eval(-1 + eval(whichs))].start(eval('0' + document.getElementById('startingin').value), eval('0' + document.getElementById('startingat').value), eval('' + dura(document.getElementById('duration').value,lastbo).split(';')[0].split(':')[eval(-1 + dura(document.getElementById('duration').value,lastbo).split(';')[0].split(':').length)].split('.')[0].split(' ')[0]));
//source[eval(-1 + eval(whichs))].noteOn(0);
//alert('-1:' + document.getElementById('duration').value);
} else {
//alert('-89:' + prevdg);
source[eval(-1 + eval(whichs))].start(eval('0' + document.getElementById('startingin').value), eval('0' + document.getElementById('startingat').value));
//source[eval(-1 + eval(whichs))].noteOn(0);
}
} else {
//alert('-77:' + sendb + ' ... ' + dura(sendb));
eval("source" + whichs + ".start" + dura(sendb,lastbo));
//eval("source" + whichs + ".noteOn(0)");
}
nostop=false;
document.getElementById('startingat').value='';
document.getElementById('startingin').value='';
document.getElementById('loop1').checked=false;
document.getElementById('loop2').checked=false;
checknext();
ioffs[eval(-1 + ioth)]+=four;
ioffset=ioffs[eval(-1 + ioth)];
if (sourcep_valid()) { //if (typeof sourcep !== 'undefined') {
sourcep[eval(-1 + eval(ioffset + ioth))]=false;
} else {
eval("source" + eval(ioffset + ioth) + "p=false;");
}
if (source_valid()) { //if (typeof source !== 'undefined') {
source[eval(-1 + eval(ioffset + ioth))] = context.createBufferSource();
source[eval(-1 + eval(ioffset + ioth))].buffer = sb[eval(-1 + ioth)];
source[eval(-1 + eval(ioffset + ioth))].connect(context.destination);
} else {
eval("source" + eval(ioffset + ioth) + " = context.createBufferSource(); source" + eval(ioffset + ioth) + ".buffer = sb[" + eval(-1 + ioth) + "]; source" + eval(ioffset + ioth) + ".connect(context.destination); ");
}
}
}

function macbetha1s1(vo, bo) {
var ioth=1;
var prefix="";
if (vo) { andnotthen(); gvo=document.getElementById('ivideo'); setTimeout(andthen, 500); }
if (!nostop) { stopit(); }
if (whichs == "") { whichs="1"; }
whichs="" + eval(ioffs[0] + 1);
if (valtsofar.indexOf(';' + eval(-1 + eval(whichs)) + ';') == -1) {
document.getElementById('ivideo').src=valtsofar.substring(1).split(';')[eval(-1 + eval(whichs))];
document.getElementById('ivideo').play();
} else {
//startit();
if (sourcep_valid()) { //if (typeof sourcep !== 'undefined') {
sourcep[eval(-1 + eval(whichs))]=true;
} else {
eval("source" + whichs + "p=true;");
}
if (document.getElementById('loop1').checked || document.getElementById('loop2').checked) {
prefix="🔁";
if (source_valid()) { //if (typeof source !== 'undefined') {
source[eval(-1 + eval(whichs))].loop=true;
} else {
eval("source" + whichs + ".loop = true;");
}
}
var sendb=("(" + document.getElementById('startingin').value + "," + document.getElementById('startingat').value + ");").replace("(,)", "(0)").replace("(,", "(0,").replace(",)", ",0)");
var suffix=("(" + document.getElementById('startingin').value + "," + document.getElementById('startingat').value + ")").replace("(,)", "").replace("(0,0)", "").replace("(0,)", "").replace("(,0)", "").replace("(,", ",").replace(",)", "").trim();
if (document.getElementById('loop1').checked || document.getElementById('loop2').checked || sendb.replace(/0/g,'').replace(/\,/g,'').replace('(','').replace(')','') != '') {
//alert(suffix.replace('(', ' @ ').replace(',', ' in ').replace(')', ' secs'));
if ((prefix + ' ' + suffix.replace('(', ' @ ').replace(',', ' in ').replace(')', ' secs')).trim() == '') {
bo.innerHTML=bo.innerHTML.split(' ... ')[0];
} else {
bo.innerHTML=bo.innerHTML.split(' ... ')[0] + ' ... ' + prefix + ' ' + suffix.replace('(', ' in ').replace(',', ' @ ').replace(')', ' secs');
}
} else if (bo.innerHTML.indexOf(' ... ') != -1) {
bo.innerHTML=bo.innerHTML.split(' ... ')[0];
}
bo.style.border='1px inset red';
if (1 == 5 && (document.getElementById('loop1').checked || document.getElementById('loop2').checked)) {
lastbo=null;
} else {
lastbo=bo;
}
if (source_valid()) { //if (typeof source !== 'undefined') {
if (fors.replace('0','') != '' && fors.indexOf('-') == -1) {
//alert('-66:' + prevdg);
source[eval(-1 + eval(whichs))].start(eval('0' + document.getElementById('startingin').value), eval('0' + document.getElementById('startingat').value), eval('' + dura(document.getElementById('duration').value,lastbo).split(';')[0].split(':')[eval(-1 + dura(document.getElementById('duration').value,lastbo).split(';')[0].split(':').length)].split('.')[0].split(' ')[0]));
//source[eval(-1 + eval(whichs))].noteOn(0);
//alert('-1:' + document.getElementById('duration').value);
} else if (document.getElementById('duration').value.replace('0','') != '') {
source[eval(-1 + eval(whichs))].start(eval('0' + document.getElementById('startingin').value), eval('0' + document.getElementById('startingat').value), eval('' + dura(document.getElementById('duration').value,lastbo).split(';')[0].split(':')[eval(-1 + dura(document.getElementById('duration').value,lastbo).split(';')[0].split(':').length)].split('.')[0].split(' ')[0]));
//source[eval(-1 + eval(whichs))].noteOn(0);
} else {
source[eval(-1 + eval(whichs))].start(eval('0' + document.getElementById('startingin').value), eval('0' + document.getElementById('startingat').value));
//source[eval(-1 + eval(whichs))].noteOn(0);
}
} else {
eval("source" + whichs + ".start" + dura(sendb,lastbo));
//eval("source" + whichs + ".noteOn(0)");
}
nostop=false;
document.getElementById('startingat').value='';
document.getElementById('startingin').value='';
document.getElementById('loop1').checked=false;
document.getElementById('loop2').checked=false;
checknext();
ioffs[eval(-1 + eval(eval(whichs) % four))]+=four;
ioffset=ioffs[eval(-1 + eval(eval(whichs) % four))];
if (sourcep_valid()) { //if (typeof sourcep !== 'undefined') {
sourcep[eval(-1 + eval(ioffset + ioth))]=false;
} else {
eval("source" + eval(ioffset + 1) + "p=false;");
}
if (source_valid()) { //if (typeof source !== 'undefined') {
source[eval(-1 + eval(ioffset + ioth))] = context.createBufferSource();
source[eval(-1 + eval(ioffset + ioth))].buffer = sb[eval(-1 + ioth)];
source[eval(-1 + eval(ioffset + ioth))].connect(context.destination);
} else {
eval("source" + eval(ioffset + 1) + " = context.createBufferSource(); source" + eval(ioffset + 1) + ".buffer = sb[" + eval(-1 + eval(eval(whichs) % four)) + "]; source" + eval(ioffset + 1) + ".connect(context.destination); ");
}
}
}

function fixthese() {
for (iij=0; iij<cmdfixes.length; iij++) {
//alert(cmdfixes[iij]);
eval(cmdfixes[iij]);
}
if (cmdfixes.length > 0) { cmdfixes=[]; }
}


function finishedLoading(bufferList) {
var ij=0;
//alert(sb[0]);
// Create two sources and play them both together.

if (source_valid()) { //if (typeof source !== 'undefined') {
for (var ij=0; ij<eval(-1 + five); ij++) {
source[ij] = context.createBufferSource();
//source[0] = context.createBufferSource();
//source[1] = context.createBufferSource();
//source[2] = context.createBufferSource();
//source[3] = context.createBufferSource();
source[ij].buffer = bufferList[ij];
sb.push(bufferList[ij]);
if (five != 5) {
cmdfixes.push(" document.getElementById('" + ('' + asb[ij]).replace('/','').replace('.','') + "').title='" + eval(1 + ij) + "'");
}
//source[0].buffer = bufferList[0];
//sb.push(bufferList[0]);
//source[1].buffer = bufferList[1];
//sb.push(bufferList[1]);
//source[2].buffer = bufferList[2];
//sb.push(bufferList[2]);
//source[3].buffer = bufferList[3];
//sb.push(bufferList[3]);

source[ij].connect(context.destination);
//source[0].connect(context.destination);
//source[1].connect(context.destination);
//source[2].connect(context.destination);
//source[3].connect(context.destination);
}
} else {
source1 = context.createBufferSource();
source2 = context.createBufferSource();
source3 = context.createBufferSource();
source4 = context.createBufferSource();
source1.buffer = bufferList[0];
sb.push(bufferList[0]);
source2.buffer = bufferList[1];
sb.push(bufferList[1]);
source3.buffer = bufferList[2];
sb.push(bufferList[2]);
source4.buffer = bufferList[3];
sb.push(bufferList[3]);

source1.connect(context.destination);
source2.connect(context.destination);
source3.connect(context.destination);
source4.connect(context.destination);
//if (vo) { gvo=vo; setTimeout(andthen, 500); }
//source1.start(0);
//source2.start(0);
//source3.start(0);
//source4.start(0);
}
setTimeout(fixthese,1200);
}

function getideas() {
if (parent.document.getElementById('url1')) {
document.getElementById('b1').value=parent.document.getElementById('url1').value;
} else {
document.getElementById('b1').value=(location.search.split('url1=')[1] ? (decodeURIComponent(location.search.split('url1=')[1]).split('&')[0]) : document.getElementById('b1').value);
}
if (parent.document.getElementById('url2')) {
document.getElementById('b2').value=parent.document.getElementById('url2').value;
} else {
document.getElementById('b2').value=(location.search.split('url2=')[1] ? (decodeURIComponent(location.search.split('url2=')[1]).split('&')[0]) : document.getElementById('b2').value);
}
if (parent.document.getElementById('url3')) {
document.getElementById('b3').value=parent.document.getElementById('url3').value;
} else {
document.getElementById('b3').value=(location.search.split('url3=')[1] ? (decodeURIComponent(location.search.split('url3=')[1]).split('&')[0]) : document.getElementById('b3').value);
}
if (parent.document.getElementById('url4')) {
document.getElementById('b4').value=parent.document.getElementById('url4').value;
} else {
document.getElementById('b4').value=(location.search.split('url4=')[1] ? (decodeURIComponent(location.search.split('url4=')[1]).split('&')[0]) : document.getElementById('b4').value);
}
if (parent.document.getElementById('url1')) {
document.getElementById('xb1').value=parent.document.getElementById('url1').value;
} else {
document.getElementById('xb1').value=(location.search.split('url1=')[1] ? (decodeURIComponent(location.search.split('url1=')[1]).split('&')[0]) : document.getElementById('xb1').value);
}
if (parent.document.getElementById('url2')) {
document.getElementById('xb2').value=parent.document.getElementById('url2').value;
} else {
document.getElementById('xb2').value=(location.search.split('url2=')[1] ? (decodeURIComponent(location.search.split('url2=')[1]).split('&')[0]) : document.getElementById('xb2').value);
}
if (parent.document.getElementById('url3')) {
document.getElementById('xb3').value=parent.document.getElementById('url3').value;
} else {
document.getElementById('xb3').value=(location.search.split('url3=')[1] ? (decodeURIComponent(location.search.split('url3=')[1]).split('&')[0]) : document.getElementById('xb3').value);
}
if (parent.document.getElementById('url4')) {
document.getElementById('xb4').value=parent.document.getElementById('url4').value;
} else {
document.getElementById('xb4').value=(location.search.split('url4=')[1] ? (decodeURIComponent(location.search.split('url4=')[1]).split('&')[0]) : document.getElementById('xb4').value);
}

if (parent.document.getElementById('urlv1')) {
document.getElementById('ivideo').src=parent.document.getElementById('urlv1').value;
} else {
document.getElementById('ivideo').src=(location.search.split('urlv1=')[1] ? (decodeURIComponent(location.search.split('urlv1=')[1]).split('&')[0]) : document.getElementById('ivideo').src);
}

if (parent.document.getElementById('wording1')) {
document.getElementById('b1').innerHTML=parent.document.getElementById('wording1').value;
} else {
document.getElementById('b1').innerHTML=(location.search.split('wording1=')[1] ? (decodeURIComponent(location.search.split('wording1=')[1]).split('&')[0].replace(/\+/g,' ')) : document.getElementById('b1').innerHTML);
}
if (parent.document.getElementById('wording2')) {
document.getElementById('b2').innerHTML=parent.document.getElementById('wording2').value;
} else {
document.getElementById('b2').innerHTML=(location.search.split('wording2=')[1] ? (decodeURIComponent(location.search.split('wording2=')[1]).split('&')[0].replace(/\+/g,' ')) : document.getElementById('b2').innerHTML);
}
if (parent.document.getElementById('wording3')) {
document.getElementById('b3').innerHTML=parent.document.getElementById('wording3').value;
} else {
document.getElementById('b3').innerHTML=(location.search.split('wording3=')[1] ? (decodeURIComponent(location.search.split('wording3=')[1]).split('&')[0].replace(/\+/g,' ')) : document.getElementById('b3').innerHTML);
}
if (parent.document.getElementById('wording4')) {
document.getElementById('b4').innerHTML=parent.document.getElementById('wording4').value;
} else {
document.getElementById('b4').innerHTML=(location.search.split('wording4=')[1] ? (decodeURIComponent(location.search.split('wording4=')[1]).split('&')[0].replace(/\+/g,' ')) : document.getElementById('b4').innerHTML);
}
if (parent.document.getElementById('wording1')) {
document.getElementById('xb1').innerHTML='+' + parent.document.getElementById('wording1').value;
} else {
document.getElementById('xb1').innerHTML=(location.search.split('wording1=')[1] ? ('+' + decodeURIComponent(location.search.split('wording1=')[1]).split('&')[0].replace(/\+/g,' ')) : document.getElementById('xb1').innerHTML);
}
if (parent.document.getElementById('wording2')) {
document.getElementById('xb2').innerHTML='+' + parent.document.getElementById('wording2').value;
} else {
document.getElementById('xb2').innerHTML=(location.search.split('wording2=')[1] ? ('+' + decodeURIComponent(location.search.split('wording2=')[1]).split('&')[0].replace(/\+/g,' ')) : document.getElementById('xb2').innerHTML);
}
if (parent.document.getElementById('wording3')) {
document.getElementById('xb3').innerHTML='+' + parent.document.getElementById('wording3').value;
} else {
document.getElementById('xb3').innerHTML=(location.search.split('wording3=')[1] ? ('+' + decodeURIComponent(location.search.split('wording3=')[1]).split('&')[0].replace(/\+/g,' ')) : document.getElementById('xb3').innerHTML);
}
if (parent.document.getElementById('wording4')) {
document.getElementById('xb4').innerHTML='+' + parent.document.getElementById('wording4').value;
} else {
document.getElementById('xb4').innerHTML=(location.search.split('wording4=')[1] ? ('+' + decodeURIComponent(location.search.split('wording4=')[1]).split('&')[0].replace(/\+/g,' ')) : document.getElementById('xb4').innerHTML);
}

if ((location.search.split('notoka=')[1] ? (" " + decodeURIComponent(location.search.split('notoka=')[1]).split('&')[0]) : "").length > 0) {
document.getElementById('dih').innerHTML+="<input type=hidden name=notoka value='" + notoka.trim() + "'></input>";
}

dvih=document.getElementById('dvideo').innerHTML;

var iss=document.getElementsByTagName('input');
for (var iu=0; iu<iss.length; iu++) {
if (('' + iss[iu].className).indexOf('urlv1') != -1) { wonev=iss[iu]; }
}


document.getElementById('dform').innerHTML=document.getElementById('waform').innerHTML.replace(/\ data\-id=/g, ' id=').replace(/\ onblur=/g, ' data-onblur=');

woneo=document.getElementById(wone);

var input = document.getElementById('caudio'); // .querySelector('input[type=file]'); // .getElementById('cimage'); // see Example 4

var vinput = document.getElementById('cvideo'); // .querySelector('input[type=file]'); // .getElementById('cimage'); // see Example 4

if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {

//alert(65);
document.querySelector('.readABytesButtons').addEventListener('click', function(evt) {
if (evt.target.tagName.toLowerCase() == 'button') {
var startByte = evt.target.getAttribute('data-startbyte');
var endByte = evt.target.getAttribute('data-endbyte');
readABlob(startByte, endByte);
}
}, false);
//alert(165);

document.querySelector('.readVBytesButtons').addEventListener('click', function(evt) {
if (evt.target.tagName.toLowerCase() == 'button') {
var startByte = evt.target.getAttribute('data-startbyte');
var endByte = evt.target.getAttribute('data-endbyte');
readVBlob(startByte, endByte);
}
}, false);
//alert(265);

input.addEventListener('change', function () {
document.getElementById("abut").click();
});
//alert(365);

vinput.addEventListener('change', function () {
//alert(445);
document.getElementById("vbut").click();
});
// alert(565);

input.addEventListener('click', function () {
preido(document.getElementById("abut")); //.click();
});
//alert(665);

vinput.addEventListener('click', function () {
//alert(745);
prevdo(document.getElementById("vbut")); //.click();
});

//alert(56);


} else {

input.addEventListener('change', function () {
if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) { alert('Ready?'); }
var file = input.files; //[0];
//cfile = file;

done=false;
for (var ii=0; ii<file.length; ii++) {

if (kk == 0) {
fnames=[""];
fnames[0]=file[ii].name;
} else if (ii >= fnames.length) {
fnames.push(file[ii].name);
} else {
fnames[ii]=file[ii].name;
}

ourmimetype="";
for (var ji=0; ji<exts.length; ji++) {
if (("." + file[ii].name.split('.')[eval(-1 + file[ii].name.split('.').length)]).toLowerCase() == exts[ji].toLowerCase()) {
ourmimetype=types[ji].replace('video/','audio/');
}
}

//if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) { alert('Ready?'); }
if (ourmimetype.indexOf('audio') != -1 || navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) { browseForAudio(file[ii]); }
kk++;
}
});

vinput.addEventListener('change', function () {

if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) { alert('Ready?'); }

//if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) { alert(1); }
var vfile = vinput.files; //[0];
//cfile = vfile;

//if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) { alert(2); }

done=false;
for (var ii=0; ii<vfile.length; ii++) {

//if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) { alert(ii); }
if (kk == 0) {
fnames=[""];
fnames[0]=vfile[ii].name;
} else if (ii >= fnames.length) {
fnames.push(vfile[ii].name);
} else {
fnames[ii]=vfile[ii].name;
}

ourmimetype="";
for (var ji=0; ji<exts.length; ji++) {
if (("." + vfile[ii].name.split('.')[eval(-1 + vfile[ii].name.split('.').length)]).toLowerCase() == exts[ji].toLowerCase()) {
ourmimetype=types[ji];
}
}

if (ourmimetype.indexOf('video') != -1 || navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) { browseForVideo(vfile[ii]); }
kk++;
}
});

}

var dgis=(location.search.split('durationget=')[1] ? (decodeURIComponent(location.search.split('durationget=')[1]).split('&')[0].replace(/\+/g,' ')) : '');
if (dgis == "" && parent.document.getElementById('durationget')) {
document.getElementById('duration1').value=parent.document.getElementById('durationget').value;
//alert('hereAt ' + document.getElementById('duration1').value);
if (document.getElementById('duration1').value != '') {
if (parent.document.getElementById('duration1')) { parent.document.getElementById('duration1').value=document.getElementById('duration1').value; }
predura(document.getElementById('duration1').value,document.getElementById('duration1'));
}
} else {
document.getElementById('duration1').value=(location.search.split('durationget=')[1] ? (decodeURIComponent(location.search.split('durationget=')[1]).split('&')[0].replace(/\+/g,' ')) : '');
if (document.getElementById('duration1').value != '') {
if (parent.document.getElementById('duration1')) { parent.document.getElementById('duration1').value=document.getElementById('duration1').value; }
//alert('hereat ' + document.getElementById('duration1').value);
predura(document.getElementById('duration1').value,document.getElementById('duration1'));
}
}

atonl=false;

}

function takealook(fo) {
var noneed=true;
var htmlis='';
var nsuffix='';
if (document.getElementById('url1').value.length > 500) { noneed=false; }
if (document.getElementById('url2').value.length > 500) { noneed=false; }
if (document.getElementById('url3').value.length > 500) { noneed=false; }
if (document.getElementById('url4').value.length > 500) { noneed=false; }
if (document.getElementById('durationget').value.length > 0) { nsuffix='¬oka=secret'; noneed=false; } else { isrc=' src='; }
if (source_valid()) {
if (noneed) { return true; }
if (isrc == ' srcdoc=') {
if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
document.getElementById('huhb').style.display='inline-block';
document.getElementById('diframe').innerHTML="<iframe id=myi style='opacity:1.0;position:absolute;top:0px;left:0px;z-index:-" + eval(1 + eval('0' + zi)) + ";width:100%;height:100vh;' srcdoc=></iframe>";
} else {
document.getElementById('diframe').innerHTML="<iframe id=myi style='opacity:1.0;position:absolute;top:0px;left:0px;z-index:-" + eval(1 + eval('0' + zi)) + ";width:100%;height:100vh;' srcdoc=></iframe>";
}
if (documentURL.indexOf('#') == -1) { document.getElementById('divbody').style.opacity='1.0'; }
document.getElementById('myi').srcdoc='<!doctype html><html><head>' + document.head.innerHTML.replace(/document\.URL/g,"'" + documentURL.split('#')[0].split('?')[0] + "?zi=" + eval(1 + eval('0' + zi)) + nsuffix + "¬oka=" + encodeURIComponent(notoka.trim()) + "'").replace(/\'0\.2\'/g,"'1.0'") + '</head><body>' + document.body.innerHTML.replace(/document\.URL/g,"'" + documentURL.split('#')[0].split('?')[0] + "?zi=" + eval(1 + eval('0' + zi)) + nsuffix + "¬oka=" + encodeURIComponent(notoka.trim()) + "'").replace(/\'0\.2\'/g,"'1.0'") + '</body></html>';
} else {
if (documentURL.indexOf('#') == -1) { document.getElementById('divbody').style.opacity='0.2'; }
document.getElementById('diframe').innerHTML="<iframe style='position:absolute;top:0px;left:0px;z-index:" + eval(1 + eval('0' + zi)) + ";width:100%;height:100vh;' src='" + documentURL.split('#')[0].split('?')[0] + "?zi=" + eval(1 + eval('0' + zi)) + nsuffix + "'></iframe>";
}
} else {
if (notoka.trim().toLowerCase() == 'secret') { noneed=false; }
if (noneed) { return true; }
if (isrc == ' srcdoc=') {
if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
document.getElementById('huhb').style.display='inline-block';
document.getElementById('diframe').innerHTML="<iframe id=myi style='opacity:1.0;position:absolute;top:0px;left:0px;z-index:-" + eval(1 + eval('0' + zi)) + ";width:100%;height:100vh;' srcdoc=></iframe>";
} else {
document.getElementById('diframe').innerHTML="<iframe id=myi style='opacity:1.0;position:absolute;top:0px;left:0px;z-index:-" + eval(1 + eval('0' + zi)) + ";width:100%;height:100vh;' srcdoc=></iframe>";
}
if (documentURL.indexOf('#') == -1) { document.getElementById('divbody').style.opacity='1.0'; }
document.getElementById('myi').srcdoc='<!doctype html><html><head>' + document.head.innerHTML.replace(/document\.URL/g,"'" + documentURL.split('#')[0].split('?')[0] + "?zi=" + eval(1 + eval('0' + zi)) + "¬oka=" + encodeURIComponent(notoka.trim()) + "'").replace(/\'0\.2\'/g,"'1.0'") + '</head><body>' + document.body.innerHTML.replace(/document\.URL/g,"'" + documentURL.split('#')[0].split('?')[0] + "?zi=" + eval(1 + eval('0' + zi)) + "¬oka=" + encodeURIComponent(notoka.trim()) + "'").replace(/\'0\.2\'/g,"'1.0'") + '</body></html>';
} else {
if (documentURL.indexOf('#') == -1) { document.getElementById('divbody').style.opacity='0.2'; }
document.getElementById('diframe').innerHTML="<iframe style='position:absolute;top:0px;left:0px;z-index:" + eval(1 + eval('0' + zi)) + ";width:100%;height:100vh;' src='" + documentURL.split('#')[0].split('?')[0] + "?zi=" + eval(1 + eval('0' + zi)) + "¬oka=" + encodeURIComponent(notoka.trim()) + "'></iframe>";
}
}
return false;
}

function browseForAudio(file) {
var reader = new FileReader();

reader.onloadend = function (e) {
if (e.target.readyState == FileReader.DONE) { // DONE == 2
document.getElementById(wone).value=e.target.result;
woneo.value=e.target.result;
}
};

reader.readAsDataURL(file);
}

function browseForVideo(file) {
var reader = new FileReader();

reader.onloadend = function (e) {
if (e.target.readyState == FileReader.DONE) { // DONE == 2
document.getElementById(wonev).value=e.target.result;
woneov.value=e.target.result;
}
};

reader.readAsDataURL(file);
}


function prevdo(ith) {
ith.value=null;
//if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) { if (1 == 11) { document.getElementById("vbut").style.display='inline-block'; } else { setTimeout(vdo,1200); } }
}


function readABlob(opt_startByte, opt_stopByte) {

var files = document.getElementById('caudio').files;
if (!files.length) {
alert('Please select a file!');
return;
}

mfile = files[0];
filen = mfile.name;
var start = parseInt(opt_startByte) || 0;
var stop = parseInt(opt_stopByte) || mfile.size - 1;

var reader = new FileReader();

// If we use onloadend, we need to check the readyState.
reader.onloadend = function(e) {
if (e.target.readyState == FileReader.DONE) { // DONE == 2
//alert(e.target.result);
document.getElementById(wone).value=e.target.result;
woneo.value=e.target.result;
}
};

var blob = mfile.slice(start, stop + 1);
reader.readAsDataURL(mfile); //blob);
}

function readVBlob(opt_startByte, opt_stopByte) {

var files = document.getElementById('cvideo').files;
if (!files.length) {
alert('Please select a file!');
return;
}

mfile = files[0];
filen = mfile.name;
var start = parseInt(opt_startByte) || 0;
var stop = parseInt(opt_stopByte) || mfile.size - 1;

var reader = new FileReader();

// If we use onloadend, we need to check the readyState.
reader.onloadend = function(e) {
if (e.target.readyState == FileReader.DONE) { // DONE == 2
document.getElementById(wonev).value=e.target.result;
woneov.value=e.target.result;
}
};

var blob = mfile.slice(start, stop + 1);
reader.readAsDataURL(mfile); //blob);
}

function isv(inid, inido) {
wonev='urlv1';
woneov=inido;
document.getElementById('caudio').style.display='none';
document.getElementById('cvideo').style.display='inline-block';
return inid;
}

function vora(inid, inido) {
woneo=inido;
if (inid.indexOf('v') != -1) { // video
document.getElementById('caudio').style.display='none';
document.getElementById('cvideo').style.display='inline-block';
} else{ // audio
document.getElementById('cvideo').style.display='none';
document.getElementById('caudio').style.display='inline-block';
}
return inid;
}


</script>
</head>
<body>
<div id=divbody>
<h1>HTML5 Web Audio API Usage <input id=startingat type=number value='' min=0 step=1 placeholder="Starting at [0] seconds"></input> <input id=startingin type=number value='' min=0 step=1 placeholder="Starting in [0] seconds"></input></h1>
<h3><button style='display:inline-block;background-color:red;' id=huhb ontouchstart="this.innerHTML=''; init();">Click Starts</button> RJM Programming - June, 2019 <font size=1>- Thanks to <a target=_blank href='https://www.html5rocks.com/en/tutorials/webaudio/intro/' title='Getting Started with Web Audio API'>Getting Started with Web Audio API</a></font></h3>
<table border=1 style='width:100%;'><tr style='background-color:#f7f0f0;'><td><button id=b1 onclick="macbetha1s1(document.getElementById('ivideo'), this);">Macbeth Act 1 Scene 1</button></td>
<td><button id=b2 onclick="if (gvo) { andnotthen(); } other(2, this); ">1 to 59</button></td>
<td><button id=b3 onclick="if (gvo) { andnotthen(); } other(3, this); ">AM PM</button></td>
<td><button id=b4 onclick="if (gvo) { andnotthen(); } other(4, this); ">Past Quarter To</button></td>
<td>Loop: <input type=checkbox id=loop1></input></td>
<td>Duration: <input onblur='predura(this.value,this);' type=text id=duration1 value='' title='Seconds ... optionally follow by ; sets of ButtonNumber1to4:StartingAt=[0]:StartingIn=[0]:Loop=[false]:Duration=[0]' placeholder='Seconds ... optionally follow by ; sets of ButtonNumber1to4:StartingAt=[0]:StartingIn=[0]:Loop=[false]:Duration=[0]'></input></td>
</tr><tr style='background-color:#f0f7f0;'><td><button id=xb1 onclick="nostop=true; macbetha1s1(document.getElementById('ivideo'), this);">+Macbeth Act 1 Scene 1</button></td>
<td><button id=xb2 onclick="nostop=true; if (gvo) { andnotthen(); } other(2, this); ">+1 to 59</button></td>
<td><button id=xb3 onclick="nostop=true; if (gvo) { andnotthen(); } other(3, this); ">+AM PM</button></td>
<td><button id=xb4 onclick="nostop=true; if (gvo) { andnotthen(); } other(4, this); ">+Past Quarter To</button></td>
<td>Loop: <input type=checkbox id=loop2></input></td>
<td>Duration: <input onblur='predura(this.value,this);' type=text id=duration2 value='' title='Seconds ... optionally follow by ; sets of ButtonNumber1to4:StartingAt=[0]:StartingIn=[0]:Loop=[false]:Duration=[0]' placeholder='Seconds ... optionally follow by ; sets of ButtonNumber1to4:StartingAt=[0]:StartingIn=[0]:Loop=[false]:Duration=[0]'></input></td>
</tr>
<tr style='background-color:#f0f0f7;'>
<td colspan=6><details style=width:100%;><summary>Audio Content ...</summary>
<form id=waform onsubmit='return takealook(this);' action=./web_audio.htm method=GET>
<br><input data-id=wording1 onblur="document.getElementById(this.getAttribute('data-id')).value=this.value;" style='display:inline-block;background-color:#f0f0f0;' type=text name=wording1 title='Button Wording 1' value='Macbeth Act 1 Scene 1'></input> <input onclick="wone=vora(this.getAttribute('data-id'),this);" data-id=url1 onblur="document.getElementById(this.getAttribute('data-id')).value=this.value;" style='display:inline-block;background-color:#f0f0f0;' type=text name=url1 title='Audio URL 1' value='../PHP/macbetha1s1.m4a'></input> synchronizes with  <input onclick="wonev=isv('urlv1',this);" data-id=urlv1 onblur="document.getElementById(this.getAttribute('data-id')).value=this.value;" style='display:inline-block;background-color:#f0f0f0;' type=text class=urlv1 name=urlv1 title='Video URL 1' value='../PHP/macbetha1s1.m4v'></input><br>
<input data-id=wording2 onblur="document.getElementById(this.getAttribute('data-id')).value=this.value;" style='display:inline-block;background-color:#f0f0f0;' type=text name=wording2 title='Button Wording 2' value='1 to 59'></input> <input onclick="wone=vora(this.getAttribute('data-id'),this);" data-id=url2 onblur="document.getElementById(this.getAttribute('data-id')).value=this.value;" style='display:inline-block;background-color:#f0f0f0;' type=text name=url2 title='Audio URL 2' value='./one_to_fiftynine.m4a'></input><br>
<input data-id=wording3 onblur="document.getElementById(this.getAttribute('data-id')).value=this.value;" style='display:inline-block;background-color:#f0f0f0;' type=text name=wording3 title='Button Wording 3' value='AM PM'></input> <input onclick="wone=vora(this.getAttribute('data-id'),this);" data-id=url3 onblur="document.getElementById(this.getAttribute('data-id')).value=this.value;" style='display:inline-block;background-color:#f0f0f0;' type=text name=url3 title='Audio URL 3' value='./am_pm.m4a'></input><br>
<input data-id=wording4 onblur="document.getElementById(this.getAttribute('data-id')).value=this.value;" style='display:inline-block;background-color:#f0f0f0;' type=text name=wording4 title='Button Wording 4' value='Past Quarter To'></input> <input onclick="wone=vora(this.getAttribute('data-id'),this);" data-id=url4 onblur="document.getElementById(this.getAttribute('data-id')).value=this.value;" style='display:inline-block;background-color:#f0f0f0;' type=text name=url4 title='Audio URL 4' value='./past_quarterto.m4a'></input><br>
Duration: <input style='width:90%;' data-id=durationget onblur="document.getElementById(this.getAttribute('data-id')).value=this.value;" type=text name=durationget value='' title='Seconds for first button else specify a set as per ... optionally follow by ; sets of Button1to4:StartAt=[0]:StartIn=[0]:Loop=[false]:Duration=[0] ... optionally applies at load' placeholder='Seconds for first button else specify a set as per ... optionally follow by ; sets of Button1to4:StartAt=[0]:StartIn=[0]:Loop=[false]:Duration=[0] ... optionally applies at load'></input>
<div id=dih></div><input type=submit value='Web Audio Run' style='background-color:orange;display:inline-block;'></input>  Audio: <input title='First click relevant righthand side audio field above, then reclick this button' onclick=prevdo(this); style=display:inline-block; type=file id=caudio accept=audio/* multiple><span class=readABytesButtons><button style=display:none; data-startbyte=0 data-endbyte=4>1-5</button><button style=display:none; data-startbyte=5 data-endbyte=14>6-15</button><button style=display:none; data-startbyte=6 data-endbyte=7>7-8</button><button id=abut style=background-color:pink;display:none;>Audio Process</button></span></div> Video: <input title='First click the one relevant righthand side video field above, then reclick this button' onclick=prevdo(this); style=display:inline-block; type=file id=cvideo accept=video/* multiple><span class=readVBytesButtons><button style=display:none; data-startbyte=0 data-endbyte=4>1-5</button><button style=display:none; data-startbyte=5 data-endbyte=14>6-15</button><button style=display:none; data-startbyte=6 data-endbyte=7>7-8</button><button id=vbut style=background-color:pink;display:none;>Video Process</button></span></div></form>
</details></td>
</tr>
</table><br>
<input type=text id=duration style='position:absolute;top:-200px;left:-200px;' value=''></input>
<div id=dvideo><video id=ivideo src="../PHP/macbetha1s1.m4v" controls></video></div>
<div id=dform style='display:none;'></div>
<div style='display:none;' id="byte_range"></div>
<div style='display:none;' id="byte_content"></div>
</div>
<div id=diframe></div>
<div id=dpiano></div>
<script type='text/javascript'>
if ((location.search.split('vscaseyrule=')[1] ? (' ' + decodeURIComponent(location.search.split('vscaseyrule=')[1]).split('&')[0]) : '') != '') { //navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
var hish='<div class=parent id=dchoose style="font-size:26px;position:absolute;top:0px;left:0px;z-index:2001;display:inline-block;background-color:transparent;"><input class=child placeholder="CaseyRule" title="versus Audio Web" style="position:absolute;top:0px;left:0px;z-index:2001;display:inline-block;background-color:transparent;" name=dlhuhb id=dlhuhb onchange="' + "actedupon=true; this.visibility='visible'; parent.document.getElementById('conduit').value=' '; parent.document.getElementById('cmdconduit').value=' '; document.getElementById('dchoose').innerHTML='Web Audio'; " + '" onclick="actedupon=true; parent.document.getElementById("' + "conduit" + '").value=String.fromCharCode(32); parent.document.getElementById("' + "cmdconduit" + '").value=String.fromCharCode(32); setTimeout(init,1500);" onblur="actedupon=true; parent.document.getElementById("' + "conduit" + '").value=String.fromCharCode(32); parent.document.getElementById("' + "cmdconduit" + '").value=String.fromCharCode(32); this.value=' + "'Web Audio';" + ' setTimeout(init,1800);" ontouchstart=" parent.document.getElementById("' + "conduit" + '").value=String.fromCharCode(32); parent.document.getElementById("' + "cmdconduit" + '").value=String.fromCharCode(32); setTimeout(init,500);" list="modes" name="modes"><datalist id="modes"><option value="CaseyRule"><option value="Audio Web"></datalist> <div id=ddchoose style=display:inline-block;></div></div>';
if (1 == 1 || navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
hish='<div class=parent id=dchoose style="font-weight:bold;font-size:24px;position:absolute;top:0px;left:0px;z-index:2001;display:inline-block;background-color:transparent;">CaseyRule versus <button style=font-size:22px;display:inline-block;background-color:yellow; id=dlhuhb onmousedown="' + "actedupon=true; parent.document.getElementById('conduit').value=' '; parent.document.getElementById('cmdconduit').value=' '; this.innerHTML=''; setTimeout(init,1500);" + '" ontouchstart="' + "actedupon=true; parent.document.getElementById('conduit').value=' '; parent.document.getElementById('cmdconduit').value=' '; init();" + '">Web Audio</button> <div id=ddchoose style=display:inline-block;></div></div>';
}
document.write(hish);
}
</script>
</body>
</html>