update midi keyboard to fix octave issue

This commit is contained in:
harmse 2018-10-24 10:43:49 -04:00
parent cb63c392ae
commit 5391f3f028

View File

@ -48,14 +48,14 @@ class Midi extends events.EventEmitter{
})
inputDevice.addListener('noteon', 'all', (event) => {
try {
this.emit('keyDown', event.note.number)
this.emit('keyDown', event.note.number + 12)
} catch(e){
console.warn(e)
}
})
inputDevice.addListener('noteoff', 'all', (event) => {
try {
this.emit('keyUp', event.note.number)
this.emit('keyUp', event.note.number + 12)
} catch(e){
console.warn(e)
}