mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-26 21:18:49 +00:00
dont round duration
This commit is contained in:
parent
42662748d3
commit
abb0b3b4c0
@ -118,7 +118,7 @@ Pattern.prototype.midi = function (output) {
|
|||||||
const velocity = hap.context?.velocity ?? 0.9; // TODO: refactor velocity
|
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
|
// 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) {
|
if (note != null) {
|
||||||
const midiNumber = typeof note === 'number' ? note : noteToMidi(note);
|
const midiNumber = typeof note === 'number' ? note : noteToMidi(note);
|
||||||
const midiNote = new Note(midiNumber, { attack: velocity, duration });
|
const midiNote = new Note(midiNumber, { attack: velocity, duration });
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user