Skip to content

Neuroscript Simulator

Try out Neuroscript and other scripting languages in this interactive simulator. Write code, test with sample MIDI events, and see the results instantly—all right here in your browser.

🎹 Neuroscript Simulator
WASM idleWaitingWeb MIDI unavailable

Powered by the Neuroscript WASM engine with live syntax highlighting, autocomplete hints, and MIDI device preview.

Script editor

Neuroscript DSL with inline highlighting and autocomplete. Press ⌘/Ctrl + Space to show suggestions.

Syntax highlightedAutocompleteWASM-backedWeb MIDI
Autocomplete
Filter

Pick which events flow through.

Transform

Shape notes, velocity, CC, and channels.

Control flow

Conditionally change behavior.

Single-event runner

Send a test event through the WASM engine to see transformed output instantly.

Run the script to see output...

Web MIDI bridge

Connect a hardware device to audition scripts with real-time MIDI input. Output can be mirrored to a selected destination.

Web MIDI unavailable

Web MIDI runs locally in your browser and never leaves this page.

Last input
Waiting for data…
Last output
No output yet
Event log

What's new in the sandbox

  • Real Neuroscript WASM engine — the editor compiles and runs your DSL code in-browser, matching the runtime used in the app.
  • Syntax highlighting + autocomplete — inline hints for keep, drop, vel, channel maps, and conditional expressions.
  • Web MIDI bridge — connect hardware to audition transforms and optionally mirror output to another device.
  • Transport-aware events — adjust BPM/beat when you want to preview time-aware behaviours.

When building the docs locally, run npm run prebuild (or make docs-wasm) inside docs/web to copy the neuroscript-wasm package into public/ so the simulator can fetch the WASM bundle.

How to Use

  1. Write Your Script: Enter Lua or Neuroscript code in the editor
  2. Configure Test Event: Set the MIDI event type, channel, note/CC number, and velocity
  3. Run: Click "Run" to execute your script against the test event
  4. Inspect Output: See the transformed MIDI event and execution time

Example Scripts

Velocity Boost

lua
if event.type == 'noteOn' then
  event.data2 = MIDI.clamp(event.data2 + 20)
end
return event

Octave Transpose

lua
if event.type == 'noteOn' or event.type == 'noteOff' then
  event.data1 = MIDI.clamp(event.data1 + 12)
end
return event

Harmonizer

lua
if event.type == 'noteOn' then
  return {
    event,
    MIDI.noteOn(event.channel, MIDI.clamp(event.data1 + 4), event.data2),
    MIDI.noteOn(event.channel, MIDI.clamp(event.data1 + 7), event.data2)
  }
end
return event

MIDI Helper API

The MIDI object is available in all scripts:

  • MIDI.clamp(value) - Clamps value to 0-127 range
  • MIDI.noteName(note) - Converts MIDI note number to name (e.g., 60 → "C4")
  • MIDI.noteNumber(name) - Converts note name to MIDI number (e.g., "C4" → 60)
  • MIDI.NOTE_ON, MIDI.NOTE_OFF, MIDI.CC - Common MIDI constants

Alternative Testing

You can also test scripts directly in Neurode MIDI:

  1. Virtual Keyboard Tool: Use the built-in virtual keyboard to send test MIDI events
  2. MIDI Monitor: Watch incoming and outgoing MIDI streams in real-time
  3. Log Output: Enable detailed logging to see script execution results

Next Steps

  1. Test scripts directly in routes:

    • Create a route
    • Add a Script transform
    • Write and test your script
    • Use Virtual Keyboard to send test events
  2. Use MIDI Monitor:

    • See script output in real-time
    • Verify transformations work correctly
  3. Check examples:

Feature checklist

  • Live code editor — Write Neuroscript in-browser with highlighting and autocomplete
  • Test event input — Send custom MIDI events and tweak BPM/beat
  • Output visualization — View transformed events inline
  • Performance metrics — Per-run execution timing
  • Example library — Load, tweak, and remix common recipes

Use the Web MIDI panel to route a real controller into the Neuroscript engine and mirror the transformed stream to any connected output.

Alternative: Desktop Testing

Use the desktop app for script testing:

  1. Create test route with Virtual Keyboard
  2. Add your script transform
  3. Open MIDI Monitor to see output
  4. Play notes on Virtual Keyboard
  5. Iterate on script

Next Steps

Built with ❤️ for musicians