diff --git a/src/common/measure/mbt.ts b/src/common/measure/mbt.ts index db8b000bd..5a5448cb2 100644 --- a/src/common/measure/mbt.ts +++ b/src/common/measure/mbt.ts @@ -23,7 +23,7 @@ const getMBT = ( } const pad = (v: number, digit: number) => { - const str = v.toString(10) + const str = v.toFixed(0) return ("0".repeat(digit) + str).slice(-Math.max(digit, str.length)) } diff --git a/src/common/player/EventScheduler.test.ts b/src/common/player/EventScheduler.test.ts index f5a68e13c..582a3b1aa 100644 --- a/src/common/player/EventScheduler.test.ts +++ b/src/common/player/EventScheduler.test.ts @@ -17,6 +17,7 @@ describe("EventScheduler", () => { { const result = s.readNextEvents(120, 0) expect(result.length).toBe(1) + expect(result[0].timestamp).toBe(0) expect(result[0].event).toBe(events[0]) } diff --git a/src/common/player/EventScheduler.ts b/src/common/player/EventScheduler.ts index c8f88700a..d4ecd3df8 100644 --- a/src/common/player/EventScheduler.ts +++ b/src/common/player/EventScheduler.ts @@ -90,13 +90,11 @@ export default class EventScheduler { } const delta = timestamp - this._prevTime const deltaTick = Math.max(0, this.millisecToTick(delta, bpm)) - const nowTick = Math.floor(this._currentTick + deltaTick) + const nowTick = this._currentTick + deltaTick // 先読み時間 // Leading time - const lookAheadTick = Math.floor( - this.millisecToTick(this.lookAheadTime, bpm), - ) + const lookAheadTick = this.millisecToTick(this.lookAheadTime, bpm) // 前回スケジュール済みの時点から、 // From the previous scheduled point, diff --git a/src/main/components/PianoRoll/CanvasPianoRuler.tsx b/src/main/components/PianoRoll/CanvasPianoRuler.tsx index 6c02b4de0..618ccc01d 100644 --- a/src/main/components/PianoRoll/CanvasPianoRuler.tsx +++ b/src/main/components/PianoRoll/CanvasPianoRuler.tsx @@ -49,7 +49,7 @@ function drawRuler( ctx.textBaseline = "top" ctx.font = `12px ${theme.canvasFont}` ctx.fillStyle = theme.secondaryTextColor - ctx.fillText(`${measure}`, x + textPadding, textPadding) + ctx.fillText(`${measure + 1}`, x + textPadding, textPadding) } })