Skip to content

Commit

Permalink
Test page - in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
jazz-soft committed Jun 28, 2024
1 parent 2835265 commit 498c39d
Showing 1 changed file with 43 additions and 2 deletions.
45 changes: 43 additions & 2 deletions test.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ <h1>JZZ.midi.GM</h1>
<select id="msb"></select>
<label for="lsb">Bank LSB:</label>
<select id="lsb"></select>
<label for="program">Program:</label>
<select id="program"></select>
<label for="prog">Program:</label>
<select id="prog"></select>
</p>
<p id="piano"></p>

Expand All @@ -37,6 +37,47 @@ <h1>JZZ.midi.GM</h1>
var piano = JZZ.input.Kbd({at: 'piano'});
piano.connect(midiout);
midiout.select();

var mySystem, myMsb, myLsb, myProg;
var system = document.getElementById('system');
var msb = document.getElementById('msb');
var lsb = document.getElementById('lsb');
var prog = document.getElementById('prog');
system.addEventListener("change", onSystem);
onSystem();

function onSystem() {
var i;
mySystem = system.value;
if (mySystem == 'GM') {
myMsb = undefined;
myLsb = undefined;
myProg = 0;
clear(msb);
clear(lsb);
clear(prog);
add(msb, 0, '00', true);
add(lsb, 0, '00', true);
for (i = 0; i < 128; i++) add(prog, i, i.toString(16).padStart(2, '0') + ' ' + JZZ.MIDI.programName(i));
}
else {
}
}

function clear(sel) {
for (var i = sel.options.length; i > 0; i--) sel.remove(i - 1);
}
function add(sel, val, txt, dis) {
var opt = document.createElement('option');
opt.value = val;
opt.innerHTML = txt;
opt.disabled = !!dis;
sel.appendChild(opt);
}
//console.log(JZZ.MIDI.GM.allGM2());
//console.log(JZZ.MIDI.GM.allGS());
//console.log(JZZ.MIDI.GM.allXG());

--></script>

<p>
Expand Down

0 comments on commit 498c39d

Please sign in to comment.