feat: core types, time, rng, model fetch
Co-Authored-By: Claude Haiku 5.5 <[email protected]>
This commit is contained in:
co-authored by
Claude Haiku 5.5
parent
0a6ec1dc40
commit
bac4fbeb1d
@@ -0,0 +1,10 @@
|
||||
import { TPQ } from "./types.ts";
|
||||
|
||||
// One quarter note = TPQ ticks.
|
||||
export function ticksToSeconds(tick: number, bpm: number): number {
|
||||
return (tick / TPQ) * (60 / bpm);
|
||||
}
|
||||
|
||||
export function secondsToTicks(s: number, bpm: number): number {
|
||||
return s * (bpm / 60) * TPQ;
|
||||
}
|
||||
Reference in New Issue
Block a user