Write your interface

Studio v1 is a small declarative JSON language, not a general-purpose scripting engine. You define the controls, ranges, choices, bindings and optional drawing route. The site renders only its own trusted components. It never runs uploaded Lua, JavaScript, HTML, expressions or remote libraries. Arbitrary layouts, custom callbacks and live device tuning are not supported in this version.

Small example

{
  "version": 1,
  "title": "My accessibility script",
  "description": "Tune the assistance to suit you.",
  "controls": [
    {"id": "strength", "type": "slider", "label": "Strength",
     "min": 0, "max": 100, "step": 1, "default": 30},
    {"id": "enabled", "type": "toggle",
     "label": "Enable assistance", "default": true},
    {"id": "mode", "type": "select", "label": "Mode",
     "options": ["Gentle", "Direct"], "default": "Gentle"}
  ],
  "path": {
    "label": "My drawing route",
    "points": [
      {"x": -40, "y": 0, "pen": false},
      {"x": 40, "y": 0, "pen": true}
    ]
  }
}

Bindings and limits

Every control has a unique lowercase id (letters, digits and underscores, starting with a letter; at most 32 characters). Its current value appears under that ID in the exported settings' values object. A script author must explicitly consume these values in their own tooling or script. They are not written to firmware storage.

Pairing your own Lua

Open or paste your Lua in the optional device-script section (64 KiB maximum). The website only holds this as text; it does not run or syntax-check it. “Export my tuned Lua script” prepends three local tables, then your unchanged code: studio_settings (named controls), studio_path (array of x/y/pen points) and studio_playback (durationMs, strength, stick, invertX, invertY). For example, your callback can read studio_settings.strength and studio_settings.enabled from the interface above. Strings are quoted as Lua data, not inserted as executable expressions. These are lexical bindings for the same source chunk, not persistent firmware storage.

Your code must use these bindings; existing scripts do not become configurable automatically. The download is not a code merger or a guarantee of safe device behaviour. Only use device scripts you trust. A project preserves the optional source in its script field; the complete project, including JSON escaping, must still fit within 128 KiB.

The interface permits up to 24 controls and 256 path points, in a JSON file of at most 128 KiB. Unknown fields and invalid values are rejected rather than ignored. Slider bounds must be finite numbers within -100000 to 100000, with a positive step dividing the range. Defaults and values must follow that step. Selects have 2–16 distinct string choices. The path field is optional; omit it for a settings-only interface.

Projects and settings

Download project saves the validated definition, current values, route and playback settings in a sleepus-studio-v1 envelope. Open that file to resume. Export settings produces sleepus-settings-v1 with interface, values, points and playback fields. There is no server storage or automatic saving. Keep your downloaded project; a page reload loses unsaved changes.

Drawing model

Zoom in/out changes only the view (50-800%). Two-finger trackpad scrolling pans horizontally and vertically; on a touchscreen, two fingers pan and pinch to zoom. A single finger still selects/drags points. Adding a second finger switches to view navigation; lifting one finger does not resume point editing until a new touch begins. Ctrl/Cmd + wheel zooms around the pointer. With the graph focused, + / - zoom, 0 resets the view, and Alt + arrow keys pan (Shift for a larger step). Reset view restores the centred 100% view without resetting the route. View changes neither enter Undo history nor affect playback/exports, and opening a project or reloading resets the view.

Ctrl+Z (Cmd+Z on Mac) or Undo graph change restores route additions, deletions, coordinates, pen state, flips and resets. Each complete drag is one change. Up to 100 changes are kept in this tab, not in project exports; opening a different project or reloading clears the history. Text fields keep their normal text undo. Playback calibration and custom-script settings are not graph history.

Click or tap a point to select it. Drag with a mouse, pen or touch to move it; movement stays inside the graph and snaps to whole coordinates. Click empty space to add a point. With the graph focused, press Delete to remove the selected point, or use arrow keys to move it (Shift for ten units). At least two points must remain. Delete in a text or coordinate field only edits that field. The selected-point dropdown, exact coordinate fields and Remove selected point button remain available without dragging.

The graph is a relative design plane, from -100 to 100 on both axes. Negative Y is up. The first point is the initial cursor position; its pen value is unused. Each later point's pen controls the segment arriving at it. Pen-up travel is dashed. Zero-length segments are skipped; a completely stationary route cannot be played.

Flip path horizontally (X) mirrors every X coordinate around zero; Flip path vertically (Y) mirrors every Y coordinate. Both can be applied together. The graph, selected coordinates, preview and exported points update immediately, including the starting point. Point order and pen lifts are unchanged. Flip the same axis again to undo, or reset the route to restore the interface's default points.

The browser preview moves a marker along the designed route, once. Lua export converts each segment into a constant stick direction and strength, distributing total duration by segment length. Duration is 1000–30000 ms; strength is 1–100 percent. Invert device X and Invert device Y independently change device output, not the design. Older projects without invertX load with X inversion disabled. Drawful export bakes X inversion into route directions while retaining the existing Y calibration setting. This is an open-loop direction/time model: no game cursor tracking or automatic calibration. Dead zones, acceleration, screen edges and game sensitivity can change the real result. Begin with a simple line and tune strength and duration in your game.

Drawful test pack

For device-memory compatibility, Drawful exports are limited to 64 points (63 segments). Larger exports are rejected without discarding points. The generic editor's limit remains 256 points.

The public firmware selector is unchanged and does not include the experimental Drawful test pack. Installing a custom export requires separately verified compatible test firmware. This page does not install or combine game packs.

Load Drawful test pack selects a compatible interface with "target": {"packId": "drawful", "configVersion": 1}. Target metadata is optional for generic interfaces; when provided, its ID must start with a lowercase letter and contain only lowercase letters, digits and hyphens (32 characters maximum). Its version must be an integer from 1 to 65535. Settings export preserves that target so a future importer can reject incompatible data.

Export Drawful test archive bakes your route and playback settings into a complete Drawful menu-bearing Lua pack. It accepts only route/playback settings: no additional controls or custom Lua. Coordinates and strength must be whole numbers; duration must use whole 100 ms steps. The pack offers Line, Square and House presets plus your Studio route. Calibration is stored separately from other packs under drawful_t1; changing the exported route/settings revision prevents stale calibration from silently overriding it.

The download is an SLUA archive, not a normal-mode configuration upload or a complete flash image. The current browser flasher cannot open this custom archive directly. An engineer must package it with the verified core before installation. The staged flasher catalog separately offers DRAWFUL TEST with built-in presets. No device is flashed by designing or exporting. On-device IMPORT CONFIG reports PC IMPORT NOT READY and does not change settings. Normal-mode PC import still needs a dedicated firmware transport.

Device player and installation boundary

The standalone export uses the existing firmware Lua APIs: on_input, controller.get_val, controller.set_val and controller.get_millis. Hold physical RT above 10 percent to play once; release to cancel or re-arm, and press B to cancel until RT is released. While playing, the selected stick and RT are overridden, including pen-up travel. Completion neutralises those outputs until release. Other controls pass through. A reconnection requires RT release before playing.

The Lua file defines its own input and connection callbacks. Do not append it to an existing profile: it would replace callbacks, not combine behaviours. Custom interface values remain separate; the standalone player uses only route/playback settings. This page does not install scripts, modify saved tuning, or send controller inputs. The current firmware flasher is not a generic custom-script installer. Device installation or integration into an existing Lua pack requires a separate reviewed firmware/package workflow; do not flash the downloaded text as firmware.

Use assistance with the player's consent and preferred settings, in games and situations where it is permitted. Start offline, keep cancellation accessible, and do not rely on this experimental tool for safety-critical tasks.