How to caculate "tick" properly?
humbleCoder1990 opened this issue · comments
humbleCoder1990 commented
I tried to make 1 bar with 16 notes.
So, I caculated durationTick like this.
const duration = 1920 / 16 /* 1920 ticks are 1 bar */
then,
const startTick = duration * noteIndex
But the result is almost 4 bars like the screenshot.
What are I missing something?
How to caculate ticks properly?
MidiWriterJS uses another value for meaning 1 bar of ticks?
humbleCoder1990 commented
Wow I just saw another post #58,
128 ticks for per beat.
It's very confusing.
Garrett Grimm commented
Hi @humbleCoder1990,
That's correct, there are 128 ticks per beat. That's how it's specified in MIDI 🤷♂️