Tetorica Playground — For AI
Use these type definitions and working examples when generating JavaScript for the Tetorica browser Playground.
Type definitions
- Common Playground API
- YM2612 / Mega Drive selection
- YM2608 / PC-98 selection
- YM2203 / PC-98 selection
- YM2610 / Neo Geo selection
Read the common API and the one chip-selection file that matches the target Playground.
Working examples
The canonical example source is playground_examples.js. The following links load representative examples into the Playground. Loading an example does not run it automatically.
- Open these source files from Playground FILES → examples to run them.
- Live Loop — tempo, notes, and named loops
- Ambient Choir Sample — sample loading, FX, and live state
- Noise Ocean — generated noise and parameter control
- FM API Beep — direct YM2612 setup
- PSG Scale — SN76489-compatible tone API
- Parallel FX — branched effect routing
Execution contract
- Generate JavaScript, not TypeScript.
- Top-level
awaitis supported. - Playground APIs are available as globals and through
pg. - Use stable, unique names for independent
liveLoop()andlivePrepare()state. - Project files are read with
file(); relative paths resolve from the running file. - Network APIs and external package installation are unavailable during user-code execution.
Suggested prompt context
You are writing JavaScript for the Tetorica Playground.
Use only APIs declared in the linked common and selected-chip .d.ts files.
Follow the canonical working examples.
Return JavaScript that can be pasted into the Playground and run directly.