DIR : /home/kozerus/public_html/jkwii/js/jsdoit/gosnd/index.js
/home/kozerus/public_html/jkwii/js/jsdoit/gosnd
var count = 0;
var synth = T("+", T("sin", 0), T("sin", 0), T("sin", 0), T("sin", 0), T("sin", 0), T("sin", 0), T("sin", 0), T("sin", 0), T("sin", 0), T("sin", 0), T("sin", 0), T("sin", 0), T("sin", 0), T("sin", 0), T("sin", 0), T("sin", 0)).set({
mul : 0.25
});
var track1 = [932, 830, 739, 622, 554, 466, 415, 369, 311, 277, 233, 207, 184, 155, 138, 116];
var timer = T("interval", 200, function() {
for ( i = 0; i < 16; i++) {
for ( j = 0; j < 16; j++) {
var notes = document.getElementById("notes");
var noteline = notes.childNodes[i];
var note = noteline.childNodes[j];
if (note.column == count) {
note.style.margin = "0px 0px 0px 0px";
note.style.width = "26px";
note.style.height = "26px";
if (note.aru) {
synth.args[i].freq.value = track1[i];
} else {
synth.args[i].freq.value = 0;
}
var nl;
if (j) {
nl = noteline.childNodes[j - 1];
} else {
nl = noteline.childNodes[15];
}
nl.style.margin = "2px 2px 2px 2px";
nl.style.width = "22px";
nl.style.height = "22px";
}
}
}
count++;
if (count == 16)
count = 0;
synth.bang();
});
window.onload = function() {
synth.play();
for ( i = 0; i < 16; i++) {
var noteline = document.createElement("div");
noteline.className = "noteline";
for ( j = 0; j < 16; j++) {
var note = document.createElement("div");
note.className = "note";
note.aru = 0;
note.column = j;
note.line = i;
note.addEventListener("mousedown", clickNote(note), false);
noteline.appendChild(note);
}
document.getElementById("notes").insertBefore(noteline, document.getElementById("notes").childNodes.item(0));
}
};
function clickNote(note) {
return function() {
if (note.aru) {
note.aru = 0;
note.className = "note";
} else {
note.aru = 1;
note.className = "note2";
}
};
}
synth.onplay = function() {
timer.on();
};
synth.onpause = function() {
timer.off();
};
//
koh5_pano
Drag mouse to navigate.
Navigation
- Left/Right Mouse drag: Changes camera heading.
- Up/Sown Mouse drag: Changes camera pitch.
- Scroll wheel: Changes camera field of view.
- I-Key: Displays Info panel with canvas size, image size and FPS.
17.Aug.2010, Martin Wengenmayer