From 851e0e4a995fab5cfe90c098a56a0e85c803ff63 Mon Sep 17 00:00:00 2001 From: Sema Date: Thu, 1 Feb 2024 00:31:24 -0500 Subject: [PATCH] MIDI.to32b() --- javascript/JZZ.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/javascript/JZZ.js b/javascript/JZZ.js index 8148645..8296970 100644 --- a/javascript/JZZ.js +++ b/javascript/JZZ.js @@ -1678,6 +1678,10 @@ x = (Math.floor(x) << 14) + MIDI.to14b(x - Math.floor(x)); return x < 0x1fffff ? x : 0x1ffffe; }; + MIDI.to32b = function(x) { + _float(x); + return x <= 0 ? 0 : x >= 1 ? 0xffffffff : Math.floor(x * 0x100000000); + }; function _MIDI() {} _MIDI.prototype = MIDI; MIDI._sxid = 0x7f;