Merge pull request #1004 from tidalcycles/worker-repl

eliminate chromium clock jitter
This commit is contained in:
Felix Roos 2024-03-23 20:21:51 +01:00 committed by GitHub
commit 31067d5cb5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 498 additions and 51 deletions

View file

@ -260,7 +260,7 @@ export function resetGlobalEffects() {
analysersData = {};
}
export const superdough = async (value, deadline, hapDuration) => {
export const superdough = async (value, t, hapDuration) => {
const ac = getAudioContext();
if (typeof value !== 'object') {
throw new Error(
@ -272,7 +272,7 @@ export const superdough = async (value, deadline, hapDuration) => {
// duration is passed as value too..
value.duration = hapDuration;
// calculate absolute time
let t = ac.currentTime + deadline;
t = typeof t === 'string' && t.startsWith('=') ? Number(t.slice(1)) : ac.currentTime + t;
// destructure
let {
s = 'triangle',