-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
83 lines (74 loc) · 3.21 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<!DOCTYPE html>
<html>
<head>
<title>Virus TI Snow - Program Change Calculator<></title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<style>
html {
font-family: Helvetica;
padding: 1em 3em;
}
form {
background-color: #F6F6F6;
padding: 1em;
margin: 1em auto;
display: inline-block;
}
</style>
<script>
$(document).ready( function() {
display_result();
$("input").change( function () {
display_result();
});
});
function display_result() {
var bank = $('input:radio[name=bank]:checked').val();
var page = $('input:radio[name=page]:checked').val();
var preset = $('input:radio[name=preset]:checked').val();
var first = ( $('#config-from-one').is(':checked') ) ? 1 : 0;
var bank_select = Math.floor(bank/2 + first);
var program_change = (bank%2)*64 + page*8 + preset*1 + first;
$("#result").html(
"Bank Select (CC#32): " + bank_select +
"<br/>" +
"Program Change: " + program_change );
};
</script>
</head>
<body>
<h1>Virus TI Snow<br><small>Program Change Calculator</small></h1>
<form>
<label><input type='radio' name='bank' value='0'></input></label>
<label><input type='radio' name='bank' value='1'></input></label>
<label><input type='radio' name='bank' value='2'></input></label>
<label><input type='radio' name='bank' value='3'></input></label>
<label><input type='radio' name='bank' value='4'></input></label>
<label><input type='radio' name='bank' value='5'></input></label>
<label><input type='radio' name='bank' value='6'></input></label>
<label><input type='radio' name='bank' value='7'></input></label>
<hr/>
<label><input type='radio' name='page' value='0'></input></label>
<label><input type='radio' name='page' value='1'></input></label>
<label><input type='radio' name='page' value='2'></input></label>
<label><input type='radio' name='page' value='3'></input></label>
<label><input type='radio' name='page' value='4'></input></label>
<label><input type='radio' name='page' value='5'></input></label>
<label><input type='radio' name='page' value='6'></input></label>
<label><input type='radio' name='page' value='7'></input></label>
<br/>
<label><input type='radio' name='preset' value='0'></input></label>
<label><input type='radio' name='preset' value='1'></input></label>
<label><input type='radio' name='preset' value='2'></input></label>
<label><input type='radio' name='preset' value='3'></input></label>
<label><input type='radio' name='preset' value='4'></input></label>
<label><input type='radio' name='preset' value='5'></input></label>
<label><input type='radio' name='preset' value='6'></input></label>
<label><input type='radio' name='preset' value='7'></input></label>
</form>
<p id=result></p>
<h3>Configuration:</h3>
<label><input type='checkbox' id='config-from-one'></input> MIDI values should start from one (instead of zero).</label>
</body>
</html>