import { Component, createMemo, createSignal, lazy, onCleanup, Show } from 'solid-js'; import { Dynamic } from 'solid-js/web'; import { modeStore } from './stores/mode-store'; import { MODE_REGISTRY, getModeById } from './modes'; import { ModeSwitcher } from './modes/ModeSwitcher'; import styles from './App.module.css'; type Route = 'home' | 'primitives' | 'modes' | 'unknown'; function parseRoute(path: string): Route { if (path === '' || path === '/' || path === '/index.html') return 'home'; if (path === '/dev/primitives' || path === '/dev/primitives/') return 'primitives'; if (path === '/modes' || path === '/modes/' || path.startsWith('/modes/')) return 'modes'; return 'unknown'; } // Lazy-loaded so the home route doesn't pay the cost of loading every // primitive demo. Stream 9/10 can grow the showcase freely. const PrimitivesShowcase = lazy(() => import('./dev/PrimitivesShowcase')); const App: Component = () => { const [route, setRoute] = createSignal(parseRoute(window.location.pathname)); const onPop = () => setRoute(parseRoute(window.location.pathname)); window.addEventListener('popstate', onPop); onCleanup(() => window.removeEventListener('popstate', onPop)); const navigate = (path: string) => { if (window.location.pathname === path) return; window.history.pushState({}, '', path); setRoute(parseRoute(path)); }; return (
MEMLNaut playground

404

No route at {window.location.pathname}.

{ e.preventDefault(); navigate('/'); }}>back to home

); }; const ModesPage: Component = () => { const activeId = () => modeStore.state.activeModeId ?? MODE_REGISTRY[0]!.id; const ActiveComponent = createMemo(() => getModeById(activeId()).Component); return (
); }; interface HomeProps { navigate: (path: string) => void; } const Home: Component = (props) => { return (

MEMLNaut Playground

Interactive ML control of audio. Stream 9: nine modes, one shell.

ML inference runs on the main thread via WASM. Audio synthesis runs in an AudioWorklet — start it from inside any mode using the "Start audio" button. Audio cannot autoplay (browser policy).

); }; export default App;