mirror of
https://github.com/eliasstepanik/strudel.git
synced 2026-01-11 21:58:37 +00:00
16 lines
544 B
JavaScript
16 lines
544 B
JavaScript
import { getDrawContext } from '@strudel.cycles/core';
|
|
|
|
export async function initHydra() {
|
|
if (!document.getElementById('hydra-canvas')) {
|
|
const { canvas: testCanvas } = getDrawContext();
|
|
await import('https://unpkg.com/hydra-synth');
|
|
const hydraCanvas = testCanvas.cloneNode(true);
|
|
hydraCanvas.id = 'hydra-canvas';
|
|
testCanvas.after(hydraCanvas);
|
|
new Hydra({ canvas: hydraCanvas, detectAudio: false });
|
|
s0.init({ src: testCanvas });
|
|
}
|
|
}
|
|
|
|
export const H = (p) => () => p.queryArc(getTime(), getTime())[0].value;
|