Merge pull request #1160 from daslyfe/audio_target_selector

Create audio target selector for OSC/Superdirt
This commit is contained in:
Jade (Rose) Rowland 2024-09-01 10:02:24 -04:00 committed by GitHub
commit d95b8bc667
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 221 additions and 142 deletions

View file

@ -370,7 +370,7 @@ export function cycleToSeconds(cycle, cps) {
// utility for averaging two clocks together to account for drift
export class ClockCollator {
constructor({
getTargetClockTime = () => Date.now() * 0.001,
getTargetClockTime = getUnixTimeSeconds,
weight = 16,
offsetDelta = 0.005,
checkAfterTime = 2,
@ -426,6 +426,14 @@ export class ClockCollator {
}
}
export function getPerformanceTimeSeconds() {
return performance.now() * 0.001;
}
function getUnixTimeSeconds() {
return Date.now() * 0.001;
}
// Floating point versions, see Fraction for rational versions
// // greatest common divisor
// export const gcd = function (x, y, ...z) {