mirror of
https://codeberg.org/uzu/strudel
synced 2026-09-05 14:58:03 -04:00
also pull in audio init to prebake
This commit is contained in:
@@ -1,15 +1,13 @@
|
||||
import { evalScope, controls, noteToMidi } from '@strudel.cycles/core';
|
||||
import { initAudioOnFirstClick } from '@strudel.cycles/webaudio';
|
||||
import { noteToMidi } from '@strudel.cycles/core';
|
||||
import { useEffect, useState } from 'react';
|
||||
import { prebake } from '../repl/prebake';
|
||||
import { themes, settings } from '../repl/themes.mjs';
|
||||
import { themes } from '../repl/themes.mjs';
|
||||
import './MiniRepl.css';
|
||||
import { useSettings } from '../settings.mjs';
|
||||
import Claviature from '@components/Claviature';
|
||||
|
||||
let init;
|
||||
if (typeof window !== 'undefined') {
|
||||
initAudioOnFirstClick();
|
||||
init = prebake();
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ This program is free software: you can redistribute it and/or modify it under th
|
||||
|
||||
import { cleanupDraw, cleanupUi, getDrawContext, logger } from '@strudel.cycles/core';
|
||||
import { CodeMirror, cx, flash, useHighlighting, useStrudel, useKeydown } from '@strudel.cycles/react';
|
||||
import { getAudioContext, initAudioOnFirstClick, resetLoadedSounds, webaudioOutput } from '@strudel.cycles/webaudio';
|
||||
import { getAudioContext, resetLoadedSounds, webaudioOutput } from '@strudel.cycles/webaudio';
|
||||
import { createClient } from '@supabase/supabase-js';
|
||||
import { nanoid } from 'nanoid';
|
||||
import React, { createContext, useCallback, useEffect, useState, useMemo } from 'react';
|
||||
@@ -26,8 +26,6 @@ import { writeText } from '@tauri-apps/api/clipboard';
|
||||
|
||||
const { latestCode } = settingsMap.get();
|
||||
|
||||
initAudioOnFirstClick();
|
||||
|
||||
// Create a single supabase client for interacting with your database
|
||||
const supabase = createClient(
|
||||
'https://pidxdsxphlhzjnzmifth.supabase.co',
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
import { Pattern, noteToMidi, valueToMidi, controls, evalScope } from '@strudel.cycles/core';
|
||||
import { registerSynthSounds, registerZZFXSounds, samples } from '@strudel.cycles/webaudio';
|
||||
import { initAudioOnFirstClick, registerSynthSounds, registerZZFXSounds, samples } from '@strudel.cycles/webaudio';
|
||||
import './piano.mjs';
|
||||
import './files.mjs';
|
||||
import { isTauri } from '../tauri.mjs';
|
||||
import { settingPatterns } from '../settings.mjs';
|
||||
|
||||
export async function prebake() {
|
||||
const initAudio = initAudioOnFirstClick();
|
||||
// lazy load modules
|
||||
let modules = [
|
||||
import('@strudel.cycles/core'),
|
||||
@@ -36,6 +37,7 @@ export async function prebake() {
|
||||
);
|
||||
// register sounds and samples
|
||||
return Promise.all([
|
||||
initAudio,
|
||||
modulesLoading,
|
||||
registerSynthSounds(),
|
||||
registerZZFXSounds(),
|
||||
|
||||
Reference in New Issue
Block a user