<commit_before><!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>MiDeanMartin : Midi capture</title>

	<style>
		body{
			background-image: url("../img/dean_martin.jpg");
			background-size: cover;
			font-family: Arial, sans-serif;
		}

		div{
			width: 40px;
			height: 80px;
			background-color: rgba(255,0,0,.3);
			border-radius: 1%;
			color: #fff;
			text-align: center;
			line-height: 40px;
			float: left;
			margin-left: 10px;
		}

		.value{
			color: #000;
			font: bold;
			display: block;
		}
	</style>
</head>
<body>
	<script src="../src/mdm.js"></script>
	<script>

		/* This exeemple capture all incoming midi message and display them on screen.
		Very good to map some new midi devices */
		
		console.log('GO Dean '+mdm.VERSION+' !');

		var controls = {};

		function get_message(capture){

			var midi = capture.message,
				name = "c"+midi.note;

			// new one
			
			if(typeof controls[name] == 'undefined'){				
				document.body.innerHTML += '<div id="'+name+'"><span>'+midi.note+'</span><span class="value"></span></div>';
				console.log('x');
			}

			// value
			// 
			controls[name] = midi.velocity;
			document.querySelector('#'+name+'>.value').innerHTML = controls[name];

		}

		mdm.ready(function(){		
			mdm.capture(get_message);
		});
	</script>
</body>
</html><commit_msg>capture demo: prepare code generation<commit_after><!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>MiDeanMartin : Midi capture</title>

	<style>
		body{
			background-image: url("../img/dean_martin.jpg");
			background-size: cover;
			font-family: Arial, sans-serif;
		}

		div{
			width: 40px;
			height: 80px;
			background-color: rgba(255,0,0,.3);
			border-radius: 1%;
			color: #fff;
			text-align: center;
			line-height: 40px;
			float: left;
			margin-left: 10px;
		}

		.value{
			color: #000;
			font: bold;
			display: block;
		}
	</style>
</head>
<body>
	<button id="bt_get">Get javascript mapping code</button>
	<script src="../src/mdm.js"></script>
	<script>

		/* This exeemple capture all incoming midi message and display them on screen.
		Very good to map some new midi devices */
		
		console.log('GO Dean '+mdm.VERSION+' !');

		var controls = {},
			code = "mdm.map('MIDIIN3 (ReMOTE ZeRO SL)')";
			device = null;

		function get_message(capture){

			var midi 	= capture.message,
				name 	= "c"+midi.note;
			device 		= capture.device.name;

			// new one
			
			if(typeof controls[name] == 'undefined'){				
				document.body.innerHTML += '<div id="'+name+'"><span>'+midi.note+'</span><span class="value"></span></div>';
				
				code += ".control("+name+").to(function(value){
					// action
				})\n";
			}

			// value
			// 
			controls[name] = midi.velocity;
			document.querySelector('#'+name+'>.value').innerHTML = controls[name];
		}

		function get_result(){
			code = "mdm.map('"+device+"')"+code+".start();";
			alert(code);
		}

		document.getElementById("bt_get").addEventListener("click", get_result);

		mdm.ready(function(){		
			mdm.capture(get_message);
		});
	</script>
</body>
</html>
{'fraction_non_alphanumeric': 0.1893644617380026, 'fraction_numerical': 0.01264591439688716, 'mean_word_length': 3.208731241473397, 'pattern_counts': {'":': 0, '<': 49, '<?xml version=': 0, '>': 51, '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': '6238286', 'n_tokens_mistral': 1356, 'n_tokens_neox': 1104, 'n_words': 233}