From e8f010e0d5b51190c8e0142ee165971f950dc279 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lumi=C3=A8re=20=C3=89lev=C3=A9?= <88174309+PoneyClairDeLune@users.noreply.github.com> Date: Mon, 17 Jun 2024 09:28:53 +0000 Subject: [PATCH] `getVel()` switched to bitwise for optimization. --- src/state/index.mjs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/state/index.mjs b/src/state/index.mjs index cb03537..904391d 100644 --- a/src/state/index.mjs +++ b/src/state/index.mjs @@ -1371,8 +1371,8 @@ let OctaviaDevice = class extends CustomEventSource { let notes = new Map(); let upThis = this; upThis.#poly.forEach(function (e, i) { - let realCh = Math.floor(e / 128), - realNote = e % 128; + let realCh = e >> 7, + realNote = e & 127; if (channel == realCh && upThis.#velo[e] > 0) { notes.set(realNote, { v: upThis.#velo[e], // Short for velocity