Compare commits
2 Commits
761a33e540
...
42eb01257b
Author | SHA1 | Date | |
---|---|---|---|
42eb01257b | |||
c13ba1839d |
@ -678,28 +678,22 @@ class Networker {
|
|||||||
let key = dv.getUint8(1);
|
let key = dv.getUint8(1);
|
||||||
let velocity = dv.getUint8(2) / 255;
|
let velocity = dv.getUint8(2) / 255;
|
||||||
let id = dv.getUint8(3);
|
let id = dv.getUint8(3);
|
||||||
if (id != this.id) {
|
|
||||||
piano.keyDown(key, velocity, id);
|
piano.keyDown(key, velocity, id);
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 1: { // Key up
|
case 1: { // Key up
|
||||||
let key = dv.getUint8(1);
|
let key = dv.getUint8(1);
|
||||||
let sustain = dv.getUint8(2);
|
let sustain = dv.getUint8(2);
|
||||||
let id = dv.getUint8(3);
|
let id = dv.getUint8(3);
|
||||||
if (id != this.id) {
|
|
||||||
piano.keyUp(key, sustain, id);
|
piano.keyUp(key, sustain, id);
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 2: { // Sustain release
|
case 2: { // Sustain release
|
||||||
let id = dv.getUint8(1);
|
let id = dv.getUint8(1);
|
||||||
if (id != this.id) {
|
|
||||||
piano.releaseSustain(id);
|
piano.releaseSustain(id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
keyDown(key, velocity) {
|
keyDown(key, velocity) {
|
||||||
let buffer = new ArrayBuffer(3);
|
let buffer = new ArrayBuffer(3);
|
||||||
|
Loading…
Reference in New Issue
Block a user