Merge pull request #1160 from daslyfe/audio_target_selector
Create audio target selector for OSC/Superdirt
This commit is contained in:
commit
d95b8bc667
12 changed files with 221 additions and 142 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue