From abb0b3b4c03fb3999279e396b4283c1cbbbc1cd9 Mon Sep 17 00:00:00 2001 From: Jade Rowland Date: Sat, 19 Aug 2023 15:09:46 -0400 Subject: [PATCH] dont round duration --- packages/midi/midi.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/midi/midi.mjs b/packages/midi/midi.mjs index 44b8ae2e..dea3be7a 100644 --- a/packages/midi/midi.mjs +++ b/packages/midi/midi.mjs @@ -118,7 +118,7 @@ Pattern.prototype.midi = function (output) { const velocity = hap.context?.velocity ?? 0.9; // TODO: refactor velocity // note off messages will often a few ms arrive late, try to prevent glitching by subtracting from the duration length - const duration = Math.round(hap.duration.valueOf() * 1000 - 10); + const duration = hap.duration.valueOf() * 1000 - 10; if (note != null) { const midiNumber = typeof note === 'number' ? note : noteToMidi(note); const midiNote = new Note(midiNumber, { attack: velocity, duration });