<commit_before><!DOCTYPE HTML>
<html>
	<head>
		<!--<script src="src/modfile.js"></script>
		<script src="src/modplayer.js"></script>-->
		<script src="src/swfobject.js"></script>
		<script src="build.js"></script>
		<script src="src/dynamicaudio.js"></script>
		<style>
			p { margin-top: 8px; margin-bottom: 8px}
		</style>
		
		<script>
			var modPlayer;
			var dynamicAudio;
			
			function init() {
				dynamicAudio = new DynamicAudio({'swf': 'dynamicaudio.swf'});
				status('Not playing');
			}
			
			var playing = false;
			var bufferSeconds = 5; /* don't buffer too much or it will sputter doing the work */
			var bufferLength = 44100 * 2 * bufferSeconds;
			function play() {
				playing = true;
				status('Playing');
				bufferMoreData();
			}
			
			function bufferMoreData() {
				if (playing) {
					dynamicAudio.write(modPlayer.getSamples(bufferLength));
					setTimeout(bufferMoreData, 100);
				}
			}
			
			function pause() {
				playing = false;
				status('Paused');
			}

			function status(text) {
				document.getElementById('status').innerHTML = "<b>Status</b>: " + text + ".";
			}

			function loadRemote(path) {
				var fetch = new XMLHttpRequest();
				fetch.open('GET', path);
				fetch.overrideMimeType("text/plain; charset=x-user-defined");
				fetch.onreadystatechange = function() {
					if(this.readyState == 4 && this.status == 200) {
						/* munge response into a binary string */
						var t = this.responseText || "" ;
						var ff = [];
						var mx = t.length;
						var scc= String.fromCharCode;
						for (var z = 0; z < mx; z++) {
							ff[z] = scc(t.charCodeAt(z) & 255);
						}
						var binString = ff.join("");
						
						var modFile = new ModFile(binString);
						modPlayer = new ModPlayer(modFile, 44100);
						play();
					}
				}
				status('Loading...');
				fetch.send();
			}
		</script>
	</head>
	<body onload="init()">
		<h1>mod.js</h1>
		<p>Javascript MOD player using Aurora.js (eventually).</p>
		<p>This is a work in progress - not all effects are implemented yet.</p>
		<p>Refresh the page to stop audio, or click 'Stop' and wait for a while - no working playback controls yet.</p>
    <p><a href="javascript:play();">Play</a> | <a href="javascript:pause();">Paused</a></p>
    <div id="status"></div>
		<ul>
			<li><a href="javascript:loadRemote('mods/ambpower.mod')">Ambient Power (Vogue / Triton)</a></li><commit_msg>Sputtering seems less extreme. Hopefully moving to Aurora will fix it entirely.<commit_after><!DOCTYPE HTML>
<html>
	<head>
		<!--<script src="src/modfile.js"></script>
		<script src="src/modplayer.js"></script>-->
		<script src="src/swfobject.js"></script>
		<script src="build.js"></script>
		<script src="src/dynamicaudio.js"></script>
		<style>
			p { margin-top: 8px; margin-bottom: 8px}
		</style>
		
		<script>
			var modPlayer;
			var dynamicAudio;
			
			function init() {
				dynamicAudio = new DynamicAudio({'swf': 'dynamicaudio.swf'});
				status('Not playing');
			}
			
			var playing = false;
			var bufferSeconds = 2; /* don't buffer too much or it will sputter doing the work */
			var bufferLength = 44100 * 2 * bufferSeconds;
			function play() {
				playing = true;
				status('Playing');
				bufferMoreData();
			}
			
			function bufferMoreData() {
				if (playing) {
					dynamicAudio.write(modPlayer.getSamples(bufferLength));
					setTimeout(bufferMoreData, 100);
				}
			}
			
			function pause() {
				playing = false;
				status('Paused');
			}

			function status(text) {
				document.getElementById('status').innerHTML = "<b>Status</b>: " + text + ".";
			}

			function loadRemote(path) {
				var fetch = new XMLHttpRequest();
				fetch.open('GET', path);
				fetch.overrideMimeType("text/plain; charset=x-user-defined");
				fetch.onreadystatechange = function() {
					if(this.readyState == 4 && this.status == 200) {
						/* munge response into a binary string */
						var t = this.responseText || "" ;
						var ff = [];
						var mx = t.length;
						var scc= String.fromCharCode;
						for (var z = 0; z < mx; z++) {
							ff[z] = scc(t.charCodeAt(z) & 255);
						}
						var binString = ff.join("");
						
						var modFile = new ModFile(binString);
						modPlayer = new ModPlayer(modFile, 44100);
						play();
					}
				}
				status('Loading...');
				fetch.send();
			}
		</script>
	</head>
	<body onload="init()">
		<h1>mod.js</h1>
		<p>Javascript MOD player using Aurora.js (eventually).</p>
		<p>This is a work in progress - not all effects are implemented yet.</p>
		<p>Refresh the page to stop audio, or click 'Stop' and wait for a while - no working playback controls yet.</p>
    <p><a href="javascript:play();">Play</a> | <a href="javascript:pause();">Pause</a></p>
    <div id="status"></div>
		<ul>
			<li><a href="javascript:loadRemote('mods/ambpower.mod')">Ambient Power (Vogue / Triton)</a></li>
{'fraction_non_alphanumeric': 0.16910703237780986, 'fraction_numerical': 0.011136316766343576, 'mean_word_length': 2.9559543230016314, 'pattern_counts': {'":': 0, '<': 91, '<?xml version=': 0, '>': 89, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '567421', 'n_tokens_mistral': 2080, 'n_tokens_neox': 1591, 'n_words': 390}