mirror of
https://codeberg.org/uzu/strudel
synced 2026-07-31 00:34:25 -04:00
round duration down
This commit is contained in:
@@ -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 = hap.duration.valueOf() * 1000 - 10;
|
||||
const duration = Math.floor(hap.duration.valueOf() * 1000 - 10);
|
||||
if (note != null) {
|
||||
const midiNumber = typeof note === 'number' ? note : noteToMidi(note);
|
||||
const midiNote = new Note(midiNumber, { attack: velocity, duration });
|
||||
|
||||
Reference in New Issue
Block a user