From 5391f3f028a70db574af55aec27f32da3b41bed6 Mon Sep 17 00:00:00 2001 From: harmse Date: Wed, 24 Oct 2018 10:43:49 -0400 Subject: [PATCH] update midi keyboard to fix octave issue --- static/src/keyboard/Midi.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/static/src/keyboard/Midi.js b/static/src/keyboard/Midi.js index a0055c0..a3a8742 100644 --- a/static/src/keyboard/Midi.js +++ b/static/src/keyboard/Midi.js @@ -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) }