v1.16


source

'; html = html + '

Channels'; for (var i = 0; i < song.tracks.length; i++) { var v = 100 * song.tracks[i].volume; html = html + '

' + chooserIns(song.tracks[i].id, i) + ''; } html = html + '

Drums'; for (var i = 0; i < song.beats.length; i++) { var v = 100 * song.beats[i].volume; html = html + '

' + chooserDrum(song.beats[i].id, i) + ''; } o.innerHTML = html; console.log('Loaded'); var pos = document.getElementById('position'); pos.oninput = function (e) { if (loadedsong) { player.cancelQueue(audioContext); var next = song.duration * pos.value / 100; songStart = songStart - (next - currentSongTime); currentSongTime = next; } }; console.log('Tracks'); for (var i = 0; i < song.tracks.length; i++) { setVolumeAction(i, song); } console.log('Drums'); for (var i = 0; i < song.beats.length; i++) { setDrVolAction(i, song); } loadedsong = song; } function setVolumeAction(i, song) { var vlm = document.getElementById('channel' + i); vlm.oninput = function (e) { player.cancelQueue(audioContext); var v = vlm.value / 100; if (v < 0.000001) { v = 0.000001; } song.tracks[i].volume = v; }; var sl = document.getElementById('selins' + i); sl.onchange = function (e) { var nn = sl.value; var info = player.loader.instrumentInfo(nn); player.loader.startLoad(audioContext, info.url, info.variable); player.loader.waitLoad(function () { console.log('loaded'); song.tracks[i].info = info; song.tracks[i].id = nn; }); }; } function setDrVolAction(i, song) { var vlm = document.getElementById('drum' + i); vlm.oninput = function (e) { player.cancelQueue(audioContext); var v = vlm.value / 100; if (v < 0.000001) { v = 0.000001; } song.beats[i].volume = v; }; var sl = document.getElementById('seldrm' + i); sl.onchange = function (e) { var nn = sl.value; var info = player.loader.drumInfo(nn); player.loader.startLoad(audioContext, info.url, info.variable); player.loader.waitLoad(function () { console.log('loaded'); song.beats[i].info = info; song.beats[i].id = nn; }); }; } function chooserIns(n, track) { var html = ''; for (var i = 0; i < player.loader.drumKeys().length; i++) { var sel = ''; if (i == n) { sel = ' selected'; } html = html + '